Support » Plugin: Minimum Purchase Amount For Woo Cart - For WooCommerce » Set minimum per shipping method or payment gateway

Viewing 1 replies (of 1 total)
  • Plugin Author cttalks

    (@cttalks)

    @vincent14000,
    Sorry for the delay in the response,
    You can do it with the help of the filter ‘ct_mpac_filter_min_cart_total’ refer the following code,

    add_filter('ct_mpac_filter_min_cart_total', 'filterMinimumPurchaseAmountByShipping', 12, 2);
    
    if(!function_exists('filterMinimumPurchaseAmountByShipping')) {
    	function filterMinimumPurchaseAmountByShipping($minimumPurchase, $wcCart) {
    		$selectedShippingMethod = WC()->session->get( 'chosen_shipping_methods' );
    		if(!empty($selectedShippingMethod)) {
    			if($selectedShippingMethod[0]=='flat_rate:3') {
    				$minimumPurchase = 500;
    			}
    		}
    
    		return $minimumPurchase;
    	}
     }
Viewing 1 replies (of 1 total)
  • The topic ‘Set minimum per shipping method or payment gateway’ is closed to new replies.