If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Change all products prices to apply taxes - how to?

Change all products prices to apply taxes - how to?

Started by ilmarchez on 20 May 2015, 2:29 PM · Views: 987

Results 1 to 9 of 9
20 May 2015, 2:29 PM
#1
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Post #1 by ilmarchez

Hi,

I'm having this issue: when I started to run the store I set all products prices as gross (including taxes) and set tax lsaa to none.
No I want to show both prices including and axluding taxes, but of course my database has the net and gross price set equal and no tax selected.

I need to set for all products a class category (example "VAT22"), and change all net prices to reflects this formula: net + VAT 22% = gross.
I only have gross price.

How could I do it? Could I perform it with some SQL commands? Could you please help me out?

Thank you.

21 May 2015, 4:52 AM
#2
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Post #2 by bislewl

You should be able to use the built in functions

Examples

with tax and specials applied
zen_get_products_actual_price(PRODUCT_ID_HERE);

without tax
zen_get_products_base_price(PRODUCT_ID_HERE);

24 May 2015, 12:45 AM
#3
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Post #3 by ilmarchez

Hi,

I have installed Dual Pricing and now I'd like to show:

  • price including taxes for retail users $_SESSION['customer_whole'] 0
  • price excluding taxes for wholesalers $_SESSION['customer_whole'] 1
  • in any case the grand total should apply taxes for both.

How could I specificy it? Any tip with the code?

Thank you very much for your help.

24 May 2015, 5:09 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #4 by kobra

grand total should apply taxes for both
Really???
Usually selling to wholesalers no tax is collected as they eventually collect tax where applicable
Do they provide you with a resellers license?

Zen-Venom Get Bitten

24 May 2015, 9:48 AM
#5
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Post #5 by ilmarchez

kobra:

Really???
Usually selling to wholesalers no tax is collected as they eventually collect tax where applicable
Do they provide you with a resellers license?

Hi not in Italy. In Italy you have to apply VAT also to wholesalers.
then the wholesaler has a VAT credit of the amount they paid and they compensate it with the VAT they apply to customers.

That is why I need to show prices like that and that the grand total apply taxes to everybody.
thank you.

24 May 2015, 3:20 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #6 by kobra

Hopefully someone familiar with VAT will come across this posting

Zen-Venom Get Bitten

24 May 2015, 11:05 PM
#7
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Post #7 by ilmarchez

kobra:

Hopefully someone familiar with VAT will come across this posting

Not really in VAT matters but some lines of code to specify in the product listing, product information and shopping cart how to tell ZC to show prices excluding VAT to wholesale users and including VAT to regular users would be great...

Hope so...
Thanks

26 May 2015, 3:39 PM
#8
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Post #8 by bislewl

ilmarchez:

Not really in VAT matters but some lines of code to specify in the product listing, product information and shopping cart how to tell ZC to show prices excluding VAT to wholesale users and including VAT to regular users would be great...

Hope so...
Thanks

Ok, it appears the issue is ilmarchez would like the configuration_value of DISPLAY_PRICE_WITH_TAX to be true unless the customer is wholesale so that on checkout they are both showing taxes. Here is the fix I have for you:

in the includes/functions/functions_taxes.php
Change:

  function zen_add_tax($price, $tax) {
    global $currencies;

    if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
      return $price + zen_calculate_tax($price, $tax);
    } else {
      return $price;
    }
  }

to:

function zen_add_tax($price, $tax) {
    global $currencies;
    if ($_SESSION['customer_whole'] == 1) {
        return $price;
    }
    if ((DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0)) {
        return $price + zen_calculate_tax($price, $tax);
    } else {
        return $price;
    }
}
26 May 2015, 10:40 PM
#9
ilmarchez avatar

ilmarchez

Zen Follower

Join Date:
Aug 2009
Posts:
128
Plugin Contributions:
0

Post #9 by ilmarchez

bislewl:

Ok, it appears the issue is ilmarchez would like the configuration_value of DISPLAY_PRICE_WITH_TAX to be true unless the customer is wholesale so that on checkout they are both showing taxes. Here is the fix I have for you:

in the includes/functions/functions_taxes.php
Change:

function zen_add_tax($price, $tax) {
global $currencies;

if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) ) {
  return $price + zen_calculate_tax($price, $tax);
} else {
  return $price;
}

}

> 
> to:
> ```php
function zen_add_tax($price, $tax) {
    global $currencies;
    if ($_SESSION['customer_whole'] == 1) {
        return $price;
    }
    if ((DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0)) {
        return $price + zen_calculate_tax($price, $tax);
    } else {
        return $price;
    }
}

Hi. I tried with your code, but it does work for regular customers only.

When I log in as a wholesaler it calculates at the checkout the total not adding TAX. It does show taxes, but it does not add the tax to the total amount. This is ok for regular customers, not for wholesalers…. Any other idea?

Looking at the code it seems while it discriminates if ZC has to show prices with tax included or not it does not state to add to the total amount of the checkout the tax if the customer is a wholesaler…

To summarize, I'd need the order total to be calculated as follows:
REGULAR CUSTOMER

  • see all prices with tax included
  • (if possible should be hidden the tax section at checkout since it may appear to double-tax them)
    WHOLESALE CUSTOMER
  • see all prices with tax excluded
  • tax amount is shown at the checkout and added to the total (VAT applied to all products and to all shipping fees as well)…

Thank you very much.