Add Free Shipping Option for Orders Over a Certain Amount 
Autor: Nigel B.
Visitado 362,
Followers 2,
Compartido 0
Hi Incomedia,
Can I make a suggestion to add an option to give customers free shipping if their order meets a certain value?
I have an online health shop: www.thetahealth.co.za and want to the be able to have it automatically cancel the customer's shipping cost when their order meets or goes over a certain value.
I notice many online health shops are providing their customers with this benefit, but website X5 doesn't have such an automated option.
I thought about using the coupon option to activate discounts on certain order totals, but would prefer to just have the shipping cost removed.
Kind regards, Nigel
Publicado en

@KolAsim,
Nigel, KolAsmin has a very good expertise to fix this by CSS, JS coding. Here I am poor...
Mays be if he read this post he can do something to check the amount of the order and to put the delivery to zero if necessary into the cart
Axel
Oups,
May be it is possible by this way.
Not tested
Axel
works fine.
And for an order above 100
Autor
Thanks Axel, but I also need to have the shipping calculated on weight rather than number of products. I don't think X5 can do both together.
Here into product you have this one
Please take time to check by yourself and open the software... !!!!
Axel
(It > En) ... there's an invention of mine out there, along with variations of it, depending on the desired purpose...
... it works dynamically outside the program...
... in addition to the shipping types you already have, you could add one more, similar to this:
Free shipping on orders over R 700.00
Free shipping on orders over R 700.00 >> [R 0.00]
... with my code, if the total gross amount of the products is greater than (R700.00), all shipping types disappear, leaving only the last one with the corresponding radio button selected...
...
.... so if you're interested, add this new shipment below the others, publish the change, and let me know so I can evaluate it...
.
.
ciao
.
.
Hey KolAsim,
Could you post here your code for my demo. I will implemente it into the demo to help users.
https://wsx5demo.afsoftware.fr/boutik-copy.php
Axel
ciao Axel, under the others, add an additional shipment similar to this:

.
Hey KolAsim,
Done ... over 500 €
Autor
Thanks KolAsim. Yes, I have been playing around with your idea and seems to do the trick.
I'm going to experiment with my discount option first and see how it goes then will use your option if the discount option does produce results.
I appreciate your input and yours too Axel.
... OK... the code is valid if the ZERO format ("0.00 €") remains as currently set on your page:
const stringaZeroK = "0.00 €";
... you set the spending limit here:
const limiteSpesaK = 500;
... this is the code, and you must verify that it doesn't conflict with any EXTRA codes you already use:
<script>
$(document).ready(function () {/**K>**/
/**--spese spedizioni gratuite oltre un certo importo di spesa x WSx5 - by KolAsim -- **/
const stringaZeroK = "0.00 €";
const limiteSpesaK = 500;
const objectK = "#cart-sidebar .cart-total";
/**funzioni di controllo K**/
function totaleCartKSpedizioneK() {/*totaleCartKSpedizioneK()>*/ let nrK = 0; const maxnrK = 10; const intervalK = 500; const totaleCartK = setInterval(function () { /*totaleCartK>*/ const $totaleprezzoK = $(objectK); if ($totaleprezzoK.length > 0 && $totaleprezzoK.first().is(":visible")) { const stringaPrezzoK = $totaleprezzoK.first().find(".right").text().trim(); const estraenumeroK = parseFloat( stringaPrezzoK .replace(/[^\d.,]/g, "") .replace(",", "") .trim() ); console.log("Testo letto:", stringaPrezzoK); console.log("Valore numerico:", estraenumeroK); if (!isNaN(estraenumeroK)) { clearInterval(totaleCartK); if (estraenumeroK > limiteSpesaK) { const $div_customK = $('<div id="shipping-warning" style="background-color: #ffefc2; color: #664d03; border: 1px solid #ffd966; padding: 10px; margin-bottom: 15px; font-weight: bold; text-align: center; border-radius: 4px;">Spedizione gratuita selezionata automaticamente per totale spesa superiore a '+limiteSpesaK+' €</div>'); $(".shipping-table").before($div_customK); setTimeout(() => { $div_customK.fadeOut(400, function () { $(this).remove(); }); }, 3000); const rigaValZeroK = []; $(".shipping-table tbody tr").each(function () {/*eachK1>*/ const $row = $(this); const stringaPrezzoK = $row.find(".col-price-ship-pay > div").first().text().trim(); if (stringaPrezzoK === stringaZeroK) { rigaValZeroK.push($row); } });/*eachK1>*/ $(".shipping-table tbody tr").each(function () {/*eachK2>*/ $(this).hide(); $(this).find("input[type=radio][name='shipping-method']") .prop("disabled", true) .prop("checked", false); });/*eachK2<<*/ /*RADIO CLICK*/ if (rigaValZeroK.length > 0) { const ultimoZeroK = rigaValZeroK[rigaValZeroK.length - 1]; ultimoZeroK.show(); ultimoZeroK.find("input[type=radio][name='shipping-method']") .prop("disabled", false) .prop("checked", true).click(); } } else { $(".shipping-table tbody tr").each(function () { $(this).show(); $(this).find("input[type=radio][name='shipping-method']") .prop("disabled", false); }); } } } nrK++; if (nrK >= maxnrK) { clearInterval(totaleCartK); } }, intervalK);/*totaleCartK<<*/ } if (window.location.hash === "#step2") { totaleCartKSpedizioneK(); } window.addEventListener("hashchange", function () { if (window.location.hash === "#step2") { totaleCartKSpedizioneK(); } }); });/**K<<**/
</script>
.
ciao
.
... OK... when and if you're interested, and when you've applied the extra "zero" (0) line like in my STAMP, let me know, and I'll come back here to evaluate the situation...
.
ciao
.
Hey KolAsim,
Great job.
works like a charm here over 300€ into my example
https://wsx5demo.afsoftware.fr/boutik.php
Again thank you...


... I'm glad, .... and I saw that you were able to personalize the text of the message, an option I had forgotten, well done!...
.
ciao
.