add_filter( 'wdp_save_cart_item_keys', function ( $keys ) { $keys[] = 'pricing_item_meta_data'; return $keys; }); add_filter( "wdp_get_product_price", function ( $price, $product, $price_mode, $item_meta ) { if ( isset( $item_meta['pricing_item_meta_data']['_price'] ) ) { $price = $item_meta['pricing_item_meta_data']['_price']; } return $price; }, 10, 4 ); add_filter( "wdp_get_product_qty", function ( $qty, $cart_item ) { if ( isset( $cart_item['pricing_item_meta_data']['_quantity'] ) ) { $qty = $cart_item['pricing_item_meta_data']['_quantity']; } return $qty; }, 10, 4 ); add_filter( 'wdp_exclude_hooks_when_add_to_cart_after_disable_pricing', function ( $hooks, $cart_item ) { if ( isset( $cart_item['pricing_item_meta_data'] ) ) { $_REQUEST = array_merge( $_REQUEST, $cart_item['pricing_item_meta_data'] ); $_REQUEST['quantity'] = $cart_item['pricing_item_meta_data']['_quantity']; } return $hooks; }, 10, 2 ); add_filter( 'wdp_exclude_hooks_when_add_to_cart_calculated_items', function ( $hooks ) { return array_merge( $hooks, array( 'woocommerce_add_to_cart_quantity', 'woocommerce_add_cart_item' ) ); }, 10, 1 );
WooCommerce Measurement Price Calculator, by SkyVerge Print
Created by: Alex Prokaev
Modified on: Fri, 6 Sep, 2019 at 4:01 PM
Did you find it helpful? Yes No
Send feedbackSorry we couldn't be helpful. Help us improve this article with your feedback.