Skip to content

Commit

Permalink
gspc-remove-zero-dollar-woocommerce-products-from-summary.php: Adde…
Browse files Browse the repository at this point in the history
…d snippet for removing zero dollar woocommerce products from summary.
  • Loading branch information
saifsultanc committed Sep 14, 2024
1 parent 01fd7b7 commit c9fd604
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if ( is_callable( 'gs_product_configurator' ) ) :
add_filter( 'gform_product_info', function ( $product_info, $form, $entry ) {
if ( isset( $product_info['products'][ \GS_Product_Configurator\WC_Product_Form_Display::BASE_PRICE_PRODUCT_FIELD_ID ] ) ) {
$price = $product_info['products'][\GS_Product_Configurator\WC_Product_Form_Display::BASE_PRICE_PRODUCT_FIELD_ID]['price'];
$price = $product_info['products'][ \GS_Product_Configurator\WC_Product_Form_Display::BASE_PRICE_PRODUCT_FIELD_ID ]['price'];
$numeric_price = (float) preg_replace( '/[^\d.]/', '', $price );

if ( $numeric_price == 0.0 ) {
Expand Down

0 comments on commit c9fd604

Please sign in to comment.