Buy X get Y - another issue


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

    Example:
    I created a 'buy X get Y coupon':
    Condition 1: a minimum sales amount of 20$
    Condition 2: defined X articles (category)
    Condition 3: a particluar Y article (100% discount of 10$)

    What happens:
    I put one X article in the cart, amount 10$, total 10$
    I put one more article of any other category in the card, amount 10$, total 20$

    Then I enter the coupon code, it's accepted (!), the Y article is added to the card, also the 100% discount of the Y article (10$) is shown.

    Ok, I'm checking out, Paypal payment...
    I expect: 20$!
    BUT Paypal shows me 30$. No discount.

    I try the same with two X articles, amount 20$.
    It works fine!

    So it seems: the condition 'minimum amount' is related to the definded products / category!?
    If yes, why is the coupon code accepted anyway? Because I reach the minimal amount at all?
    In general I expect the same amount in the payment process that I see in the shopping card.



  • Your avatar
    seyi    
     6 years ago
    0

    Did you set minimum value to overall or specific?
  • Default avatar
    matthias    
     6 years ago
    0

    I set it to overall.
  • Your avatar
    seyi    
     6 years ago
    0

    If set to overall, then it checks the total value of the cart.  If set to 'specific' then it would check the total value of the buy x products.

    I tested the scenario you mentioned, and I did not get the same issue with paypal.
  • Default avatar
    matthias    
     6 years ago  last edited 6 years ago
    0

    Hi seyi,

    I tested again: it's a general issue. No discount works.
    And it's related to the plugin VP OnePage Checkout!

    Here is what the VP developer says (and it works!):

    It is a AWOCoupon bug. It is using some specific codes for our plugin which are not written correctly.

    To fix this, open - administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php
    Line 60 to 68

    if(version_compare($this->vmversion, '3.0.9', '>=')) { $is_rupostel_opc = JFactory::getApplication()->get('is_rupostel_opc', false); $is_vmonepagecheckout = class_exists('plgSystemVPOnePageCheckout') ? true : false; if($is_rupostel_opc || $is_vmonepagecheckout); else { $this->is_validateprocess = true; $this->enqueue_error_msgs = false; } }


    Replace above by

    if(version_compare($this->vmversion, '3.0.9', '>=')) { $is_rupostel_opc = JFactory::getApplication()->get('is_rupostel_opc', false); $is_vmonepagecheckout = class_exists('plgSystemVPOnePageCheckout') ? true : false; if($is_rupostel_opc || $is_vmonepagecheckout); else { $this->is_validateprocess = true; $this->enqueue_error_msgs = false; } }

    // Fix for VP One Page Checkout. if($is_vmonepagecheckout && JRequest::getCmd('ctask') != 'setcoupon') { $this->is_validateprocess = true; }
  • Your avatar
    seyi    
     6 years ago  last edited 6 years ago
    0

    A little confused, both sets of codes are the same.

    Was the fix to add
    <?php
            
    if ( $is_vmonepagecheckout && JRequest::getCmd'ctask' ) != 'setcoupon' ) {
                $this->is_validateprocess true;
            }
    ?>


    After
    <?php
            
    if(version_compare($this->vmversion'3.0.9''>=')) {
                $is_rupostel_opc JFactory::getApplication()->get('is_rupostel_opc'false);
                $is_vmonepagecheckout class_exists('plgSystemVPOnePageCheckout') ? true false;
                if($is_rupostel_opc || $is_vmonepagecheckout);
                else {
                    $this->is_validateprocess true;
                    $this->enqueue_error_msgs false;
                }
            }
    ?>

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

    yes! Just this at the end of your code


    // Fix for VP One Page Checkout.
    if($is_vmonepagecheckout && JRequest::getCmd('ctask') != 'setcoupon'){$this->is_validateprocess = true;}

  • Your avatar
    seyi    
     6 years ago
    0

    Ok, thanks