• Resolved GregRuelle

    (@selfemedia)


    There are no filters available to modify the free delivery rule in this file: /bpost-shipping/classes/options/class-wc-bpost-shipping-options-base.php line 192

    Adding a small line of code could provide greater flexibility for shop managers.

    public function is_free_shipping( $country_iso_2, $amount, array $free_shipping_coupons ) {
    // Apply a filter to determine if free shipping should be applied
    $free_shipping = apply_filters('wc_bpost_is_free_shipping', false, $country_iso_2, $amount, $free_shipping_coupons);

    return $free_shipping
    || $this->is_free_country_for_amount( $country_iso_2, $amount )
    || $this->has_free_shipping_coupon( $free_shipping_coupons );
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Antidot developer

    (@antidot-dev)

    Hi,

    Thanks for the proposition, it’s a good idea. Are you sure you would not prefer something like this ?:

    public function is_free_shipping( $country_iso_2, $amount, array $free_shipping_coupons ) {
    $is_free_shipping = $this->is_free_country_for_amount( $country_iso_2, $amount )
    || $this->has_free_shipping_coupon( $free_shipping_coupons );

    // Apply a filter to determine if free shipping should be applied
    return apply_filters('wc_bpost_is_free_shipping', $is_free_shipping, false, $country_iso_2, $amount, $free_shipping_coupons);
    }

    This solution permits to a shop manager to force the return false.

    Thread Starter GregRuelle

    (@selfemedia)

    Perfect, that’s even better!

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