Buy X get Y issue


  • Default avatar
    acuaweb    
     6 years ago
    0

    I probably did not understand how it works ...

    I create a coupon buy X get Y, where Y has 100% discount; when using the coupon code the product Y is automatically added to the cart but is still at full price, to get the discount you have to enter the same coupon code again and this time the discount is applied.

    I would like when the product Y is added already had the discount applied.


    I set the "process type" to "smaller value"


    Also I would like to know if I can also use this coupon for all "child" variant of single product or if I have to make a coupon for each variant. :-(

  • Your avatar
    seyi    
     6 years ago
    0

    Something is not working properly, when you enter the coupon code, it should automatically add it to cart and discount at the same time.  Is this virtuemart?  Are you using a checkout extension?  And what versions are you using?

    AwoCoupon codes will work for all variants of a product.  So I think you are fine.  You cannot create a coupon that would work for just one variant of a product.  The smallest AwoCoupon goes to is the product id.
  • Default avatar
    acuaweb    
     6 years ago
    0

    I use joomla! 3.8.0, VM 3.0.18 and no additional checkout extension ...

    This is my detail config: https://www.evernote.com/l/APpawW_7dIBFBqu6lWvYHHMaUmWLHapEUh8

  • Your avatar
    seyi    
     6 years ago
    0

    I have tested a virtuemart 3.0.18 test site and cannot produce the error.  Can you send temp admin access via private message so I can take a look directly?
  • Default avatar
    acuaweb    
     6 years ago
    0

    I apologize for the delay, I created a private access for you, I pass it in private
  • Your avatar
    seyi    
     6 years ago  last edited 6 years ago
    0

    Thanks for the access.  Found the fix.  In the file:

    www/admiinistrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php around line 1101 is this:
    <?php
            $this
    ->cart = new stdClass();
            $this->cart->items = array();
            $this->cart->items_def = array();
    ?>


    Right after that, I added
    <?php
            $this
    ->vmcart VirtueMartCart::getCart();
            $this->vmcartProducts $this->vmcart->products;
            if ( version_compare$this->vmversion'3.0.19''>=' ) ) {
                $this->vmcartProducts = array();
                foreach ( $this->vmcart->cartProductsData as $k => $item ) {
                    $this->vmcartProducts$k ] = (object) $item;
                }
            }
    ?>


    Works fine now.

  • Default avatar
    jordi_    
     6 years ago
    0

    Same problem in vm 3.2.12 and the latest version 2.5.9.3 pro of awoCoupon the source code in the file /estorecouponhandler.php not match with the solution exposed.
    I need to insert twice the coupon, the first one increment qty and the second one aply discount.

    kind regards
  • Your avatar
    seyi    
     6 years ago
    0

    The above solution will fix the issue.  Will get it added in the next version.
  • Default avatar
    jordi_    
     6 years ago
    0

    In the last release in line 1090 the code is not the same, and I can't find the place were add the solution code. Please can you detail the solution for release 2.5.9.3 pro of awoCoupon.
    Thanks,

  • Your avatar
    seyi    
     6 years ago
    0

    I entered the wrong file in the above post.  I have fixed it now, please try it again.
  • Default avatar
    jordi_    
     6 years ago
    0

    Perfect now is ok.
    Thanks
  • Default avatar
    acuaweb    
     6 years ago
    0

    Ok, now it works fine. Many thanks. But if I update the component to 2.5.9.3 will I encounter the problem again?
  • Your avatar
    seyi    
     6 years ago
    0

    2.5.9.3 does not have that fix, but the version after that will.