• Resolved marinafatbuzz

    (@marinafatbuzz)


    Hello!

    I’ve created a hook function according to your instructions here https://web-data.online/docs/woocommerce-distance-based-fee/

    
    // Calculate custom shipping fee
    function my_dbf_calculated_fee_callback( $calculatedFee, $miles, $divider, $price ) {
    	if ($miles <= 20) {
    	 	$calculatedFee = 15;
    	} elseif ($miles > 20 && $miles <= 40) {
    	 	$calculatedFee = 30;	
    	}
    
     	return $calculatedFee;
     }
     
     add_filter( 'dbf_calculated_fee', 'my_dbf_calculated_fee_callback', 10, 4 );
    

    However, it does not seem to work? Could you please let me know why?

    Thanks,
    Marina

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hook Function’ is closed to new replies.