Gift Certificate and tax shipping


  • Default avatar
    mario8    
     3 years ago
    0

    Hi,
    I use J 1.521 VM 1.1.8 and AWO 1.5.0.
    I select "Subtract payment discount before tax/shipping".

    I have a problem with Gift Certificate: it works well but in the summary order does not change the shipping tax.

    So let me start in on that problem with an example.

    Here is a scenario currently happening:

    Gift Certificate: 100

    Ceckout Step 1: it is ok
    Product: 79.00
    SubTotal : 79,00
    AWO calculates a - 79,00 coupon.
    ---
    Total (Tax Inc.) 0.00
    TAX 0.00

    Ceckout Step 2 (shipping): it is NOT ok
    Product: 79.00
    SubTotal : 79,00
    AWO calculates a -85,50 coupon
    Shipping 6,50 (5,37+1.13)
    ---
    Total (Tax Inc.) 0.00
    TAX 1.13

    Ceckout Step 3 (Payment method): it is ok (is skipped)

    Ceckout Step 4 (send order): it is NOT ok
    Total (Tax Inc.) 0.00
    TAX 1.13

    The problem is in display of the cart because in fact there is nothing extra to pay.
    The mail order in fact correctly return:
    Subtotal: € 79.00
    Discount Coupon: - € 85.50
    Shipping: € 6.50
    Tax Total: € 0.00
    Total: € 0,00

    Could I change that to see as in the mail order?
    Thank you for your response.
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    So the problem is it is still showing the shipping tax within the cart. This is a total hack, but should work. Looking at your cart I see that the tax rate is 21%, so using that, try this:
    in www/administrator/components/com_virtuemart/html/basket.php
    and
    www/administrator/components/com_virtuemart/html/ro_basket.php

    right before this line:
    <?php
        $tpl
    ->set_vars( Array(
    ?>


    add this:
    <?php
        
    if(!empty($_SESSION['coupon_awo_shipping_discount'])) {
            
    $tax_display $GLOBALS['CURRENCY_DISPLAY']->getFullValue($tax_total round($_SESSION['coupon_awo_shipping_discount']-($_SESSION['coupon_awo_shipping_discount']/1.21),2));
        }
    ?>
  • Default avatar
    mario8    
     3 years ago
    0

    Thanks for the quick reply!

    I did as suggested but now I have:

    Parse error: syntax error, unexpected '<' in /web/htdocs/www.homestylelab.it/home/administrator/components/com_virtuemart/html/basket.php on line 308

    sorry but I do not have a lot of practice ... I changed this:


    <?php
        
    if(!empty($_SESSION['coupon_awo_shipping_discount'])) {
            
    $tax_display $GLOBALS['CURRENCY_DISPLAY']->getFullValue($tax_total round($_SESSION['coupon_awo_shipping_discount']-($_SESSION['coupon_awo_shipping_discount']/1.21),2));
        }
    ?>



    <?php
        $tpl
    ->set_vars( Array(
    ?>


    Is it correct?
  • Your avatar
    seyi    
     3 years ago
    0

    Hi,

    What did you change, the code looks exactly the same, it should be:
        .....
        if(!empty($_SESSION['coupon_awo_shipping_discount'])) {
            $tax_display = $GLOBALS['CURRENCY_DISPLAY']->getFullValue($tax_total - round($_SESSION['coupon_awo_shipping_discount']-($_SESSION['coupon_awo_shipping_discount']/1.21),2));
        }
        
        
        $tpl->set_vars( Array(
        .....


    Without the <\?php or ?>. Those were just there to color code the code block.
  • Default avatar
    mario8    
     3 years ago
    0

    I have done as you say... Without the <\?php or ?>.
    but it remains as before:

    Total (including VAT): € 0.00
    Tax Total: € 1.13

    have you another suggestion?
    Thanks
  • Your avatar
    seyi    
     3 years ago
    0

    Hi,

    I see. Well that was really just a guess, and I cannot know what the problem is without looking directly on the site. For that I would need temporary admin and ftp access. If you can send it in a private message, I will have a look.
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    I took a look and the hack I gave you would not work because you are not using a shipping coupon but instead a gift certificate. So I added this and it works:
    ........
    $tax_display = $GLOBALS['CURRENCY_DISPLAY']->getFullValue($order_total - ($order_total/1.21)); # seyi_code
    $tpl = new $GLOBALS['VM_THEMECLASS']();
    .......


    Its a very simple hack, it just calculates what the tax should be using the current order total. The only problem with this is it is a hack. And it will not work if one of the following apply:
    - you charge multiple taxes
    - some products are charged tax and some are not
    - some shipping are charged and some are not

    Basically everything in your store products, shipping has to be charged at 21% for this hack to work. And in the future if the VAT rate changes, then it will need to be updated with the correct rate.
  • Default avatar
    mario8    
     3 years ago
    0

    Thank you for your help and support..
    I tried your changes and now it works as I wanted,
    Thanks again

    Yours,
    Mario