hide cart when price is 0 code wishlist
-
Hi, I have woocommerce wishlist and request a quote plugin installed, in our beta staging site we are testing the code below, but when I add this code the add to wishlist button also disappears, can you help me with the code ?
function wpcustom_is_purchasable( $purchasable, $product ){ if( $product->get_price() == 0 ) $purchasable = false; return $purchasable; } add_filter( 'woocommerce_is_purchasable', 'wpcustom_is_purchasable', 10, 2 ); //Hide Price when Price is Zero add_filter( 'woocommerce_get_price_html','maybe_hide_price',10,2); function maybe_hide_price($price_html, $product){ if($product->get_price()>0){ return $price_html; } return ''; } // End of above code
The inspect element for the add to wishlist when the code above is not acti activated is:
<div id="wl-wrapper" class="woocommerce wl-button-wrap wl-row wl-clear "> <a rel="nofollow" href="" data-productid="10971" data-listid="" class="wl-add-to wl-add-but button "> Add to wishlist </a> </div>
thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘hide cart when price is 0 code wishlist’ is closed to new replies.