Jump to content

[SOLVED] priceDisplay and tax included


Recommended Posts

I keep seeing this around the default theme

{if $priceDisplay} tax ecluded {else} tax included

, but I can't find any setting in the back office that relates to that variable... how do I set it? At the moment, it's set to show tax excluded, I want it to show tax included.

 

JD

 

EDIT: Sorry, probably posted this in the wrong area.

Edited by jd.creative (see edit history)
Link to comment
Share on other sites

Look here:

 

in frontcontroller, you have the following line:

 

  'priceDisplay' => Product::getTaxCalculationMethod(),

 

 

in product.php there is the following line:


public static $_taxCalculationMethod = PS_TAX_EXC;

(initializing the value to TAX_EXC)

 

and those two functions:

 

 

public static function initPricesComputation($id_customer = null)
{
 if ($id_customer)
 {
  $customer = new Customer((int)$id_customer);
  if (!Validate::isLoadedObject($customer))
   die(Tools::displayError());
  self::$_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group);
 }
 else
  self::$_taxCalculationMethod = Group::getPriceDisplayMethod(Group::getCurrent()->id);
}
public static function getTaxCalculationMethod($id_customer = null)
{
 if ($id_customer)
  Product::initPricesComputation((int)$id_customer);
 return (int)self::$_taxCalculationMethod;
}

 

Doing the work of returning the right value. Apparently it depends on any (previous) customer, what group he's in...

 

For you to dig some more in this...

 

My cents,

pascal

Link to comment
Share on other sites

Thank you both for your answers, but indeed Vekia has the answer I was looking for.

 

Where can I make suggestions for future Prestashop builds... I would expect to see a default setting for all groups tax setting in the preferences area of the back office.

 

Thanks,

JD.

Link to comment
Share on other sites

  • 1 year later...

This is what I came here for:

 

{$priceDisplay} can have this values:

1 (means Tax excluded)

0 (means Tax included)

 

The variable is read from an option named "price display" of the group of the current customer.

  • Like 1
Link to comment
Share on other sites

  • 8 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...