Hide price of the bundled product except for virtual one
-
Hi,
I’m using your plugin and so far so good.I just have one issue. I’m selling a bundle made of hardware part + software part.
Aka physical product and virtual product.
And I want to hide the physical part price so my customer can’t compare my price with my direct competitor, but because of legal reason, I still have to show it for the software part.
The bundle is made like this :
Bundle A : 1500$
( Hardware part x + Hardware part y + Hardware part z} < I want to hide these price >
( Software part 1 + Processing in our workshop 2 ) < I want to display those price >I already found a code to hide all the price :
add_filter( 'woocommerce_cart_item_price', 'hide_bundled_product_price', 99, 2 ); add_filter( 'woocommerce_cart_item_subtotal', 'hide_bundled_product_price', 99, 2 ); add_filter( 'woocommerce_order_formatted_line_subtotal', 'hide_bundled_product_price', 99, 2 ); function hide_bundled_product_price( $price, $cart_item = null ) { if ( isset( $cart_item['woosb_parent_id'] ) || isset( $cart_item['_woosb_parent_id'] ) ) { return ''; } return $price; }
Is there a way to change it a little bit to make this code non applicable to virtual product?
I mean show virtual product price while hiding the other product price ?
Thank you very much
- The topic ‘Hide price of the bundled product except for virtual one’ is closed to new replies.