AwoCoupon Pro bug prestashop


  • Default avatar
    harry    
     10 years ago
    0

    Hi I'm using AwoCoupon Pro in a prestashop 1.4.9 environment. I have made a Buy X Get Y coupon but this is not working correctly.
    There are several problems:
    - even though I have checked 'Add to cart' the Y product is not automatically added to the cart when the coupon code is inserted (NOK)
    - when I add the X product to the cart, then the Y product and then enter the coupon code the price of product Y is deducted (OK) but the number of products X is suddenly doubled to 2 (NOK)
    - when I then click on the 'plus' sign next to the number box of product X the number becomes 6 (NOK)
    - when I then click again on the 'plus' sign next to the number box of product X the number becomes 14 (NOK)
    - when I then click again on the 'plus' sign next to the number box of product X the number becomes 30 (NOK)
    - when I then click again on the 'plus' sign next to the number box of product X the number becomes 62 (NOK)
    - also when manually changing the 'number' textfield the cart is not updated (NOK, this used to be possible before installing AwoCoupon Pro) so changing the number of a certain product can only be done using the 'plus' and 'minus' signs and they are not working correctly (when clicking the minus sign now the number goes up to 122)

    Can you please look into these issues and let me know if it can be fixed?

    Regards,
    Harry

  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    What are the details of how you set up the coupon code?

    Also are you using the default shopping cart, or some type of one page extension?
  • Default avatar
    harry    
     10 years ago
    0

    Hi Seyi,

    I just sent you a PM.

    regards,
    harry
  • Your avatar
    seyi    
     10 years ago
    0

    Hi Harry,

    Took a look and can reproduce it. The problem goes away when you uncheck "Do not mix products". You have a different product in buyx and gety so this would have unexpected behavior. Here is what dont mix does:
    https://awodev.com/documentation/awocoupon-pro/coupons#dont-mix
  • Default avatar
    harry    
     10 years ago
    0

    Hi Seyi,

    Thank you for looking into this. I have unchecked the "Do not mix products" checkbox and now the numbers do not multiply anymore when clicking the 'plus' or 'minus' signs.

    However two issues remain:

    1 - the product Y is not automatically added to the cart when the voucher code is entered, even though "Automatically add to cart 'Get Y' product" is checked
    2 - the textbox containing the number of products cannot be changed manually anymore, this used to be possible before installing the AwoCoupon Pro module

    Could you please look into this and let me know whether or not this is a configuration matter?

    Another thing that I noticed is that when I have product X and product Y in my cart and I enter the voucher code the discount is applied (OK). But when I then increase the number of product X the number of product Y is also increased automatically. This is not a big problem and may even come in handy but I have limited the "Number of Uses (Per Customer)" to 1 so I would expect that this wouldn't happen.

    Regards,
    Harry

  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    I do not believe number 2 is a problem with AwoCoupon. AwoCoupon has no effect on the rendering of your page to affect the textbox not being manually changed. The only thing I could not see working is the get y product. If for example you added 7 buy x products and you have 'automatically add to cart' checked and then you try to update the get y product to 3, it would automatically update back to 7 on a buy 1 get 1 coupon. For your buy x product, you should still have full functionality.

    For number 1, it is not adding for one of these reasons:
    - product is not active
    - the product has attributes
    - the product has customized fields
    - the product is out of stock

    More than likely the product has attributes. If this is your case, then you can force at least the default attributes. Here is what you would need to change:
    in www/modules/awocoupon/lib/couponhandler.php, around line 1899 is this:
    <?php
            
    foreach($this->cart->items as $k=>$r) {            
                if(
    $r['product_id']==$product_id) {
                    
    $idProductAttribute = (int)$r['attribute_id'];
                    
    $customizationId = (int)$r['customization_id'];
                    break;
                }
            }
                
    ?>


    right after that, add this:
    <?php
     
            
    if(empty($idProductAttribute)) {
                
    $idProductAttribute Product::getDefaultAttribute((int)$idProduct, (int)$qty);
            }
    ?>


    That will automatically select the default attributes.

    Lastly, the number of uses is for the number of times the coupon can be used. If you want to limit the discount within the coupon, then use "Maximum Discount Qty":
    https://awodev.com/documentation/awocoupon-pro/coupons#max-discount-qty
  • Default avatar
    harry    
     10 years ago
    0

    Hi Seyi,

    Thank you very much for looking into this on such a short notice. I really appreciate it.

    I have implemented your suggested code change and it seems to be working fine now!

    Thanks for pointing me to the "Maximum Discount Qty" property. That is indeed what I was looking for.

    I'm very impressed by your module. And even more by your support.

    Regards,
    Harry
  • Your avatar
    seyi    
     10 years ago
    0

    Hi Harry,

    You are most welcome. Glad to see another happy customer.