Skip to content

Commit f38e371

Browse files
committed
gspc-remove-price-from-addon-display.php: Added new snippet to selectively hide the price from addon display for specific fields.
1 parent 99bd5bb commit f38e371

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Gravity Shop // GS Product Configurator // Remove Price from Addon Display
4+
* https://gravitywiz.com/documentation/gravity-shop-product-configurator/
5+
*
6+
* Add "gspc-remove-price" to your field's CSS Class Name setting and this snippet will automatically remove the
7+
* price from the product's description in the cart.
8+
*
9+
* This snippet expects the "Item Meta Display" feed setting to be "Default."
10+
*
11+
* Default description:
12+
* Product - Drop Down:
13+
* First Choice ($10.00) × 2
14+
*
15+
* Price removed:
16+
* Product - Drop Down:
17+
* First Choice × 2
18+
*/
19+
add_filter( 'gspc_show_addon_price', function( $show, $product_field ) {
20+
if ( strpos( $field->cssClass, 'gspc-remove-price' ) !== false ) {
21+
return false;
22+
}
23+
24+
return $show;
25+
}, 10, 2 );

0 commit comments

Comments
 (0)