Error: No record, unpublished or expired, on a Valid / published coupon


  • Default avatar
    rytech123    
     9 years ago
    0

    I am using the following:

    joomla: 2.5.27
    virtuemart: 2.6.10
    awo 2.3.4

    I have 2 automatic coupons which work fine:
    5% off min val $500
    10% off min val $1000

    I added a regular coupon with the code: holiday15
    this coupon will take 15% off, no matter what

    Overall only 1 of these coupons shoudl be used, if they put in holiday15, that shoudl be applied instead of the others.

    But, when I enter: holiday15, I get the error:
    holiday15 No record, unpublished or expired

    I changed your installation, and everythign is installed
    I enabled store coupons

    I set the Enable Multiple coupons = YES
    Max ALL --> 1

    The site is:
    http://www.allinonesuppliers.com

    Please help.

    thanks,
    Laura
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    AwoCoupon gives precedence to automatic discounts. So if that is entered and you set the maximum All to 1, then the automatic discount will always be processed instead of what is used by the customer. Here is what you can do to change that. This is based on the latest, 2.3.4

    in www/administrator/components/com_awocoupon/helpers/estore/estorehandler.php around line 464 is this:
    <?php
                
    if(!$is_found) {
                    
    $this->coupon_row = new stdclass;
                    
    $this->coupon_row->id = -1;
                    
    $this->coupon_row->coupon_code $submitted_coupon_code;
                    
    $this->coupon_row->function_type 'coupon';
                    
    $this->return_false('errNoRecord');
                }
    ?>


    Change it to this:
    <?php
                
    if(!$is_found) {
                    
    $this->coupon_row = new stdclass;
                    
    $this->coupon_row->id = -1;
                    
    $this->coupon_row->coupon_code $submitted_coupon_code;
                    
    $this->coupon_row->function_type 'coupon';
                    
    $this->coupon_row->isauto in_array($submitted_coupon_code$multiple_coupons['auto']) ? true false;
                    
    $this->return_false('errNoRecord');
                }
    ?>



    And around line 311 is this:
    <?php
                    $coupon_awo_entered_coupon_ids
    [] = awolibrary::dbEscape($auto_code->coupon_code);
    ?>


    Change it to this
    <?php
                    array_unshift
    ($coupon_awo_entered_coupon_ids,awolibrary::dbEscape($auto_code->coupon_code));
    ?>


    That should do it
  • Default avatar
    rytech123    
     9 years ago
    0

    It works, however the SUBTOTAl is not calculating correctly. the TOTAL is perfect...

    Name Style No Price: Quantity / Update Total

    Adjustable_Black_525438ffac48e.jpg Adjustable Black Easel 31/4" Wide x 3 3/8" High 1AB $13.50 $1,350.00

    DISCOUNT $-202.50
    Subtotal $945.00
    Tax $0.00
    Total: $1,147.50

    This is with using my couponcode: holiday15

    The TOTAL is correct, but the 'subtotal says $945, not sure why....

    -- Laura
  • Default avatar
    rytech123    
     9 years ago
    0

    Please note, that I still have a 10% auto discount setup, and the priority that you gave me, does fix that so it is not applying it if they enter holiday15, but maybe the 'subtotal' is still calcluating it somehow.
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    I looked at your site, you have 2 subtotal fields. In a default virtuemart installation, only the first subtotal field is available. Your second subtotal shows product subtotal-coupon discount. Without knowing how that is calculated exactly, cant really determine what the problem is.

    Looking at the subtotal it is discounting twice:
    1350-202.5-202.5 = 945.00