Okay, So we are currently trying to use AWOcoupons in conjunction with virtuemart's mininum and maximum order amount ranges in the shipment methods. We have a situation where once a coupon is used and takes it below the required minimum of 50 for the one shipment method once the page is reloaded the shipment method still the one it shouldn't be. Why would that be?
AWocoupon discounts not causing shipment method changes when page reloads
- If I understand correctly this really depends on the shipping method taking into account the coupon. For example, if using standard shipping, you would have to make an adjustment to get it to work:
- So, from what I'm getting, using the zip and weights method in virtuemart I need to do a code override so that it takes the coupon discount into account? Is there anyway I could do this using the AWO shipment method without coding or does that not do shipping fees?
- The AwoCoupon shipping method is a free shipping method that only works if you add just purchasable gift certificates into the shopping cart. It will not work for this.
- Okay, thanks. So what you described earlier is the way it'll have to be, altering the standard plugin?
- Yes, the shipping coupon uses "salesPrice". Sales price is the price of the products without shipping, coupon, payment fees/discounts. If you want to take coupons into account when checking the conditions, you could alter the file:www/plugins/vmshipment/weight_countries/weight_countries.php, find the line:
<?php
protected function checkConditions ($cart, $method, $cart_prices) {
?>And right after that add this:<?php
$cart_prices['salesPrice'] = $this->getCartAmount( $cart_prices );
?> - Now doing that is all we should have to do right? Like, nothing else not mentioned there?
- You would have to test for your specific cases as it is not tested extensively.
- Thanks, This really helps us out.
By the way is doing this safe, Or does this get updated often?
- The file will be updated as often as you update Virtuemart extension aio.
- Thanks. We'll get something figured out.