Why does it not display even though the min amount is set?

Top WooCommerce & WordPress Plugins Forums Amount Left for Free Shipping for WooCommerce Why does it not display even though the min amount is set?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #88427
    Kelton Smith
    Guest

    Hi,

    I had a problem with showing Amount Left For Free Shipping notification message using shortcode.

    The problem was that only Free Shipping message shows when total cart amount exceed min amount set by this plugin, and not showing Amount Left For Free Shipping notification at all.

    So I reviewed the plugin source files and found the following thing.
    includes/class-alg-wc-alfs-core.php > at line 472 of get_left_to_free_shipping() function .

    ( $args['min_cart_amount'] > 0 && $this->get_cart_total() > $args['min_cart_amount'] )

    As I understood, this function is supposed to render the content for notification message like “Message on free shipping reached”, “Message on empty cart”, “Amount left to free shipping notification message”.

    And the above condition explains that when Minimum Amount for Free Shipping is set and current Total Cart Amount is exceed with this amount.

    That is, this function tries to render notification message only when current cart amount is exceed the desired min amount, and therefore, below code of that condition only runs when total cart amount exceed min amount set by the plugin.

    So I think only free delivery message shows, not showing amount left for free shipping message at all, and I am a bit confused with it.

    When we commented out $this->get_cart_total() > $args['min_cart_amount'] ), it show proper message based on current total cart amount and min amount.

    Not sure I understood the logic of above function correctly, but commenting out above condition resolved our issue.

    Could you double check about this and let me know if I understood wrongly or anything I missed when setting up the plugin?

    Best Regards,

    Kelton

    #88428
    blankPablo
    Moderator
    Plugin Support

    Hi Kelton,

    Sorry for the delay.
    Probably, you should have simply misunderstood some of our options.

    The 'min_cart_amount' present on the code you mentioned is the minimum total cart amount required to display the amount left text.

    That option was a bit misleading the way it was before and commonly confused with the Manual min amount option. But since version 2.0.8 we now believe that it is on a more appropriate location.

    You can find it now at:
    – General > Hide the amount left text > By cart amount

    So we think that our current code is correct.
    Please make sure that you have the most recent version of the plugin and let us know if you think it makes sense.

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