Gift certificate and shipping method when is order total zero


  • Default avatar
    lukas2    
     a year ago
    0

    Hello!
    I have issue with standard shippment (Vituemart 3.8.2) when the order total is 0 (if the customer used a gift certificate).
    If I set for standard payment maximum amount to 0.001, payment methotd is show, but if customer wants finish order, cart is only refresh without error and without creating order.
    If I remove maximum amount from payment methot, everything is OK, but I want to show this payment methot only when is total order 0.
    Do you have some solution for me? Thank you
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    Are you using the latest version of AwoCoupon?  And in admin awocoupon > installation check, is everything installed?
  • Default avatar
    lukas2    
     a year ago
    0

    Hello! I am using Awo version 3.6.0.9, and everything is green in installation check
  • Default avatar
    lukas2    
     a year ago
    0

    I try to install latest version to my test web test.topanocky.eu, but issue is the same. You can try it when, you add product which has price lower then  25€ for exampte this: https://test.topanocky.eu/detska-obuv/ortopedicko-rehabilitacne-sandale/detske-sandale-protetika-ors-t-97-maskac-sedy-vzor-52-detail
    and you can try use code: pousdak33vjXf
    and confrim your order. Issue is the same for classic cart and OPC cart too.
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    Here is a fix:

    It does require modifying a core virtuemart file
  • Default avatar
    lukas2    
     a year ago
    0

    Hello! Thank you, but this hack works only when the free shipping method is selected. If I select shipping method with some fee, it also doesn't work...
  • Default avatar
    lukas2    
     a year ago  last edited a year ago
    0

    I modified the code and it seems to work:
    <?php
                
    if ( empty( $cart_prices['salesPriceCoupon'] ) ) {
                    if ( 
    class_exists'awocoupon' ) ) {
                        
    $coupon_session AC()->storediscount->get_coupon_session();
                        if ( ! empty( 
    $coupon_session->product_discount ) ) {
                            
    $amount -= $coupon_session->product_discount $coupon_session->shipping_discount;
                        }
                    }
                }
    ?>
  • Your avatar
    seyi    
     a year ago
    0

    Ah yes, that would make sense, to take the full discount not just product.