Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wcfmmp_free_shipping_minimum_order_amount', function( $min_amount, $vendor_id ) {
- $line_subtotal = $line_total = 0;
- foreach ( WC()->cart->get_cart() as $key => $item ) {
- if( $vendor_id == wcfm_get_vendor_id_by_post( $item['product_id'] ) ) {
- $line_subtotal += $item['line_subtotal'];
- $line_total += $item['line_total'];
- }
- }
- return ($min_amount > $line_subtotal) ? $min_amount - $line_subtotal + $line_total : 0;
- }, 999, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement