Home › Forums › Amount Left for Free Shipping for WooCommerce › Why does it not display even though the min amount is set?
- Support forum for the Amount Left for Free Shipping for WooCommerce.
- This topic has 1 reply, 2 voices, and was last updated 1 year, 7 months ago by Pablo.
November 4, 2021 at 9:24 am #88427Kelton SmithGuest
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
( $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?
KeltonNovember 9, 2021 at 11:16 pm #88428PabloModeratorPlugin Support
Sorry for the delay.
Probably, you should have simply misunderstood some of our options.
'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.
- You must be logged in to reply to this topic.