Awocoupon - Error 1064


  • Default avatar
    digitalconnect    
     7 years ago
    0

    Hello dear people.

    I have a small issue. When i add a product and couponcode in the shoppingcart, all works fine. But when i delete the product, i get a 1064 error.


    404 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3 SQL=SELECT virtuemart_category_id AS category_id,virtuemart_product_id AS product_id FROM #__virtuemart_product_categories WHERE virtuemart_product_id IN ()

    To see for yourself:

    1. Add a product from this category: https://goo.gl/1VwPZV
    2. use couponcode: thermrad
    3. Delete the product from the shoppingcart

    Have anyone a suggestion?

    Latest Joomla,
    Latest stable vm

    Thanks in advance,

    M
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Strange issue.

    I am not able to produce it locally but it somehow looks like the cart is trying to process a coupon code even though there are no items in the shopping cart. I cant produce the issue locally.

    I am not sure if this will work but try updating the file:
    www/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php, around line 819 is this:

    <?php
    protected function checkDiscount$coupon_row$track_product_price=false ) {
        
    $user JFactory::getUser();
        if(empty(
    $coupon_row)) return;
    ?>


    Right after that add this:
    <?php
        
    if(empty($this->cart->items)) return;
        if(empty(
    $this->cart->items_def)) return;
    ?>
  • Default avatar
    digitalconnect    
     7 years ago
    0

    Hi there Seyi and thanks for your reply!

    There might be an issue here because in the following direction:

    administrator/components/com_awocoupon/helpers

    I only got files, and for sure no map called estore and no file called estorecouponhandler.php

    (its a vm shop)

    Do i have an old version?

    Best regards, M
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    I think you are using the free version right?

    For that look at the file:
    www/administrator/components/com_awocoupon/helpers/vm_coupon.php, around line 245 is the same line:
    <?php
            
    if(empty($coupon_row)) return;
    ?>


    Right after that, add the same:
    <?php
            
    if(empty($this->cart->items)) return;
            if(empty(
    $this->cart->items_def)) return;
    ?>
  • Default avatar
    digitalconnect    
     7 years ago
    0

    Hi Seyi,

    Your absolute right. Iam using the free version and your provided solution fixed the issue ;) Many thanks. When a client needs more functionality i will certainly buy the pro version ;)

    Thanks again and best regards, M