Get_price_html() cause php error

Hey there, just had a client update the Pro theme and it caused this:

Fatal error: Uncaught Error: Call to a member function get_price_html() on null in /home/hclgfdmy/public_html/ontovictorypress.com/wp-content/plugins/woocommerce/templates/single-product/price.php on line 25

I’m doing some checking on my end, but do you have any idea what this is??

update: I looked into my function.php and see that I created the following shortcode:

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

This was what I had used everywhere on the site to output my product price (inside of loopers) and now apparently it’s creating a fatal php error. Any direction on fixing this?

Update: From what I can see online, that error comes when the php doesn’t know what the product is. But all of my instances are happening inside of a looper, so that shouldn’t be an issue.

Hello @bobbybosler,

Thanks for writing in! Your custom PHP shortcode may only work for single products. If you have variable products, it may cause a fatal error. Please temporarily deactivate your shortcode and test the site again. If the Fatal error disappears, that means that you will have to recode your shortcode.

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third-party developer.

Best Regards.

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