Gift certificates

  • Default avatar
     8 years ago


    I've noticed 2 things (at this stage of my testings) for the gift certificates (GC)
    (first I want to specify wordings :
    - cart : where you add product, change quantities, where you can remove products. On this screen I have the coupon field. This screen is accessible even before beeing loged in
    - basket : screen used for check out, in 3 steps on my site : shipping method, payment method, validation / comments before payment)

    Here is the thing :

    Exemple : GC = 100€
    I choose a 60€ object that I put in my cart
    --> I go in the cart, enter my GC code : GC system says GC amount set to 60€

    Next page : shipping : 7€
    --> I go to the next page : GC system says GC set to 67€

    Next page : payment method. Credit card or paypal are free of charge, cheques are charged 2€, I choose cheques :
    --> I go to the last validation page : GC system says nothing : Basket total = 2€ ... GC don't take it into account.

    Then I decide to go back to the cart :
    Cart total = -7€
    Of course, at this stage I haven't choosen yet the shipping method ! GC hasen't been reseted.

    2 questions :
    1- Shouldn't the GC cover payment method fees too ?
    2- Shouldn't the GC be reseted each time you get back to the cart ?

    More after more testings :)

    Thanks again for your great work and component which is one of the best I've ever seen, that's why I take time to explain theses few things :)
  • Your avatar
     8 years ago

    Hi Ed,

    thanks for the feedback.

    Problem #1: I dont think i understand it very well. If the order total is 0, why would they need to select a payment method. There is nothing to pay. I tested this with my install of virtuemart and the payment method screen does not even come up if the order total is 0.

    Problem #2: This has to do with when the coupon processing is run. Currently it is run:
    - If a user enters a coupon
    - If a coupon is already accepted, then anytime a product is added, updated, or deleted
    - If a coupon is already accepted, then when the shipping method is chosen

    To fix this problem, the coupon processing would have to be run everytime the basket is refreshed. I was tryinig to avoid doing this, since it is extra processing that is not really needed. But as i see, you have found a case for it. Here is the fix:

    in www/administrator/components/com_virtuemart/html/basket.php, around line 176
    comment this line out
    if (!empty($_POST["do_coupon"]) || (in_arraystrtolower($func), array( 'cartadd''cartupdate''cartdelete' )) && !empty($_SESSION['coupon_redeemed'])) ) {

    and add this line in its place
    if (!empty($_SESSION['coupon_redeemed']))  {

    Now everytime the basket is called the coupon processing will run, as long as a coupon has already been accepted.