Hi, I'm not sure if this matter has been discussed in this forum before, but anyway, I'll give it a go:
I have set the free shipping limit to a certain sum. Let's say it's 500 SEK.
I have a lot of campaigns running with different rebates.
Now,,, I'd like the free shipping limit to be calculated on the total after any discount coupon has been used by the shopper.
Example: Customer buys for a total of 501 SEK - this gives her or him free shipping. Then the coupon is added and let's assume the total is now 400,80 SEK after a 20% rebate. Still the buyer gets free shipping. To sum up, I don't want the rebate to affect other than the goods bought.
So it would seem either the shipping isn't recalculated after applying the coupon or the shipping plug isn't using the discounted total..
what shipping method and coupon ext. do u use?
Standard built in VM coupon plugin, I recon. Shipment methods are four different but they are kind of standard... One, the main is a "Unity" shipment for all orders up to an amount of, actually 498 SEK. One is Collect at warehouse. One is free delivery in our city and the last one is one for international shipping with an extra 90 SEK. (Up to 1 kg.)
All four are: "By weight, ZIP and countries. weight_countries
Is that information enough, or am I not getting it?
Cheers & Thanks for helping.
Btw, big misstake, I forgot to mention the website's address,,, https://livingstudio.se
OK .. so all standard...
if u switch on VM debug it will give a good amount of info on what the plugin is using for the free calc
its chk conditions uses the $cart_prices['salesPrice']...
If i get time tomorrow will check if this is with/without coupon
Thanks GJC.
Any ideas, yet?
Can be done only with an extra option, I think.
Hi betterlead
for VM2 you have a similar thread here, maybe it will help you...
http://forum.virtuemart.net/index.php?topic=108951.0 (http://forum.virtuemart.net/index.php?topic=108951.0)
and for me this worked (J2.5 / VM 2.6.18)
in /plugins/vmshipment/weight_countries/weight_countries.php
changed line
if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
with
//if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
if ($cart->couponCode) {
$amount = $cart_prices['salesPriceWithDiscount'];
} else {
$amount = $cart_prices['salesPrice'];
}
if ($method->free_shipment && $amount >= $method->free_shipment) {
Thanks, I'll see if that might work in ver 3.
Did you manager to get this working in VM3?
I have entered the above code but this does not solve the issue, I am using Awocoupon if that makes a difference.
Any help would be much appreciated.
Manrk
Hi mark R
Sorry, I think I gave this one up.
So, let's bump this thread! :)
Any ideas, anybody?
Not sure if this is right, as I am not a coder, but it appears to work.
Just needs some more testing, and a smarter eye then mine to have a quick look over it (as I may have missed something)
/plugins/vmshipment/weight_countries/weight_countries.php
/**
* @param VirtueMartCart $cart
* @param $method
* @param $cart_prices
* @return int
*/
function getCosts (VirtueMartCart $cart, $method, $cart_prices) {
//if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
if ($cart->couponCode) {
$amount = $cart_prices['salesPrice'] - $method->free_shipment;
} else {
$amount = $cart_prices['salesPrice'];
}
if ($method->free_shipment && $amount >= $method->free_shipment) {
return 0.0;
} else {
return $method->shipment_cost + $method->package_fee;
}
}
Any input / testing would be very appreciated.
Many thanks
Mark
Amended code appears to be working correctly, (shipping is calculated on total order and coupon value, if coupon is entered.)
/**
* @param VirtueMartCart $cart
* @param $method
* @param $cart_prices
* @return int
*/
function getCosts (VirtueMartCart $cart, $method, $cart_prices) {
//if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
if ($cart->couponCode) {
$amount = $cart_prices['salesPrice'] + $cart->pricesUnformatted['salesPriceCoupon'];
} else {
$amount = $cart_prices['salesPrice'];
}
if ($method->free_shipment && $amount >= $method->free_shipment) {
return 0.0;
} else {
return $method->shipment_cost + $method->package_fee;
}
}
I now have an issue that although the above works the ajax update when applying the coupon does not update the order details with the new shipping but it does update the shipping selection area? (I am using VP Onepage checkout).
If I click on the shipping method (not changing anything) it updates the order detail??
Any ideas?
Many thanks
Mark