Woocommerce Missing Functions in Single Product Layouts

Hello there, I have been delving into the wonderful world of product layouts, and I am discovering that many plugins don’t seem to be fully compatible with the dynamic content fields that Pro produces.

For instance, I’ve got a bulk pricing plugin that automatically puts a bulk pricing table on the single product page (hooking into the woocommerce_single_product_summary function), but since that function isn’t called on my layout, the plugin doesn’t render the table. I managed to get around this by creating my own shortcode that renders the function and removes all the other actions from it.

That being said, I’ve also noticed that the Price field operates in the same way. Certain plugins can’t dynamically change the price field because some of it happens in the woocommerce_single_product_summary function. I’ve managed to wangle it to get it to work, but it would be so much easier if you all would allow the default hooks to operate on the single product pages or at least give us the option of implementing them on the page without crazy custom dev.

I’m sure you all are looking for solutions to these same things and I’m looking forward to seeing them, but I just thought I’d communicate some of the hangups I’m experiencing.

I just wanted to follow up with the comment about the price field not updating. I found a pretty straightforward way to get the product price on a page without missing other modifications made by Woocommerce or other plugins. I added the following code to my functions.php that creates a shortcode to pull the live price within a product looper or on a single product page.

function otvp_price {
    woocommerce_template_single_price(); 
} 
add_shortcode( 'product_price', 'otvp_price' );

I put the shortcode [product_price] into a raw content element, added some element CSS, and saved it as a preset for easy reuse. Hope this helps someone!

Hi @bobbybosler,

Glad to hear you were able to get it working. We’ve tried to make sure we include as many WooCommerce hooks as possible, but there are some like woocommerce_single_product_summary that won’t run. That hook is used to determine the location of things like the title and price, but that’s what the builder is for. If we run the hook, you wouldn’t have control over the styling or presentation of the items it contains. Unfortunately, it may take a bit of custom wiring (like your example) to get functionality from other plugins working.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.