AWocoupon discounts not causing shipment method changes when page reloads


  • Default avatar
    simon82    
     6 years ago
    0

    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?
  • Your avatar
    seyi    
     6 years ago
    0

    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:

  • Default avatar
    simon82    
     6 years ago  last edited 6 years ago
    0

    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?
  • Your avatar
    seyi    
     6 years ago
    0

    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.
  • Default avatar
    simon82    
     6 years ago  last edited 6 years ago
    0

    Okay, thanks. So what you described earlier is the way it'll have to be, altering the standard plugin?
  • Your avatar
    seyi    
     6 years ago  last edited 6 years ago
    0

    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 );
    ?>


  • Default avatar
    simon82    
     6 years ago  last edited 6 years ago
    0

    Now doing that is all we should have to do right? Like, nothing else not mentioned there?
  • Your avatar
    seyi    
     6 years ago
    0

    You would have to test for your specific cases as it is not tested extensively.
  • Default avatar
    simon82    
     6 years ago  last edited 6 years ago
    0

    Thanks, This really helps us out.

    By the way is doing this safe, Or does this get updated often?

  • Your avatar
    seyi    
     6 years ago
    0

    The file will be updated as often as you update Virtuemart extension aio.
  • Default avatar
    simon82    
     6 years ago
    0

    Thanks. We'll get something figured out.