Multiple Coupons failure


  • Your avatar
    seyi    
     5 years ago
    0

    Hi there,

    We've just purchased the pro version for awocoupon for virtuemart because we want to create the following setup; all products 10% discount and one product 25% discount. So we have a 10% discount coupon for all products excluding the 25% discount product and a 25% coupon for that specific product. Then I've made a parent which applies both the discounts.

    Both the discounts work great. But when I use the parent I'm redirect to a page with only "Shopping cart" as a title (no webpage, no styling, nothing). The url is still domain.com/index.php. When I surf back to the homepage or the shopping cart, the discount isn't applied. Also when I apply both coupons it doesn't work and I get the same page. I've got multiple coupons enabled.

    Do you have any clue what might be the problem? I promised my client to finish the project quickly, so hopefully you are able to help me!

    Best regards,

    Johan
  • Your avatar
    seyi    
     5 years ago
    0

    i think the white screen you are seeing means there is a parsing error which stops the rest of the code from processing. And I assume you have errors displaying to the screen turned off, otherwise you would see the error.

    Is this only happening with parent coupons? Does it work fine with normal coupons? Out of curiosity, what version of php are you using? I know there is an error with parent coupons if using less than 5.2.0 because it uses the function array_fill_keys, which was introduced in 5.2.0. This is already set to be updated in the next version, but can give you the solution if that is it.
  • Default avatar
    chiel6    
     5 years ago
    0

    Normal (single) coupons are working fine, but trying to combine the two coupons (10percent;25percent) gives the same problem. I'm running PHP 5.1.6, so that might be the problem?
  • Your avatar
    seyi    
     5 years ago
    0

    pretty sure it is your problem

    in www/administrator/components/com_awocoupon/assets/virtuemart/ps_coupon_process.php, around line 282, change
    <?php
        $tmp 
    = !empty($row['usedproducts']) ? array_fill_keys(explode(',',$row['usedproducts']),1) : array();
    ?>


    to this
    <?php
        $tmp 
    = array();
        
    $tmpA = !empty($row['usedproducts']) ? explode(',',$row['usedproducts']) : array();
        foreach(
    $tmpA as $t$tmp[$t] = 1;
    ?>

  • Default avatar
    chiel6    
     5 years ago
    0

    It works! Thanks a lot for the great support!