Coupon code is discounting shipping...don't want this


  • Default avatar
    tim344    
     9 years ago
    0

    Hi -
    I need to create coupon codes that offer a discount on the products only, and not discount shipping fees. Discounts need to be percentage discounts...say 75% off products. However, NOT 75% off products AND SHIPPING. By default it seems shipping is being discounted as well. What setting do I need to be looking for to change this? Please help as soon as you can...I will greatly appreciate it!
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    By default, shipping is NOT calculated when you create a "coupon". If you create a "gift certificate" then yes, shipping is calculated in discounts by default, but with gift certificates you cannot do percentage discounts only amount.
  • Default avatar
    tim344    
     9 years ago
    0

    Then I really don't understand what's going on. I have an order with 2 products..priced at 34.95 and 29.95 respectively which creates an accurate product total of 64.90. This is an order that is taxable at 9.25%. So, the 75% off coupon is applied and creates a discount of 53.18...which is 75% of 70.91....where did that number come from? If the discount only applies to the product total, the discount should be 48.675. Now, shipping is $5.99, but according to this post the shipping should not be factored in to the discount. Further adding to the confusion, the tax is charged at $1.50 which is 9.25% of the product total after discount (16.225). The math doesn't make any sense to me. Can you please help me to fix this, so I can offer percentage discount codes on my site? Thank you!
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    The discount you are seeing is the full discount, including tax savings:

    Product total no tax: 64.90
    Product total with tax 64.90*1.0925 = 70.90
    Discount: 70.90 * 0.75 = 53.18


    I dont really understand what you mean by this:
    " Further adding to the confusion, the tax is charged at $1.50 which is 9.25% of the product total after discount (16.225). The math doesn't make any sense to me."

    Are you saying the tax should not be 1.5?


  • Default avatar
    tim344    
     9 years ago
    0

    I posted a reply earlier, but I'm not seeing it here. This is a test post.
  • Default avatar
    tim344    
     9 years ago
    0

    [please note: i posted this earlier, but it disappeared from the forum...not sure what happened to the post]

    I have created a coupon code for 50% off products in my shop. We had over 250 orders just this weekend that used this code. Here is a sample of the data for one of these orders in the VM backend (orders view). Something is very wrong, as the coupon code discounted sales tax at 100%. The blanket was 39.95...discount it by 50% using code...should get 19.98...add tax to 19.98 (at 9.25%) and should get 21.82 for the total price. Instead customer is charged 19.98.

    What needs to be fixed here? It seems we lost an additional 9.25% on every single order that used this code this weekend (over 250 orders).

    Please help me sort this out asap. very urgent.


    Product Price (cost) Base price with tax Product Price (Gross) Tax Discount Total
    Blanket $39.95 $39.95 $39.95 $0.00 $0.00 $39.95
    SubTotal $39.95 $0.00 $0.00 $39.95
    Coupon Discount -$21.82
    Tax @ 9.25% $1.85 $1.85
    Shipment Fee $0.00 $0.00 $0.00
    Payment Fee $0.00 $0.00 $0.00
    Total $1.85 $19.98
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    What version of AwoCoupon/Virtuemart is this?

    In awocoupon->configuration, what do you have 'calculate discount before tax' set to?

    In virtuemart how did you set up your calculation rules? Is there any plugins to the rules?

    Are you using a checkout extension or default virtuemart checkout?
  • Your avatar
    seyi    
     9 years ago
    0

    It showed under your original post at the top. I have deleted it now though since it is just duplicate content.
  • Default avatar
    tim344    
     9 years ago
    0

    Virtuemart: Version: 2.6.10
    AWO Coupon: Version: 2.3.2 pro
    Joomla: 2.5.27

    awocoupon->configuration > 'calculate discount before tax' is set to "Yes"

    In virtuemart how did you set up your calculation rules?
    Math operation: +%
    Tax Value: 9.25
    Currency: USD
    Shopper groups: -anonymous- and -default-
    Country : US
    States: TN
    End date: -Never-


    Is there any plugins to the rules?
    I don't know what you mean here. I do not have plugins specifically for tax. I have a shipping rules plugin though.

    Are you using a checkout extension or default virtuemart checkout?
    My template uses a "one page checkout" plugin made by VirtuePlanet. Here is the link: http://www.virtueplanet.com/blog/vp-one-page-checkout/index.php


    Please advise next step for troubleshooting.

    Thanks!


    edit -
    here is what happens on the checkout page...when shipping option is free.

    Prior to selecting shipping method, but 50% off discount code already applied:
    Product prices result: $39.95
    Coupon discount: 19.98
    Tax @ 9.25%: 1.85
    Total: 21.82

    all of that appears correct...until user selects shipping method...and then this:
    Product prices result: $39.95
    Coupon discount: 21.82
    Shipping: 0.00
    Tax @ 9.25%: 1.85
    Total: 19.98

    Selecting free shipping inverts the numbers and causes tax to not be collected.
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    I think in your case, you will have to use injection mode. Please try this, post number 9:
    https://awodev.com/forum/awocoupon/help-section/coupon-discount-amount-incorrect#comment-6926

    The line number has changed. I think it is round line 108 now.
  • Default avatar
    tim344    
     9 years ago
    0

    Ok I will look at this shortly. What is unique about "my case" that I would have to customize this?
  • Default avatar
    tim344    
     9 years ago
    0

    When I uncomment the code mentioned and set config to injection mode, the discount doesn't work at all. The code is accepted, but no discount is applied. Please advise.
  • Default avatar
    tim344    
     9 years ago
    0

    Also, for testing purposes, I turned off my one page checkout plugin and I am still experiencing the problem. Tax is being discounted at 100% still with 50% off codes. Please advise.
  • Default avatar
    tim344    
     9 years ago
    0

    Man...I really think there is a nasty bug in this plugin. Here are a couple of scenarios...and what appears to be happening

    When the discount is a 10% off code
    1. Gets the amount of tax, based on full price of item…this is .0925 * price of the item. The number is 9.25% of the full price item total.
    2. Retrieves a discount amount that is the coupon code percentage from the tax amount in step 1. The result is x percent of the tax number only (no product amount involved here). Puts the discount amount in the “TAX” column for discount code.
    3. In the “Total” column for the discount here is how the number appears to be determined currently:
    a. Retrieves a discount amount that is the coupon code percentage from the full price PRODUCT TOTAL PLUS TAX amount…
    b. and then ADDS the amount from step 2 to that number creating an even larger discount.
    c. Leaves the Discount row amount in the TOTAL column as (create a discount of x coupon code percentage of product total PLUS tax) + (the TAX only discount created in step 2).
    4. TAX row is determined as x tax percentage of product total (after x discount code was applied)…not the modified number from “3C” above.
    5. Shipping row reflects correct shipping amount.
    6. Grand Total amount is adding up all numbers in the TOTAL column as shown on screen correctly…then again, the numbers making up that column in the coupon row are wrong.


    It behaves differently still, when the coupon code is 50% off. In all cases the amount collected is too small. Obviously the discrepancy is less when the discount is less, but it's an even bigger problem when the discount amount is higher. My problems persist regardless of "one page checkout" plugin or not.

    I need your help please. Please let me know what I can do to get this fixed ASAP.

    Thanks!
  • Your avatar
    seyi    
     9 years ago
    0

    Are you using Virtuemart 2.6.10 or above? If so, please try this:
    https://awodev.com/forum/awocoupon/help-section/vm-not-calcing-taz-correct-coupon#comment-7717

    Make sure you still have injection mode checked.
  • Your avatar
    seyi    
     9 years ago
    0

    Yes, dont think it has anything to do with one page.
  • Default avatar
    tim344    
     9 years ago
    0

    Ok to document what I did here.

    1. Edited document www/administrator/components/com_awocoupon/views/config/tmpl/default.php, and uncommented this to allow the setting to show up on the config page for injection mode:
    <!--<tr><td class="key"><label><?php echo JText::_'Use Injection Mode' ); ?></label></td>
    <td><?php echo $this->lists['virtuemart_inject_totals']; ?></td>
    </tr>-->


    2. On awocoupon config page set "use injection mode" to "yes".

    3. Edited document www/administrator/components/com_virtuemart/helpers/calculationh.php, after this code:
    if($this->_cartPrices['billTaxAmount'] < 0){
                    $this->_cartPrices['billTaxAmount'] = 0.0;
                }

    I inserted the following code directly after it:
    { # awocoupon_code ===============================================================
                    JPluginHelper::importPlugin('vmcoupon');
                    $dispatcher = JDispatcher::getInstance();
                    $dispatcher->trigger('plgVmUpdateTotals', array(&$this->_cartData, &$this->_cartPrices));
                }

    4. Tested a coupon code for 75% off. Results were finally normal (as I would expect the numbers to be).


    So this is working right now. My current setup is actually already outdated though. Here is my setup:
    Joomla 2.5.27 and VM 2.6.10 (at least that's what shows up as the current version in the VM admin area)

    When I update, are you expecting I will have the same problems all over again and will need to re-do the steps outlined here? Please advise so I can make informed decisions about updating.

    Thanks!
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    I gather you are using an older version of AwoCoupon also? In the latest you can do the steps above from the AwoCoupon admin interface.

    In awocoupon->configuration, you should automatically see the injection mode option if you are using Virtuemart taxbill. YOu can select yes there, and once that is done, you will have a new option on the dashboard called 'installation check' where you can check to see if the above injection you mentioned is installed. If not click the install button and that should be it.
  • Default avatar
    tim344    
     9 years ago
    0

    So you would advise me to upgrade joomla/VM/awocoupon at this point, then, right? And you would expect no issues to be re-introduced?
  • Your avatar
    seyi    
     9 years ago
    0

    Yes, that is correct, you should also make sure AwoCoupon is updated.