• Resolved debruning

    (@debruning)


    Hey guys,

    In the past I have overwritten part of Woocommerce’s templates by putting them into the appropriate location in my child theme. I am currently trying to do the same for my product-image.php file but the file in the child theme is being completely ignored. I am wondering if anyone else has come access this issue, and if so, did you find a way to fix it?

     

    Thank you so much for your help!

    David

    PS:
    Woocommerce template path:
    /public_html/wp-content/plugins/woocommerce/templates/single-product/product-image.php

    Path for my child theme:
    /public_html/wp-content/themes/storefront-child/woocommerce/single-product/product-image.php

    • This topic was modified 1 year, 12 months ago by debruning.
    • This topic was modified 1 year, 12 months ago by James Huff.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @debruning

    It seems you have overridden the file properly, even though I make sure of a couple of things.

    • Make sure you have an override into the active theme.
    • Make sure you have put your changes in the override file; otherwise, it will give the same output.
    • If all is good, check once in the private browser and clear the cache.

    Hope this helps!!

    Hi @debruning

    Template overrides can be finicky sometimes. I’ve fought battles with them a few times myself.

    Here’s a shortcut I sometimes use to get the woocommerce folder created. In your WordPress dashboard, go to WooCommerce > Settings > Emails and click on the “Manage” button for one of the emails in the list, like the New Order email. There’s an option there to copy the template to the theme.

    When you click on that, WooCommerce will create the override folder for you. Then you can open it up in your code editor and add a new sub-folder for?single-product?and then the?product-image.php?file.

    Give that a try and see if it will let you do your change.

    Thread Starter debruning

    (@debruning)

    Hey guys, appreciate the replies ??

    I was able to confirm the override folder for my child theme is working

    (I have customized several php files so that isn’t surprising), but copying the file just doesn’t seem to be allowing the override from the default woocommerce template.

    Happily, I was able to find a plugin that does what I was looking for, though I sad that this issue did manage to defeat me. But it’s a Friday, so I will just throw out thank you’s to both of you again and be happy with the win. ??

    Have a great weekend guys!

    • This reply was modified 1 year, 11 months ago by debruning.
    • This reply was modified 1 year, 11 months ago by debruning.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem overriding product-image.php with child theme’ is closed to new replies.