prestashop awocoupon not working at all!


  • Default avatar
    serge0    
     4 years ago
    0

    installation went fine, however instead of adding your overrides to existing ones (like most prestashop modules do), you just create a backup and replace existing overrides. really? this renders our shop useless and is not following prestashop practice.


    but the real problem is that after creating a simple coupon with 10% overall discount and a code, I go to front end and enter the code only to get an error:

    There is 1 error

    This voucher does not exists.


    I can see the code in the admin and it's activated.


    This module seems untested and has major installation issues as described above.

  • Default avatar
    serge0    
     4 years ago
    0

    by the way: this is on fresh vanilla install of Prestahop 1.6.1.24
    I tested this with no other modules or overrides installed. definitely NOT working
  • Default avatar
    serge0    
     4 years ago
    0

    I also checked all overrides and they are 100%  there. I tried disabling cache, Force compilation, clear cache, clear browser cache... running out of options.

    you should be able to reproduce the issue by doing a fresh PS 1.6 install then install your module and set up a simple code.

  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    In a vanilla install of prestashop there are no overrides, so, this is not an issue:

    however instead of adding your overrides to existing ones (like most prestashop modules do), you just create a backup and replace existing overrides. really? this renders our shop useless and is not following prestashop practice.

    Also trying to merge override files in the code is unstable.  It is better to manually do it, which is why if it exist it is backed up.  Happy to help with that process.

    If you are seeing this error "This voucher does not exists." then I do not think it is using AwoCoupon.  As you are using prestashop 1.6, go to /cache/index_class.php and delete or rename that file so your class files are rebuilt. Then try again.

    I am happy to look directly at your issue if you can send a message with temp access.
  • Your avatar
    seyi    
     4 years ago
    0

    Also I have seen in some installations this being a problem.  Please make this change to the override file:

    in the file www/override/classes/CartRule.php, around line 29 is this:
    <?php
                    
    if (!Cache::isStored($cache_id))
                        Cache::store($cache_idDb::getInstance()->getRow('SELECT *, id*-1 as id_discount FROM `'._DB_PREFIX_.'awocoupon` a WHERE a.`id` = '.$id));

                    $result Cache::retrieve($cache_id);
                    if ($result) {
                        foreach ($result AS $key => $value$this->{$key} = $value;
                        $this->id 'awocoupon-'.$id;
                        $this->is_awocoupon 1;
                    }
    ?>

    Please change it to this:
    <?php
                    
    if (!Cache::isStored($cache_id))
                        Cache::store($cache_idDb::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'awocoupon` a WHERE a.`id` = '.$id));

                    $result Cache::retrieve($cache_id);
                    if ($result) {
                        foreach ($result AS $key => $value$this->{$key} = $value;
                        $this->id 'awocoupon-'.$id;
                        $this->is_awocoupon 1;
                        $this->id_discount $this->id * -1;
                    }
    ?>

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

    rounding issues now, see PM