Woocommerce hooks and child theme files

Hello,

Problem 1

I need to make a custom edit for my client and he wants to add the category of the product before product title in shop archive or anywhere a product is shown.

I could reach that using this code:

I know this function is working because I have tested it on another instance with different theme. The problem is that hook "woocommerce_before_shop_loop_item_title" is not working and I'm wondering if the devs have deleted those hooks or changed their name? I don't know but I would like to get a result.

P.S. I have tried other hooks like "woocommerce_single_product_summary" and it worked but of course, that's not the hook that I need but the before item title I do.


Problem 2

While I was trying to use child theme files, I copy the files in child theme, I assure that I'm actively using child theme, and my files aren't recognized by child theme. Several files that I've tried "single-product.php", "archive-product.php", "content-product.php".


Thank you in advance,

Sebastian.

Comments

  • Hi,

    1) Are you using the custom templates, or the ones from the theme options?

    2) Are copying the files only or the whole path to them? If the files only, please, try to copy the whole path. The catalogs do not have to have files you do not use.


    Best regards

  • Hello,


    1) I guess I'm using from theme options because I do not created any template but using your builder in Templates.

    2) I have copied only the files that I need from parent theme to child theme like that:

    Parent: /themes/betheme/woocommerce/content-product.php

    Child: /themes/betheme-child/woocommerce/content-product.php


    Thank you,

    Sebastian.

  • 1) I contacted the dev team, and they said this hook was not added to our theme.

    We will add it in the next update.

    2) If you followed the steps for Child theme installation like in our documentation, and the path is correct, then your changes should work. However, there is the possibility that you made some mistakes in the code, which is why it is not working. However, we do not provide help with the file modifications, so I cannot tell what exactly could be the reason.


    Best regards

Sign In or Register to comment.