Archived topic
GP Hooks and Woocommerce Products
12 replies · Started by Neil on January 16, 2019
I'm not even sure where to start with this one.
I have created a custom taxonomy using the Pods plugin and have added an icon field. I have this custom taxonomy applied to my Woocommerce products.
I would like to show this icon on the product page somewhere near the product name and price.
I don't even know if this is the best way to do this but I was looking at the GP Hooks and the different locations where I can insert code. You have a very helpful document that shows all the locations for standard posts etc but not for Woocommerc products.
Am I going about this in the correct way? How can I add this icon to the products page?
Hi there,
this guide provides all the Hooks for the Single Product page:
https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
You can use the Hooks Element and select the Custom Field Hook to add ones that are not in the list.
Perfect, thanks. I obviously didn't look hard enough!
I'll have a play around and come back to you if I have any queries.
Glad to be of help.
Hi, a further question on the WC product page hooks. When using product variations, some of the text (variation description for example) changes when different variations are selected from the drop-down. Even if I add a filter to the variation description, I can't seem to get any additional text to display dependent on the selected variation. There is some JS affecting the text in the DOM so I must be able to piggy-back on this somehow, is this right?
The variation description is automatically displayed below the variation select. Can you share a link to the site so i can see whats not working? You can edit your original topic and use the Site URL field for privacy.
Hi, I've edited the original post to include the page that I am having issues with. I'm working locally so this is not 100% how it is on my dev machine nut you will hopefully see what I am trying to do.
I've been looking at adding a filter so that when the description changes I can append the updated pricing table to that text.
How is the pricing table added? The Description field accepts HTML.
I've created a function to pull it from the meta-data on the product. This function builds the HTML table.
Sorry can't see the function you refer to? If its code, then highlight it and use the Code tag buttons.
The code to generate the table works fine. It's showing on the page I have linked to. The issue is I want to update it based upon the selected product variant as the prices will be different. Of all the hooks I have tried, even add_filter to text which does update on the selection change, the prices don't seem to update.
Scratch this. I'm an idiot! I wasn't pulling the variation price through <facepalm>
Sorry for wasting your time!
Not a problem. Always cool to see what people are doing with GP especially Woo customizations :)