Support » Plugin: WooCommerce Distance Based Fee » Free distance

  • Resolved webfantastic

    (@webfantastic)


    Hi!
    Can I make free kilometers for this plugin? For example, we have delivery in the city a fixed price, it is 10 kilometers in radius, and the remaining kilometers are paid. Can you make the field free kilometers?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author webdata

    (@webdata)

    Hi,

    With the fee, try this:

    function wb_dbf_calculated_fee_callback( $calculatedFee, $kiloMeters, $divider, $price ) {
        if($kiloMeters < 10) {
    		$calculatedFee = 0;
    	} else {
    		$calculatedFee = ($kiloMeters / $divider) * $price;
    	}
    
        return $calculatedFee;
    }
    
    add_filter( 'dbf_calculated_fee', 'wb_dbf_calculated_fee_callback', 10, 4 );
    webfantastic

    (@webfantastic)

    I tried, but it doesn’t work. He’s counting all the miles from the point. It would be good to implement free kilometers in the delivery setup or in the module.

    Plugin Author webdata

    (@webdata)

    Hi,

    There will be more logics in the next version of the plugin, and also your suggestion has been noted.

    Kim

    Plugin Author webdata

    (@webdata)

    Hi,

    The latest version of the plugin has this feature. Please let me know if you need any more assistance on this.

    Kim

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.