Post by ThePath » Sat Feb 19, 2011 11:59 pm

Hi all,

does anyone know how to display the VAT on the cart page all the time (whether logeed in or not)?

Any help much appreciated.

Cheers

Neil O0

Image

OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods


User avatar
Active Member

Posts

Joined
Fri Jun 26, 2009 11:53 pm
Location - Scotland

Post by SXGuy » Sun Feb 20, 2011 3:07 am

im not sure that opencart can do this without a big mod or rewrite, reason being that i think (and someone can correct me), opencart works out the VAT during the checkout process, not before hand.

So i think that a mod would be needed to work out the vat based on the current sub total and the default vat amount selected.

It shouldnt be hard at all, just needs the data to be pulled properly, infact i may give this a go and update my post with instructions.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by philbydevil » Sun Feb 20, 2011 3:26 am


I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Qphoria » Sun Feb 20, 2011 4:15 am

If you set Display prices with tax to yes in the settings area they will always show tax

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ThePath » Mon Feb 21, 2011 3:44 pm

Hi Guys,

I dont want the prices to display the tax only in the basket/cart. It cant be that difficult to achieve as the VAT displays when your logged in, I just want it to display like that all the time....logged in or not.

Cheers

Neil

Image

OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods


User avatar
Active Member

Posts

Joined
Fri Jun 26, 2009 11:53 pm
Location - Scotland

Post by philbydevil » Mon Feb 21, 2011 6:38 pm

Ok, I'm confused ???

As Q mentioned, "Display Prices With Tax" (admin->system->settings->option) should make all prices display with tax when the customer isn't logged in.

This is how my store is set up:

Taxes (10%) are displayed if you're not logged in. If you log in, and your default address is in Australia, then the prices still show with tax. If you're logged in and your address is outside of Australia, then it shows the prices without tax (as I don't need to charge tax on international orders).

The "problem" that I was having was in relation to the cart, and subsequent checkout pages. It didn't matter if you were logged in or not, had your default address in Australia or outside, the prices of products were shown excluding tax, and then a tax amount was shown down near the sub-total/total (because these were enabled in admin).

This is the normal functioning of OC, but I thought people might find it a bit confusing. So, with the vQmod that is mentioned above, the prices in my cart (and other checkout pages) now all show "with tax". I say "with tax" because really, if you're logged in and your default address is outside of Australia, then there isn't any tax, but OC is smart and knows not to add tax to these customers. It just makes the prices consistent throughout.

So, if you do have "Display Prices With Tax" selected, then maybe you need to check admin->system->localisation->tax classes and make sure that everything is correct there (but I don't think that this would be causing your problem)...

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by ThePath » Mon Feb 21, 2011 8:56 pm

Hi, not sure how I can make it clearer but here goes:

I DONT want to show prices with tax (so I dont want to show a products value + tax) I just want to show the value. When the customer visits the cart/basket I then want the tax to be shown! Whether they are logged in or not.

All customers will be from UK so I dont care about geo zones and tax zones.

Currently if I do as Q suggests and set "Display Prices with Tax" to yes then it does exactly that. I dont want that! I want to show prices without tax. I just want the tax shown in the cart whether people are logged in or not?

I thought this would be easy....thought it would be a case of removing an "isLogged()" from somewhere, but obviously not.

Really appreciate some help on this

Image

OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods


User avatar
Active Member

Posts

Joined
Fri Jun 26, 2009 11:53 pm
Location - Scotland

Post by SXGuy » Mon Feb 21, 2011 10:24 pm

im sure there is a way to display vat in the cart regardless of being logged in or not, just must be a case of removing the check for islogged.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by ThePath » Mon Feb 21, 2011 10:35 pm

Thanks for help but a big thanks to Jay Gilford who has found a decent solution for me.

in system->library->tax.php

Find:

Code: Select all

if (isset($this->session->data['country_id']) && isset($this->session->data['zone_id'])) {
			$country_id = $this->session->data['country_id'];
			$zone_id = $this->session->data['zone_id'];
		} else {
			if ($this->config->get('config_tax')) {
				$country_id = $this->config->get('config_country_id');
				$zone_id = $this->config->get('config_zone_id');
			} else {
				$country_id = 0;
				$zone_id = 0;
			}
		}
Then add after:

Code: Select all

if($country_id == 0 || $zone_id == 0) {
			$country_id = $this->config->get('config_country_id');
			$zone_id = $this->config->get('config_zone_id');
		}
So what happens is when the user is logged out the country and zone id's are set to zero. The new bit of code tells store that if this is the case make the country and zone id's into the stores address. So if like me you are in UK and want the UK vat to apply to cart whether logged in or not, then this is your quick fix.

Thanks again to the brain that is Jay Gilford! O0

Image

OpenCart Theme Options - See All My Extensions - OpenCart Themes and Mods


User avatar
Active Member

Posts

Joined
Fri Jun 26, 2009 11:53 pm
Location - Scotland

Post by chapter5 » Thu Jan 12, 2012 4:34 pm

I don't know why you went through all this trouble just to add tax?! If you go to Admin > System > Settings > Option > Select "Display Prices With Tax". Done! Just kidding! :laugh:

I had the same problem and where ever I looked they just told me to select it in admin. THAT"S NOT WHAT I WANT!!!!
It took me a while to get to this answer! Thanks so much for posting it!!

all the best 8)

Newbie

Posts

Joined
Fri Jul 09, 2010 3:42 pm
Who is online

Users browsing this forum: No registered users and 14 guests