Post by tmcguire » Sat Nov 17, 2007 1:46 am

I am trying like mad to get a product added, configured, and purchased. But for some reason each product shows the price AFTER tax has been applied which makes no sense because how could the cart know where the buyer is located before they are even logged in?

There needs to be some serious work done on the tax usability. As far as I can tell I am not the only user which is completley baffled by the way the tax is managed from admin configuration to product creation to purchase.

Does anyone have any sort of document or how-to for proper configuring taxes for use in the USA which includes how to configure the admin panel, and products so that they show the proper price before and after purchased?

Thanks,
Tom

New member

Posts

Joined
Mon Nov 12, 2007 3:56 am
Location - Across from the Kitchen

Post by tchemis » Sat Nov 17, 2007 4:25 am

I don't believe that is the issue if you look in Admin >> Configuration >> Localization > Currency

You will notice the value of the US Dollar is set to 1.86041999, try changing it to 1.00 this will now show the price correctly.

Active Member

Posts

Joined
Tue Aug 21, 2007 9:23 am

Post by tmcguire » Sat Nov 17, 2007 4:43 am

I did that already. And yes it does show the proper cost of the product. But if I make the product taxable then the tax is added onto the price of the item in the store before it is even added to the cart.

For example. If I make an item $9.50 and set my tax to 1% tax then the price shown on the product is $9.60.

I don't think the product should reflect the tax until it is being purchased.

-Tom

New member

Posts

Joined
Mon Nov 12, 2007 3:56 am
Location - Across from the Kitchen

Post by Daniel » Thu Nov 29, 2007 1:34 am

tmcguire wrote: I did that already. And yes it does show the proper cost of the product. But if I make the product taxable then the tax is added onto the price of the item in the store before it is even added to the cart.

For example. If I make an item $9.50 and set my tax to 1% tax then the price shown on the product is $9.60.

I don't think the product should reflect the tax until it is being purchased.

-Tom
Differn't contires differn't rule, but most US and UK site have it this way.

You can alwasy change the settings to not display tax!

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tmcguire » Mon Jan 07, 2008 11:08 am

I'm back after an extended holiday and was

I seem to be hitting a wall with the way that tax is added toe the products price. Here is my problem.

When I create a product and give it a price and set the 'Tax Class' to 'Taxable Goods' the price of the product is shown as Price+Tax on the products page in the store.

Example:
http://knitport.visualmoxie.com/shop/in ... oduct_id=5

The product price is $95.00. Why is it showing the price with tax already added?

When I add an item to the cart and they checkout there is no evidence of tax being added to the total.

Can someone please shed some light on this for me?

-Tom

New member

Posts

Joined
Mon Nov 12, 2007 3:56 am
Location - Across from the Kitchen

Post by bruce » Sun Jan 13, 2008 11:03 pm

I have posted a howto document in the contributions area. It contains the magic you need :)
http://www.opencart.com/contribution/in ... tion_id/31
The download is a zip file containing an MS Word document which you just have to rename to have a .zip extension.

Daniel, is it possible to fix the download file name so that it downloads correctly as a .zip?

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by tmcguire » Mon Jan 14, 2008 12:27 pm

This is a very helpful doc.. I going through it right now. I do notice right away that the prices of the 'Latest Products' on the home page still show the price of the product + tax. But the individual product page seems fine.

-Tom

New member

Posts

Joined
Mon Nov 12, 2007 3:56 am
Location - Across from the Kitchen

Post by bruce » Mon Jan 14, 2008 3:40 pm

The following patch to catalog\controller\home.php seems to do the trick with that.

Code: Select all

//                'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id']))
                'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id'], false))

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by lucky_slevin » Tue Mar 18, 2008 3:07 am

bruce wrote:
The following patch to catalog\controller\home.php seems to do the trick with that.

Code: Select all

//                'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id']))
                'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id'], false))
I was sure this would be the FIX of the century.... but it didn't work for me, my items still show with tax included....

___________________________________________________________

http://www.monnaiesjdcoins.com (still in the works)


New member

Posts

Joined
Wed Mar 12, 2008 2:30 am

Post by bruce » Tue Mar 18, 2008 8:05 pm

If you have followed the instructions to the letter, this works.  :)  This last bit is a hack to clear inconsistent behaviour. There is a better way but I am intrigued as to why it has not worked for you?

Please give more details of your problem. What page are you viewing where the the prices still show with tax?

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by joenmass » Mon Jun 02, 2008 7:37 am

I have the same problem. Items show prices with the included taxes already calculated.
Anyone find a solution this yet. Seems like a pretty serious issue.

Newbie

Posts

Joined
Mon Jun 02, 2008 12:20 am

Post by bruce » Mon Jun 02, 2008 8:18 am

Did you read the document referenced earlier in this thread?

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by joenmass » Mon Jun 02, 2008 8:52 am

Yes I have. To the letter with no luck.
For some reason the tax is still automatically added to the displayed price.  :-\

Newbie

Posts

Joined
Mon Jun 02, 2008 12:20 am

Post by bruce » Mon Jun 02, 2008 2:07 pm

Even the bit where you must turn off tax in the store admin?

If yes, then you might like to PM me with admin login credentials and the url of your store admin so that I can try to help you better.

cheers

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by JNeuhoff » Wed Aug 27, 2008 5:59 am

Hello Bruce,

I am struggling with a similar problem. I have created a geo-zone called  'Australia Tax Zone' and added the appropriate zones. I also configured my test store to be located in Australia, and with the AUD as the default currency (value 1.00). And the only tax class 'Taxable Goods' uses the 'Australia Tax Zone'. Also, all products have the tax class 'Taxable Goods'.

Now, if I turn off the tax in

Admin > Configuration > Setting > Local > Tax:No

I would have expected the products to be shown without the GST on the home page. It is shown correctly without the GST on the product page. So, I think there is still a bug here, isn't there? I am using OpenCart 0.7.8

The funny thing is, if I log in as a customer whose shipping address is abroad, outside Australia, the products are shown correctly on the home page, without the GST, as expected.

That leads me to the conclusion that the code for generating the displayed product prices on the home page should be modified so as to do the exactly the same thing as it does for the category or product page.

I'll have to do some more testing to get a better understanding of what exactly is going on there, it looks like your suggested solution is probably the right one, will test it tomorrow.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by bruce » Wed Aug 27, 2008 10:00 am

Hi Juergen,

The default home page has a bug in that it does not take the admin setting into account.

ie:

Code: Select all

'price' => $currency->format($tax->calculate($result['price'], $result['tax_class_id']))
instead of

Code: Select all

'price'    => $currency->format($tax->calculate($result['price'], $result['tax_class_id'], $config->get('config_tax'))),
cheers

Bruce

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by JNeuhoff » Wed Aug 27, 2008 7:14 pm

Code: Select all

The default home page has a bug in that it does not take the admin setting into account.
Indeed.

I fixed it on my test server, and also added a bug report on this to

http://code.google.com/p/open-cart/issues/detail?id=42

to make sure the fix will be included in the next bugfix release of OpenCart.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by JNeuhoff » Thu Aug 28, 2008 10:56 pm

The default home page has a bug in that it does not take the admin setting into account.
I noticed a similar bug for the Order Invoice page:

  /index.php?controller=account_invoice&order_id=

The same is true for the Admin order page:

  /admin/index.php?controller=order&order_id=&action=update


On these pages, the product prices always include the GST, too, even though its turned off in the

  Admin > Configuration > Setting > Local > Tax:No

Can you confirm this on your test server please before I do a similar fix and before adding another official bug entry?

Thanks.


 

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by bruce » Fri Aug 29, 2008 11:13 am

Hi Juergen,

This bug is deep and ugly. The problem begins in checkout_confirm, with 'tax'

Code: Select all

      		$product_data[] = array(
				'product_id' => $product['product_id'],
        		'href'       => $url->href('product', FALSE, array('product_id' => $product['product_id'])),
        		'name'       => $product['name'],
        		'model'      => $product['model'],
        		'option'     => $option_data,
        		'quantity'   => $product['quantity'],
				'tax'        => $tax->getRate($product['tax_class_id']),
        		'price'      => $currency->format($tax->calculate($product['price'], $product['tax_class_id'], $config->get('config_tax'))),
				'discount'   => ($product['discount'] ? $currency->format($tax->calculate($product['price'] - $product['discount'], $product['tax_class_id'], $config->get('config_tax'))) : NULL),
        		'total'      => $currency->format($tax->calculate($product['total'], $product['tax_class_id'], $config->get('config_tax')))
carries into order->process and propogates through to the order_product table. On top of that, the tax handling concepts in cart.php are confused.

cheers

Bruce

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by JNeuhoff » Fri Aug 29, 2008 4:39 pm

This bug is deep and ugly. The problem begins in checkout_confirm, with 'tax'
How so? It just grabs the tax rate for a given tax_class_id via a call to $tax->getRate.

The only mysterious thing I noticed in the /library/cart/tax.php is the constructor. It stores the tax rates according to the country_id and zone_id (taken from the user's address) into the $taxes array with tax_class_id as its array key. So far so good. But take a look at the SQL query:

Code: Select all

$results = $this->database->getRows("select tr.tax_class_id, sum(tr.rate) as rate, tr.description from tax_rate tr 
left join zone_to_geo_zone z2gz on (tr.geo_zone_id = z2gz.geo_zone_id) 
left join geo_zone gz on (tr.geo_zone_id = gz.geo_zone_id) 
where (z2gz.country_id = '0' or z2gz.country_id = '" . (int)$country_id . "') 
and (z2gz.zone_id = '0' or z2gz.zone_id = '" . (int)$zone_id . "') 
group by tr.tax_class_id");
If I understand it correctly it allows for multiple tax rates summed up as long as they all belong to the same country and zone. Why would you want to define multiple, possibly different, tax rates for the same country and zone?
Last edited by JNeuhoff on Fri Aug 29, 2008 4:57 pm, edited 1 time in total.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 6 guests