Awocoupon pro Shipping Coupon Error


  • Your avatar
    seyi    
     6 years ago
    0

    Hi:

    I am trying to use AWOCoupon Pro to have free shipping coupons

    I installed the component and it claims that it installed correctly vm1.14 joomla 1.5.18

    Regular product coupons work. Shipping coupons return " coupon not found "

    You can test it yourself here

    http://www.freshairconcept.com

    Product coupon code: product
    Shipping coupon code: ship

    When you enter the shipping coupon it seems to conflict with the cart in the menu bar of the site.
  • Your avatar
    seyi    
     6 years ago
    0

    Hello,

    To test your shipping, I would have to create an account, which I dont want to do unless i have to. Here are 2 things to note:

    1) The shipping needs to be selected before the coupon can be processed, otherwise you would receive an error message.
    2) In the dashboard of AwoCoupon, select the configuration screen and change the error messages to see exactly what error you are receiving.

    If these do not help, please post more info.
  • Default avatar
    info@joerichproject.com    
     6 years ago
    0

    Hi:

    I have only 1 payment gateway paypal, so there is no select payment screen, therefore no way to actually have chosen a shipping method.

    You select your shipping method and hit next and the only option is confirm order, no enter coupon code coupon box. If I enter the coupon on the shipping page of the checkout I get the "No shipping selected" error
  • Your avatar
    seyi    
     6 years ago
    0

    Ok, now I understand.

    The only real option is to allow addition of the coupon code before shipping is selected. In a future release, I will add an option to allow input of shipping coupon code before shipping is selected. But for now, you will have to customize the code to get this to work.

    So, go to
    www/administrator/components/com_awocoupon/assets/virtuemart/ps_coupon_process.php
    comment out line 235
    <?php
    return ps_coupon_process::return_false('errShippingSelect');
    ?>


    and add this right under that line
    <?php
    $_SESSION
    ['coupon_redeemed'] = true;
    $_SESSION['coupon_id'] = $coupon_row->id;
    $_SESSION['coupon_code'] = $coupon_row->coupon_code;
    $_SESSION['coupon_discount'] = 0;
    $_SESSION['coupon_type'] = 'gift'// always call cleanup function
    $_SESSION['coupon_awo_enabled'] = 1;
    return;
    ?>


    All this does is input the code into the system when the error returned is 'No shipping selected'. Once a shipping is selected, then the discount is computed, as long as all the requirements for that coupon code are met.
  • Default avatar
    info@joerichproject.com    
     6 years ago
    0

    That did it, works as expected now!
  • Default avatar
    edouard    
     6 years ago
    0

    hello

    thanks for this great component I just bought and I studying right now its incredible capabilities !

    concerning this shipping issue, I applied your hack and now shipping coupon are taken into account.

    but there is still a point : once i've choosen the shipping method, lets say 11€ with a 6€ shipping coupon, on the last checkout screen (the screen after having choosen the shipping method), I have this for exemple :

    - total order = 50
    - shipping fee = 5€ (11-6)
    - special discount = -6
    - total to be paid = 55

    which is normal, but un-understandable for the client.

    it should be :


    - total order = 50
    - shipping fee = 11€
    - special discount = -6
    - total to be paid = 55


    I don't know if I'm beeing clear :)

    thanks for your help
    Ed
  • Your avatar
    seyi    
     6 years ago
    0

    HI Ed,

    I understand what you are saying and it makes sense. You will need to edit the code to achieve what you want.


    in www/administrator/components/com_virtuemart/html/basket.php
    AND
    www/administrator/components/com_virtuemart/html/ro_basket.php

    find
    <?php
    }
    # awocoupon_code END =================================================================
    ?>


    it should be somewhere towards the end of both files. And replace it with this:
    <?php
        
    if(!empty($shipping_total)) 
            
    $shipping_display $GLOBALS['CURRENCY_DISPLAY']->getFullValue($shipping_total
                                
    + @$_SESSION['coupon_awo_shipping_discount']);
    }
    # awocoupon_code END =================================================================
    ?>


    That should give you the display of shipping you want.

    You should note that within the order details and the email confirmation sent out to the customer, the shipping value will revert back to the discounted value. Unfortunately, because of the way Virtuemart is coded, it is not possible to put the shipping discount on the coupon discount field because it is so tied into products. So the only way to get the discount on shipping is to discount it directly.

    Hope it makes sense.
  • Default avatar
    edouard    
     6 years ago
    0

    Hy Seyi

    An other little testing and I see that this bug that you corrected on this post is not included on the 1.2.1 version.
    Is it done by purpose, for specific reasons ?

    Do you thing you can add in a future version

    and at last, is this little hack still compatible with actual version ?
    thanks
    Ed
  • Your avatar
    seyi    
     6 years ago
    0

    Oversite, will look at integrating it into the next release. And yes the hack is still compatible.
  • Default avatar
    edouard    
     6 years ago
    0

    moved to the bottom
  • Default avatar
    edouard    
     6 years ago
    0

    Hy Seyi

    2 things :

    1- After testing on 1.2.2, it appears there is a bug, a thing :
    after entering the coupon, and choosing the shipping costs, on the next screen, for me payment method choice, the shipping costs are doubled.

    instead of 6.9, there is 13.8€ ...

    And then on the next screen, for me order confirmation, shipping costs are back to normal ...

    Any idea about this ?


    2 And an other question about this : as it works now it is quite confusing for clients as the shipping discount only appear when shipping is choosen. Is it possible to make it appear like any other coupon when coupon code is entered ? ...


    Thanks in advance
    Ed
  • Your avatar
    seyi    
     6 years ago
    0

    Hi Ed

    1) I cannot reproduce this. If it is fine on the confirmation page and not the payment page maybe something is off on your payment page. take a look at these files
    www/administration/components/com_virtuemart/html/basket.php (payment page)
    www/administration/components/com_virtuemart/html/ro_basket.php (confirmation page)
    The injections for awocoupon should be about the same

    2) Cannot do this. Need to calculate the shipping cost from the shipping selected.
  • Default avatar
    edouard    
     6 years ago
    0

    Hello again Seyi !

    After testing again on the 1.2.1 with your hack applied manually I found the same problem, that I did not see first time !!??? :)


    Any way, when I test it like that :

    <?php
     
        
    if(!empty($shipping_total)) $shipping_display $GLOBALS['CURRENCY_DISPLAY']->getFullValue($shipping_total
                                
    //+ @$_SESSION['coupon_awo_shipping_discount']
                                
    );
    }
    ?>


    I then have the payment screen with shipping costs ok, but final checkout screen with shipping costs at zero ...

    Again, it's when using a shipping coupon with the enter coupon code before shipping is selected option at yes.

    Thanks for your help
    Ed
  • Default avatar
    jabberlope    
     4 years ago
    0

    Hi Seyi,

    I'm trying to apply your solution to use AWOCOUPON PRO for FREE Shipping and my ps_coupon_process.php has only 14 lines. Does this make sense to you? Am I using a different version? I am having the same "coupon does not exist error" the poster was having and this PHP seems like it might do the trick.

    Thanks for your help,
    Tyler

    Using Awocoupon 1.4.7
  • Your avatar
    seyi    
     4 years ago
    0

    Yes, in the newer versions the main code is moved. In any case, you should not need it, there is an option to do this within awocoupon->configuration. You can set 'enable shipping coupons before shipping is selected' to yes.
  • Default avatar
    jabberlope    
     4 years ago
    0

    Seyi, thanks for your help! That did the trick.

    Many thanks,
    Tyler