Speicals and Sales Tax Not Included
Hello
I have a little problem with taxes not being included in sales and specials tags. The price is calculated correctly -- it's just the visual that is showing as wrong.
Example:
Product price: Was $50 now $40
Save: $9.09 (this should read $10)
The problem is on all pages where a special or sale price is shown.
All prices are calculated properly, so there's no problem when going through checkout, etc. It's just very confusing when a client sees a figure that doesn't add up.
Any ideas on how I could correct this please?
Thanks.
Re: Speicals and Sales Tax Not Included
Quote:
Originally Posted by
MortalWombat
Hello
I have a little problem with taxes not being included in sales and specials tags. The price is calculated correctly -- it's just the visual that is showing as wrong.
Example:
Product price: Was $50 now $40
Save: $9.09 (this should read $10)
The problem is on all pages where a special or sale price is shown.
All prices are calculated properly, so there's no problem when going through checkout, etc. It's just very confusing when a client sees a figure that doesn't add up.
Any ideas on how I could correct this please?
Thanks.
How does 9.09 come into play? There seems to be a lot missing from the description of the setup including an example of this issue. What other plugin(s) are installed?
Does the same issue appear when temporarily switching to the default template?
1 Attachment(s)
Re: Speicals and Sales Tax Not Included
Quote:
Originally Posted by
mc12345678
How does 9.09 come into play? There seems to be a lot missing from the description of the setup including an example of this issue. What other plugin(s) are installed?
Does the same issue appear when temporarily switching to the default template?
Apologies for not being entirely clear.
$9.09 is $10 missing the 10% tax component (sorry, I forgot to mention the tax amount). So the product price is $50 with a $10 reduction, making it $40. The 'Save $x.xx' part should show 'Save $10', but it instead shows 'Save $9.09'. I've attached an image as an example. $11.82 should be $13 (11.82 + 10% = 13).
After looking into the problem more since posting this thread, I've discovered that the issue stems from the custom template I have installed, which has altered the framework of pricing functions. I can't remove the pricing alterations the template has made, as the template is based on the alterations. Following is the functions snippet:
PHP Code:
// Price Functions Improvement
function pt_get_discount_amount($products_id) {
global $db, $currencies;
$show_sale_discount = '';
$display_normal_price = zen_get_products_base_price($products_id);
$display_special_price = zen_get_products_special_price($products_id, true);
$display_sale_price = zen_get_products_special_price($products_id, false);
if (SHOW_SALE_DISCOUNT_STATUS == '1' and ($display_special_price != 0 or $display_sale_price != 0)) {
if ($display_sale_price) {
if (SHOW_SALE_DISCOUNT == 1) {
if ($display_normal_price != 0) {
$show_discount_amount = number_format(100 - (($display_sale_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS);
} else {
$show_discount_amount = '';
}
$show_sale_discount = $show_discount_amount . PRODUCT_PRICE_DISCOUNT_PERCENTAGE;
} else {
$show_sale_discount = $currencies->display_price(($display_normal_price - $display_sale_price), zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . PRODUCT_PRICE_DISCOUNT_AMOUNT;
}
} else {
if (SHOW_SALE_DISCOUNT == 1) {
$show_sale_discount = number_format(100 - (($display_special_price / $display_normal_price) * 100),SHOW_SALE_DISCOUNT_DECIMALS) . PRODUCT_PRICE_DISCOUNT_PERCENTAGE;
} else {
$show_sale_discount = $currencies->display_price(($display_normal_price - $display_special_price), zen_get_tax_rate($product_check->fields['products_tax_class_id'])) . PRODUCT_PRICE_DISCOUNT_AMOUNT;
}
}
}
return $show_sale_discount;
}
I've compared the above coding to what's in functions_prices.php, but I can't work out what needs to be altered/added/removed. Normally I would be bringing this up with the template author, and have sent an email for his help, but due to personal problems, he is unavailable for the time.
Re: Speicals and Sales Tax Not Included
Is this one marked as a sale or a special? There is actually ZC code that does all this, but if it is necessary to independently do these calculations, then let's see what is needed...
Re: Speicals and Sales Tax Not Included
Is there a reason that you have SHOW_SALE_DISCOUNT not set to 1?
That appears in the code to be the reason that tax is factored into the price.
If there is a reason, then yes would need to change the calculation(s).
Re: Speicals and Sales Tax Not Included
Quote:
Originally Posted by
mc12345678
Is this one marked as a sale or a special? There is actually ZC code that does all this, but if it is necessary to independently do these calculations, then let's see what is needed...
This is a sale item. However, the problem applies to both sales and specials.
I am aware that Zen Cart has its own code for pricing, but as I said, this piece of code is a part of the template I'm using, and it has been coded through the store.
Quote:
Originally Posted by
mc12345678
Is there a reason that you have SHOW_SALE_DISCOUNT not set to 1?
That appears in the code to be the reason that tax is factored into the price.
If there is a reason, then yes would need to change the calculation(s).
I actually don't know anything about the whys of the code, as I didn't personally write it. As there are a few instances of SHOW_SALE_DISCOUNT, I assume you're referring to the third line, since it's the only one without a value... Unfortunately, entering '1' there only adds a sale tag with 'Save 1' to items that are not on sale and makes no difference to the sale items.
Re: Speicals and Sales Tax Not Included
Quote:
Originally Posted by
MortalWombat
This is a sale item. However, the problem applies to both sales and specials.
I am aware that Zen Cart has its own code for pricing, but as I said, this piece of code is a part of the template I'm using, and it has been coded through the store.
what template are you using btw?
Quote:
I actually don't know anything about the whys of the code, as I didn't personally write it. As there are a few instances of SHOW_SALE_DISCOUNT, I assume you're referring to the third line, since it's the only one without a value... Unfortunately, entering '1' there only adds a sale tag with 'Save 1' to items that are not on sale and makes no difference to the sale items.
I'm not sure, but I don't think he was asking you to change the code there. I interpreted it to mean do you ever set SHOW_SALE_DISCOUNT to 2. You set this in the configuration under product information. If it is 1 then it means you want to show the sale as a %off. If it is 2, you want to show it as the amount off.
You also have two tax settings in the configuration. One asks if you want to display prices with tax, the other if you want to display prices in the admin with tax. What do you have these set to? Those two are under configuration, my store.
Linda
Re: Speicals and Sales Tax Not Included
Quote:
Originally Posted by
lruskauff
what template are you using btw?
The template is called Morphling. It's a premium theme available on ThemeForest (however, due to what I mentioned earlier, the item is temporarily unavailable).
Quote:
Originally Posted by
lruskauff
I'm not sure, but I don't think he was asking you to change the code there. I interpreted it to mean do you ever set SHOW_SALE_DISCOUNT to 2. You set this in the configuration under product information. If it is 1 then it means you want to show the sale as a %off. If it is 2, you want to show it as the amount off.
You also have two tax settings in the configuration. One asks if you want to display prices with tax, the other if you want to display prices in the admin with tax. What do you have these set to? Those two are under configuration, my store.
Linda
Ah, OK -- I hadn't read it like that, but that perhaps makes more sense...
The product info configuration option is always set to 2 (amount off) in this store, and the two tax options are both set to true (display prices with tax included).
Re: Speicals and Sales Tax Not Included
Quote:
Originally Posted by
MortalWombat
The template is called Morphling. It's a premium theme available on ThemeForest (however, due to what I mentioned earlier, the item is temporarily unavailable).
I just asked because usually a template will change the way an item displays but not a way an item is computed.
Quote:
Ah, OK -- I hadn't read it like that, but that perhaps makes more sense...
The product info configuration option is always set to 2 (amount off) in this store, and the two tax options are both set to true (display prices with tax included).
Ok. So on your picture below, it has a price of: 32.50. Is that the price WITH or WITHOUT tax included? It should be the price with tax, because of the option you set above.
Linda
Re: Speicals and Sales Tax Not Included
Quote:
Originally Posted by
lruskauff
I just asked because usually a template will change the way an item displays but not a way an item is computed.
Yes, I know... I have no idea why the author altered the way prices are computed, and of course was not aware of the change until I began the template installation.
Quote:
Originally Posted by
lruskauff
Ok. So on your picture below, it has a price of: 32.50. Is that the price WITH or WITHOUT tax included? It should be the price with tax, because of the option you set above.
Linda
All prices in the store, including the two lower ones shown in the attached screenshot ($32.50 and $19.50), are tax INclusive -- that is, EXCEPT for the price showing the amount saved ($11.82), which is EXclusive of tax.