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