I need some help. I have purchased B2B king plugin new. But i need more extra details,
1- I want to hide product description when i select hide price selection on plugin.
2- I have created purchase price area with 'Cost of Goods Sold (COGS)' plugin. Dynamic price rules are working from regular price, but i want to work it with my purchasig price. Is it possible?
Hello there,
I need some help. I have purchased B2B king plugin new. But i need more extra details,
1- I want to hide product description when i select hide price selection on plugin.
2- I have created purchase price area with 'Cost of Goods Sold (COGS)' plugin. Dynamic price rules are working from regular price, but i want to work it with my purchasig price. Is it possible?
Thanks for your helps. :)
Hello Muzaffer,
Thank you for purchasing our plugin,
(1) To hide descriptions for products, for logged out users, you can add this PHP code snippet to your site:
add_filter( 'woocommerce_product_tabs', 'customize_product_tabs', 100 ); function customize_product_tabs( $tabs ) { if ( ! is_user_logged_in() ) { unset( $tabs['description'] ); // remove the description tab } return $tabs; } add_filter('woocommerce_short_description', function($description){ if ( ! is_user_logged_in() ) { $description = false; } return $description; }, 10, 1);(2) This depends on each rule and I do not have a way to apply it to all rules.
However, I wrote a snippet that can make this work for Discount rules, and for Raise price rules:
add_filter('b2bking_discount_rule_regular_price', function($price, $product){ $product_id = $product->get_id(); $costprice = get_post_meta($product_id,'_alg_wc_cog_cost', true); if (!empty($costprice)){ $price = floatval($costprice); } return $price; }, 10, 2);For example, I have a rule that raises price by 50%:
I have a product with a cost of $25:
The price will show as $37.5 (cost x 150%)
The above PHP snippets can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
Kind regards,
Stefan