Remove Price from Addon Display
Add “gspc-remove-price” to your field’s CSS Class Name setting and this snippet will automatically remove the price from the product’s description in the cart.
This snippet expects the “Item Meta Display” feed setting to be “Default.”
Default description: Product – Drop Down: First Choice ($10.00) × 2
Price removed: Product – Drop Down: First Choice × 2
Code
Filename: gspc-remove-price-from-addon-display.php
<?php
/**
* Gravity Shop // GS Product Configurator // Remove Price from Addon Display
* https://gravitywiz.com/documentation/gravity-shop-product-configurator/
*
* Add "gspc-remove-price" to your field's CSS Class Name setting and this snippet will automatically remove the
* price from the product's description in the cart.
*
* This snippet expects the "Item Meta Display" feed setting to be "Default."
*
* Default description:
* Product - Drop Down:
* First Choice ($10.00) × 2
*
* Price removed:
* Product - Drop Down:
* First Choice × 2
*/
add_filter( 'gspc_show_addon_price', function( $show, $product_field ) {
if ( strpos( $product_field->cssClass, 'gspc-remove-price' ) !== false ) {
return false;
}
return $show;
}, 10, 2 );
This is not working in my sites. I have 3 websites and dont work in any
Hi José,
Thanks for bringing this to our attention. The snippet has been updated, and it’s working as expected now. Please copy the code again and try again.
Best,