-
g.lanzi
Hi,
I am doing a website that would be a catalog for a customer that runs a rental car business. We already have WC running in catalog mode.
I understood that changing the single product template is not easy with WC, therefore it’s best to use hooks to apply blocks sections and such.
Since our product requires several custom field to be shown in tabs, it’s not easy to just stick to the default template.
I thought to use thewoocommerce_before_single_product
hook to apply my blocks and then hide everything else with phpremove_action
ad mentioned here: https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/#tab-description.Do you think it’s ok to do like so?
Thank you
-
Hi there.
yes, that is a perfectly valid method of customizing the template.
The altenative would be to make a copy of the
content-single-product
template in your child theme:https://github.com/wp-plugins/woocommerce/blob/master/templates/content-single-product.php
And then remove those hooks altogether. This may be slightly more performant then unhooking everything.
- You must be logged in to reply to this topic.