Skip to content
Advertisement

Tag: woocommerce

WooCommerce: How to change the product link conditionally?

In WooCommerce, I’m trying to change the default product link format https://domain-name.com/product/single-product-name/ for sold out products to the following format: https://domain-name.com/product/single-product-name/#reviews. So I need to add #reviews to the product link, if the product is sold out. Via functions.php, this removes the regular product link: But how can I turn this: into this? The relevant HTML structure for each product

How to hide a link using php and css

I am trying to apply some css in my php for a test to see how to hide a button in my php file. It’s not happening at the moment and I am not sure why it is not removing the button. HTML: PHP UPDATE The above code is a test code to try and fix the main code below:

How to get current selected variable product specific data in WooCommerce

I want to access the selected product variation Weight value in php. I tried below code its getting last value of attribute, not selected. Answer The selected variation properties can only be accessed via Javascript as it’s a client side live event… Here below is an example, that will display the selected variation custom attribute “attribute_weight” term slug for the

Advertisement