Shipping amount after gift certificate is $0.00


  • Default avatar
    marshall    
     13 years ago
    0

    When an order is placed in my store using a gift certificate code, the certificate discount is applied to both cart total and shipping amount, which is perfectly fine. Problem is, on the final receipt that the customer sees, it shows shipping cost of $0.00. Nowhere on the receipt does it show that the gift certificate was applied to the shipping cost as well.

    Example:

    Customer buys a product for $8.00. On checkout, shipping costs come out to $7.00. But the customer only sees something like this:

    Product 1: $8.00
    Shipping: $0.00
    Discount: -$8.00

    When in fact $15.00 of the gift certificate has been used, the customer is not clearly notified of this. It looks like they scored free shipping and only had to use $8.00 of their certificate!

    How can I remedy this situation so it is clear to my customers that they paid for shipping using their gift certificate?
  • Your avatar
    seyi    
     13 years ago
    0

    I see what you mean. What receipt are you talking about? The email that is sent to the user on confirmation? The problem is the discount information is not stored in Virtuemart so some customization would need to be done in order to get this to work as you want.
  • Default avatar
    marshall    
     13 years ago
    0

    The data is displayed as I described on both the final "order confirmed" page as well as the email receipt that is sent to the customer.

    How would I go about customizing Virtuemart to reflect the real amount that was used from the gift certificate on each purchase? Or perhaps there is some work-around that could deal with this issue to help us avoid customer confusion? Or maybe it would be easiest to display a message on the final checkout page regarding this issue when the customer has entered a GC code?

    Any suggestions will be much appreciated.
  • Your avatar
    seyi    
     13 years ago
    0

    The best is to display the correct information to the customer. there are 2 places I can think of that will need fixing
    - the email confirmation
    - the account maintenance order detail

    In this post, I will cover the account maintenance order detail.

    In www/\components/com_virtuemart/themes/[default]/templates/pages/account.order_details.tpl.php, around line 404, find this code
    <?php
    /* COUPON DISCOUNT */
    $coupon_discount $db->f("coupon_discount");
    ?>


    and replace it with this
    <?php
    $dbawo 
    = new ps_DB;
    $q  'SELECT * FROM #__awocoupon_user_uses WHERE order_number="'.$db->f('order_number').'"';
    $dbawo->query($q);
    $dbawo->next_record();
        
    /* COUPON DISCOUNT */
    $coupon_discount $db->f("coupon_discount")+$dbawo->f('shipping_discount');
    ?>


    then further down around line 450, find this:
    <?php
    $shipping_total 
    += $db->f("order_shipping_tax");
    ?>


    and replace it with this
    <?php
    $shipping_total 
    += $db->f("order_shipping_tax")+$dbawo->f('shipping_discount'); # seyi_code
    ?>


    With those changes we have added the shipping cost back into the shipping field and the coupon
  • Your avatar
    seyi    
     13 years ago
    0

    for the second place, the email confirmation

    in www/administrator/components/com_virtuemart/classes/ps_checkout.php, function email_receipt, around line 1870, you should see this

    <?php
    $order_total 
    $db->f("order_total");
    $order_discount $db->f("order_discount");
    $coupon_discount $db->f("coupon_discount");
    ?>


    right after that, add this
    <?php
    // -- fix shipping start
    $dbawo = new ps_DB;
    $q  'SELECT * FROM #__awocoupon_user_uses WHERE order_number="'.$db->f('order_number').'"';
    $dbawo->query($q);
    $dbawo->next_record();
    $coupon_discount += $dbawo->f('shipping_discount');
    $order_shipping += $dbawo->f('shipping_discount');
    // -- fix shipping end
    ?>


    Caution: this code is untested but should work.
  • Default avatar
    marshall    
     13 years ago
    0

    seyi,

    Well, that's just fantastic! It works quite well, and I really appreciate the excellent support.

    Great product, great service, thank you again!

    marshall
  • Default avatar
    shirtdoctors    
     13 years ago
    0

    When customers go to their account management to view or pay for an order they receive this.


    Parse error: syntax error, unexpected '}' in D:\home\hnt17b097\components\com_virtuemart\themes\default\templates\pages\account.order_details.tpl.php on line 450
  • Your avatar
    seyi    
     13 years ago
    0

    there is an error in your account.order_details.tpl.php. You did not open a bracket somewhere after closing one. Need to look at what you have edited and make sure there is a corresponding open bracket for every close bracket.
  • Default avatar
    webdesco    
     13 years ago
    0

    I've implemented this hack and it's updating the summary at the bottom but the shipping information above the cost summary still shows the shipping as £0.00

    The info below is with the hack (I still need to hack the code so as the tax information shows correctly).
    Will these hacks be included in the next update of AwoCoupon?

    Shipping Information
    Carrier Shipping Mode Price (inc. VAT)
    Royal Mail Package £0.00

    Order Items
    Qty Name SKU Price (inc. VAT) Total (inc. VAT)
    1 The Car Shampoo
    K-CS500ml £11.98 £11.98

    SubTotal (inc. VAT) : £11.98
    Shipping and Handling Fee : £3.49
    Coupon Discount: - £15.47

    Total: £0.00

    VAT Included : £0.00

    The first occurance of the shipping cost that is not affected by your hack is on line 193
    echo $CURRENCY_DISPLAY->getFullValue($details[3], '', $db->f('order_currency'));

  • Your avatar
    seyi    
     13 years ago
    0

    Im sorry, i dont think i follow. What exactly is the problem? On the order detail's page in the user account the shipping before the basket detail is still showing as 0?

    And no, do not plan on implementing this within AwoCoupon. It is a hack and staying away from those, the solution is always here in the forums if you want it implemented.