Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 07-28-2017 07:15:33

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1716

VAT Display

HI Nick
Years ago you done a on/off vat display.

Trying to remember how it was done to recreate it.

Is there a way to reset this variable for the session, or do I need to create my own session variable and update every instance of core_settings.core.taxcountryeudisp based on the new session variable.

Code:

$this->globals('core_settings.core.taxcountryeudisp');

Rob

Offline

 

#2 07-28-2017 08:10:45

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19871
Website

Re: VAT Display

The easiest way for you to handle this is to add a cookie or session variable for the user (cookie preferred, you'll see why when 9.0.2 releases), then edit {private}/core/CORE/tasks_startup/0200_settings.php and, at the bottom after settings are defined, set the value for that global based on the cookie/session value, if it's valid.

Code:

if ((!(empty($_COOKIE['vatdisp']))) && (($_COOKIE['vatdisp'] == 'INCL') || ($_COOKIE['vatdisp'] == 'EXCL') || ($_COOKIE['vatdisp'] == 'BOTH'))) {

     $this->globals('core_settings.core.taxcountryeudisp',$_COOKIE['vatdisp']);

} // End of if statement.

Nick Hendler

Offline

 

#3 07-29-2017 06:06:52

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1716

Re: VAT Display

Hi Nick

I can pretty much get this to work, bar one problem.

If there are items in the cart and the vat display button is clicked, the contents of the cart are wiped out.

Any ideas?


Rob

Offline

 

#4 07-29-2017 06:27:31

zanart
Member
From: bedford
Registered: 04-02-2008
Posts: 1716

Re: VAT Display

Looks like there is a check in function check_cart_savetype   

Code:

($cartdata['taxcountrydisp'] != $this->taxcountrydisp)

What is the purpose for this check?

Can I update $cartdata['taxcountrydisp'] to the new  $this->taxcountrydisp) before the check?


Rob

Offline

 

#5 07-31-2017 08:49:27

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19871
Website

Re: VAT Display

That check removes any items from the cart which have a VAT designation different that the one in use globally by the store.  The reason this is done is if you change your VAT displays then the items are dumped so as not to display invalid pricing.


Nick Hendler

Offline

 

Board footer