VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: krobbers on February 16, 2016, 15:26:29 PM

Title: Always calculate fixed operation costs
Post by: krobbers on February 16, 2016, 15:26:29 PM
The desire is like the shipping lapsed spending x amount which is configured to always keep transaction costs.

I have this operation costs now entered as packaging costs but also lapse if the shipment is free.

Is there a possibility to still have the operation cost which is exactly the same at each order is to prop up, if needed in a different way.
Title: Re: Always calculate fixed operation costs
Post by: GJC Web Design on February 16, 2016, 20:30:05 PM
no versions or info on what your using for shipping but guess its the std weights and that the fixed fee isn't charged if free shipping is triggered?

Would need a small change in the code to still charge the fixed fee even though shipping is free

in  plugins\vmshipment\weight_countries\weight_countries.php ~ line 198

replace


function getCosts (VirtueMartCart $cart, $method, $cart_prices) {

if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
return 0.0;
} else {
return $method->shipment_cost + $method->package_fee;
}
}


with


function getCosts (VirtueMartCart $cart, $method, $cart_prices) {

if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
return $method->package_fee;
} else {
return $method->shipment_cost + $method->package_fee;
}
}

Title: Re: Always calculate fixed operation costs
Post by: krobbers on February 16, 2016, 20:51:04 PM
This is indeed what I mean.

I've used it and it just works fine!

Thanks for thinking