Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Addon Discount Code & tax calculation


Reni2

Recommended Posts

Problem: The tax is computed before the deduction of the discount.

 

Installed:

osCommerce v2.2

Discount Code (updated to v2.9) - http://addons.oscommerce.com/info/7397/v,22

 

Order at Admin - Modules - Order Total:

1 - Sub Total

2 - Discount Code

3 - Tax

4 - Shipping

5 - Total

 

Prices for the products in my shop are shown including tax.

 

Example as it appears, with a discount of 10 euro:

Sub-total: 50 (shown inclusive 19% tax)

Discount: 10

VAT: 7.98

Shipping: 7.95

Total: 47.95

 

This should be:

Sub-total: 50 (shown inclusive 19% tax)

Discount: 10

VAT: 6.38

(Note: 50 minus 10 is 40. This, however, is including VAT, the net amount (excluding VAT) is (40 / 1.19 =) 33.61. The 19% tax on this amount is (33.61 * 0.19 =) 6.38)

Shipping: 7.95

Total: 47.95

 

Can someone please explain how to configure osCommerce (or the php files) to get the desired result?

Link to comment
Share on other sites

I have the exact same problem. It certainly does not make sense. Why give discount on exluding tax price? I never hear 10% discount advertised with a small print saying "oh, by the way, the discount is applied to excl. Tax price"

 

I am sure simple code change will make it work the correctly. If anybody knows how to fix this please share it with us.

Link to comment
Share on other sites

  • 2 weeks later...

No - successful - response on this forum, neither an answer from the originator of the distribution. Removed the module Discount code and add the module Discount coupon, which has almost the same functionality.

Link to comment
Share on other sites

Order at Admin - Modules - Order Total:

1 - Sub Total

2 - Discount Code

3 - Tax

4 - Shipping

5 - Total

 

Change it to:

 

Order at Admin - Modules - Order Total:

1 - Discount Code

2 - Sub Total

3 - Tax

4 - Shipping

5 - Total

 

And if there is NO tax in your store, remove it from the order total module.

 

 

 

Chris

Link to comment
Share on other sites

  • 2 years later...

To show the discount including VAT, you have to adjust catalog/includes/modules/order_total/ot_discount.php. I have also added a minus sign in fornt of the discount amount.

 

Look for function process() (around row 27) and add a row to declare a new variable (after $tax_discount = array());

$disocunt_incl_tax = 0;

 

Set the new variable (after $order->info['total'] -= $discount;)

 

$discount_incl_tax += array_sum($tax_discount);

$discount_incl_tax += $discount;

 

Look for: 'text' => '<span class="productSpecialPrice">' . $currencies->format($discount, true, $order->info['currency'], $order->info['currency_value']) . '</span>',

Replace by:

 

'text' => '<span class="productSpecialPrice">' . '-' . $currencies->format($discount_incl_tax, true, $order->info['currency'], $order->info['currency_value']) . '</span>',

 

If you don't like the minus sign in fornt of the discount amount:

Replace by:

 

'text' => '<span class="productSpecialPrice">' . $currencies->format($discount_incl_tax, true, $order->info['currency'], $order->info['currency_value']) . '</span>',

Edited by saskia_z
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...