Custom single product page – syntax to call on other WC sections?
-
Hi
In my quest to reject the bloat of page builders by no longer using them, I’m making some manual customizations to WooCommerce PHP theme pages instead.
I’m trying to keep the customizations confined to one file: content-single-product.php.
I’ve put the file in the appropriate file structure within my child theme. All good.
I’m using a combination of calling on native WordPress code, and also embedding ACF fields with PHP, inside my own HTML structures.
I know some code, but I don’t know PHP.
I’ve been searching all day, but I can’t for the life of me figure out how to do the most fundamental thing:
What is the syntax to simply call the following sections:
* Product Reviews
* Recommended Products, or Featured Products, etc.Looking at the first one, product reviews, I can clearly see which primary templates are involved with rendering product reviews (review.php and single-product-reviews.php).
But my issue is this: What is the exact code for calling the product reviews to display in my custom HTML div inside content-single-product.php? I have no idea, and was not able to find any help relating to this. I imagine it is super short and simple, but I just don’t know it.
I removed the product tabs (which usually houses the reviews) altogether, which is why I am adding the reviews separately as per my design, in my own custom HTML section. (The really odd thing to me is that when I view the template code for the Tabs, there is seemingly no reference to reviews at all…..so there was no hint to be found there).
I don’t want to do this in functions.php. I am happy to customize this one file, content-single-product.php, as it needs to be customized for many reasons.
So, what is the syntax for achieving what I need to? And can I use the same syntax anytime I need to call other sections in content-single-product.php that have their own php file (like product recommendations/related products, etc?
I’d greatly appreciate some assistance here…
- The topic ‘Custom single product page – syntax to call on other WC sections?’ is closed to new replies.