AWO and Rupostel OPC conflict


  • Default avatar
    george6    
     4 years ago  last edited 4 years ago
    0

    Hello, Ever since I updated Rupostel OPC and AWO, seems that there is a conflict with my shipping methods tables. We charge shipping by order $ range using auto 5% discount if order is over 500 and 10% discount if over 1,000. Seems that order shipping method is calculated and deducted from order, but then the discount throws it out of the shipping method range and cart throws warning that there are no shipping methods available for the order. How do I fix this? I need the order to calculate the discount and then match the shipping amount after discount is taken.


    Using joomla 3.9x

    VirtueMart 3.6.10

    com_onepage2.0.398

    Most recent version of AWO

    Please advise.

    George Guebelli

  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    Can't say I fully understand what is going on, but before going further, since you are updating, in awocoupon > installation check, do you have everything installed?
  • Default avatar
    george6    
     4 years ago
    0

    I sent you an email with explanation from Stan at OPC that may help you understand what is going on. And yes everything is installed.
  • Your avatar
    seyi    
     4 years ago
    0

    Yes, saw the email but still do not really understand it.  Guess I would need to test it directly to get a feel for the error.

    One question, if you disable onepage checkout extension, does the issue still occur?
  • Default avatar
    george6    
     4 years ago
    0

    Yes, it still occurs.
  • Default avatar
    george6    
     4 years ago  last edited 4 years ago
    0

    in the email I sent stan, I included a login to use to test, [removed], the pw is in the email.  Plus same login allows you super admin for back end /administrator. Please feel free to use it. If you login to the front end, go to Packages at the top and chose any of the first three packages and put 1700.00 in product amount in the cart. Then check out using Western Union payment method, which is like paying cash for the order. It will throw the warning and not let you check out.
  • Your avatar
    seyi    
     4 years ago
    0

    Ok, I have been playing with this.  First off, it is not a an AwoCoupon or Onepage issue, it is a Virtuemart issue.  Can produce the error with shipping without AwoCoupon or Onepage enabled and using Virtuemart coupons.

    In Virtuemart > configuration > checkout, setting 'Enable Automatic Selected Shipment' to 'None' triggers this strange behavior.  So in your configuration, I have changed it to 'No preference'.  At least now you can check out.

    Also in doing it this way, it does not really take the coupon discount into account when calculating the min_amount / max_amount  of shipping.   When virtuemart calculates the shipping to use, it does not seem to have the coupon data.

    I wrote some code that can do this specifically for AwoCoupon, but it does require adding code to the core of Virtuemart
    In the file www/administrator/components/com_virtuemart/plugins/vmpsplugin.php, around line 960 is this:
    <?php
                
    if(empty($method->min_amount)) $method->min_amount 0.0;
                if(empty($method->max_amount)) $method->max_amount 0.0;
                $amount $this->getCartAmount($cart_prices);
    ?>

    Right after that add this:
    <?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;
                        }
                    }
                }
    ?>
    The above code checks to see if there is a coupon processed within AwoCoupon, if so, subtract the product part of the discount from the total used to calculate min/max amount ranges.

  • Default avatar
    george6    
     4 years ago
    0

    Thanks so much for helping out. I appreciate you very much.