Amount Left for Free Shipping for WooCommerce plugin lets you display the amount left for free shipping in WooCommerce.
You can display the amount on cart page, mini cart widget, “Amount Left for Free Shipping” widget, checkout page, “add to cart” notice and/or store notice.
[alg_wc_left_to_free_shipping]
shortcode:[alg_wc_left_to_free_shipping content="%amount_left_for_free_shipping% left for free shipping"]
alg_wc_get_left_to_free_shipping()
PHP function:alg_wc_get_left_to_free_shipping( "%amount_left_for_free_shipping% left for free shipping" );
Plugin Options
Plugin settings are located in “WooCommerce > Settings > Amount Left for Free Shipping”.
- Content Options
- General Options
- AJAX Options
- Advanced Options
- Cart Options
- Mini-cart Options
- Checkout Options
- Store Notice Options
- Add to cart Notice Options
- Advanced: Manual Min Amount Options
- Styling Examples
- Progress Bar
Content Options
In all plugin messages you can use HTML and/or shortcodes. Available placeholders:
%amount_left_for_free_shipping%
%free_shipping_min_amount%
%current_cart_total%
%amount_left_for_free_shipping_raw%
%free_shipping_min_amount_raw%
%current_cart_total_raw%
Some Postions (e.g. “Order review: after Shipping”) are outputted inside a HTML table, so you need to wrap it in HTML table row tags, e.g.:
%amount_left_for_free_shipping% left for free shipping </pre> <p>
General Options
- Include discounts
- Include discounts when calculating cart total.
- Default:
yes
- Default:
- Message on free shipping reached: Content
- Outputted when min free shipping amount is reached. You can use HTML and/or shortcodes here. To disable – set it empty. For more information please check the Content Options section.
- Default:
You have free delivery!
- Default:
- Message on empty cart
- If disabled, then standard content is outputted.
- Default:
no
- Default:
- Message on empty cart: Content
- E.g.:
Free shipping on orders over %free_shipping_min_amount%!
. For more information please check the Content Options section. Ignored unless “Message on empty cart > Custom message” checkbox is enabled.- Default: None
AJAX Options
Enable this section if you want the amount to be updated via AJAX, e.g. when using plugin’s “Store notice” section, or WooCommerce “Enable AJAX add to cart buttons on archives” option, or for some positions in cart, when customer updates items quantities and the amount text is positioned outside of automatically refreshed area.
- Enable AJAX
- Default:
no
- Default:
- Additional events
- Additional JavaScript events to update the amount text on. Leave empty if unsure.
These events are always included:updated_cart_totals added_to_cart removed_from_cart wc_fragment_refresh updated_checkout wc_cart_emptied
- Default: None
- Added to cart event without AJAX
- Fires a custom event
alg_wc_alfs_added_to_cart
in case a product has been added to cart without AJAX. Enable it if the “Store notice” is not getting displayed on single product pages.- Default:
no
- Default:
Advanced Options
- Check for free shipping
- Check for already available alternative (i.e. not requiring minimum order amount) free shipping methods. No text will be outputted in this case.
- Default:
no
- Default:
- Check for virtual cart
- Check if cart consists of virtual products only. No text will be outputted in this case.
- Default:
no
- Default:
Cart Options
Outputted on the cart page.
- Enable/Disable
- Enable/disables the “Cart” section.
- Default:
no
- Default:
- Content
- For more information please check the Content Options section.
- Default:
%amount_left_for_free_shipping% left for free shipping
- Default:
- Position
- Possible values: Before cart; Before cart table; Before cart contents; Cart contents; Cart coupon; Cart actions; After cart contents; After cart table; Cart collaterals; After cart; Before cart totals; Cart totals: Before shipping; Cart totals: After shipping; Cart totals: Before order total; Cart totals: After order total; Proceed to checkout; After cart totals; Before shipping calculator; After shipping calculator; If cart is empty.
- Default:
After cart totals
- Default:
- Position order (priority)
- Here you can move the info inside the Position selected above.
- Default:
10
- Default:
Mini Cart Options
Outputted in the mini cart widget.
- Enable/Disable
- Enable/disables the “Mini-cart” section.
- Default:
no
- Default:
- Content
- For more information please check the Content Options section.
- Default:
%amount_left_for_free_shipping% left for free shipping
- Default:
- Position
- Possible values: Before mini cart; Before mini cart contents; After mini cart contents; In mini cart total; Before mini cart buttons; In mini cart buttons; After mini cart buttons; After mini cart.
- Default:
After mini cart
- Default:
- Position order (priority)
- Here you can move the info inside the Position selected above.
- Default:
10
- Default:
Checkout Options
Outputted on the checkout page.
- Enable/Disable
- Enable/disables the “Checkout” section.
- Default:
no
- Default:
- Content
- For more information please check the Content Options section.
- Default:
%amount_left_for_free_shipping% left for free shipping
- Default:
- Position
- Possible values: Before checkout form; Before customer details; Billing; Shipping; After customer details; Before order review; Order review; Order review: Before shipping; Order review: After shipping; Order review: Payment: Before submit button; Order review: Payment: After submit button; After order review; After checkout form.
- Default:
After order review
- Default:
- Position order (priority)
- Here you can move the info inside the Position selected above.
- Default:
10
- Default:
Store Notice Options
Site-wide notice. You may also want to enable “General > AJAX” option for this.
- Enable/Disable
- Enable/disables the “Store Notice” section.
- Default:
no
- Default:
- Content
- For more information please check the Content Options section.
- Default:
%amount_left_for_free_shipping% left for free shipping
- Default:
- Hide
- In milliseconds. Set to zero to show the notice permanently.
- Default:
0
- Default:
- Position
- Possible values: Bottom; Top.
- Default:
Bottom
- Default:
- Background color
- Default:
#3d9cd2
- Default:
- Text color
- Default:
#fff
- Default:
- Text alignment
- Possible values: Left; Right; Center; Justify.
- Default:
Left
- Default:
Add to cart Notice Options
Notice displayed when “Add to cart” button is clicked.
- Enable/Disable
- Enable/disables the “Add to cart Notice” section.
- Default:
no
- Default:
- Content
- For more information please check the Content Options section.
- Default:
%amount_left_for_free_shipping% left for free shipping
- Default:
- Position
- Possible values: Before the standard text; After the standard text.
- Default:
After the standard text
- Default:
- Glue
- “Glue” is inserted between the standard “add to cart” text and “left for free shipping” text.
- Default:
Advanced: Manual Min Amount Options
Generally the plugin will retrieve the minimum free shipping order amount automatically, however, if you are using non-standard shipping methods for free shipping (i.e. not the original “Free shipping” method from WooCommerce), you need to set the amount manually here.
- Manual min amount
- Enable/disables the “Manual min amount” section.
- Default:
yes
- Default:
Manual Min Amount
Ignored if set to zero.
- Manual min amount
- Default:
0
- Default:
Extra Options
Here you can optionally select user roles, currencies and/or shipping zones to set individual manual min amounts for. Select values and “Save changes” for new option fields.
- User roles
- Default: None
- Currencies
- Default: None
- Shipping zones
- Default: None
Styling Examples
There is a number of ways you could restyle the messages. For example, you can add tag with
style
attribute, e.g.:
<span style="color: red; font-size: small;">%amount_left_for_free_shipping% left for free shipping</span>
Or if you want to create an alert box:
</pre> <div style="background-color: #ff9800; color: white; padding: 15px;">%amount_left_for_free_shipping% left for free shipping</div> <p>Progress Bar
To display the amount as a graphical progress bar instead of a text, you can use HTML
tag and plugin’s
_raw
amounts. For example, try adding this to the “Content” option:Or if you need an inverted value:
If you’d like to restyle the progress bar, check this page.