Jump to content

Pricing Query


bunoire14

Recommended Posts

Hi,

 

Im not sure if im in the right place but i figure since Im looking for vairable information I may as well post here.

 

Im trying to get my product prices showing in my cart with the "Ex.VAT" label. I have read the others threads on this matter and made some edits to uncomment the relevent sections of code in the template but seem to have hit a snag. Despite setting the settings in the admin panel and on the template it seems the "Ex. VAT" flag doesent show.

 

Looking at the code it seems to check in the template to see if tax has been enabled, if the setting to show the tax label is set and what price has been set to show (Inc/Ex Tax). However the return values from a var_dump on the varibales in question throw up some questions:

 {if $priceDisplay >= 0 && $priceDisplay <= 2}
         <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>
            //If $tax_enabled is 1 and $display_tax_label is set and is equal to 1 or is not set                         
           {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
	     //If price display is equal to 1 then show label Exc. VAT otherwise show label Inc.VAT 
             {if $priceDisplay == 1}{l s='Exc. VAT'}{else}{l s='Inc. VAT'}{/if}
	   {/if}
             <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
  {/if}

My problem is the conditional check, when i check the values I get this:

 

  • $tax_enabled returns bool(false) despite it being enabled in the admin panel? It seems to pull from the PS_TAX in the Db which is set to 1.
  • $tax_display_label returns a bool(true), does smarty see int(1) and bool(true) as the same thing?
  • $priceDisplay returns int(1) as I would expect it to.

 

Can anyone point me in the direction of where i might look to figure out what im missing to get this working.

 

Any help appreciated and apologies if this si in the wrong forum section.

 

Thanks in advance.

 

Link to comment
Share on other sites

Its 1.6.1.0, pricing is disabled for users that arent logged in, so the user i am testing with has to be logged in. Its as if somewhere between the Tax model where the value of $tax_enabled seems to be set, an it arriving at the view its modified, but im not overly familiar with the application structure so cant figure out where the change could happen. But the conditional fails immediately on that variable as its returning false, which what i think is causing the issue.

Link to comment
Share on other sites

OK if i change line 282 on product.tpl to this:

{if ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}

rather than this

{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}

it works, im going to try and trace where that variable is passed too to figure out where its changed. For now this works for my purposes, but if i can find it maybe it would be useful for other people.

Link to comment
Share on other sites

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...