Jump to content

Where is $priceDisplay configured?


Recommended Posts

I am trying to understand the logic for displaying the price with/without VAT in product.tpl:

                            <!-- prices -->
                            <div class="price">
                                <p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                                    {if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
                                    {if $priceDisplay >= 0 && $priceDisplay <= 2}
                                        <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>
                                        <p class="tax_and_shipping">
                                            {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
                                                {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
                                            {/if}
                                            <a href="{$link->getCMSLink('1')}" title="{l s='plus Shipping'}"> {l s='plus Shipping'}</a>
                                        </p>
                                        <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
                                    {/if}
                                </p>
                                <p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
                                    <span id="reduction_percent_display">
                                        {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
                                    </span>
                                </p>
                                <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
                                    {if $priceDisplay >= 0 && $priceDisplay <= 2}
                                        <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
                                        {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}
                                    {/if}
                                </p>
                                {if $priceDisplay == 2}
                                    <br />
                                    <span id="pretaxe_price">
                                        <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
                                        {l s='tax excl.'}
                                    </span>
                                {/if}
                            </div> <!-- end prices -->

Where is the set value for $priceDisplay configured exactly?

 

In the above code from product.tpl I have enabled the display of the tax label (which was commented out) and added a "plus Shipping" note linked to the shipping CMS page, but I am unsure if this is the proper way.

 

What I want is the tax label always being visible (it has to be clear at all times if a shown price includes VAT or not), and the "plus Shipping" shown whenever a price is displayed.

 

In my setup and visiting the page as a visitor I now get the following display:

 

co5ciolurju6poh58.jpg

 

If I let the price excl. VAT to show as well (by changing {if $priceDisplay == 2} to {if $priceDisplay <= 2}) it looks as follows:

 

co5ckjckts5vk88ng.jpg

 

Although the style of the price excl. VAT doesn't fit, I like the idea of having the price excl. VAT shown as well IF the price shown above includes VAT (otherwise that would not make any sense).

 

Any ideas?

Edited by Master One (see edit history)
Link to comment
Share on other sites

I am trying to understand the logic for displaying the price with/without VAT in product.tpl:

                            <!-- prices -->
                            <div class="price">
                                <p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                                    {if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
                                    {if $priceDisplay >= 0 && $priceDisplay <= 2}
                                        <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>
                                        <p class="tax_and_shipping">
                                            {if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
                                                {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
                                            {/if}
                                            <a href="{$link->getCMSLink('1')}" title="{l s='plus Shipping'}"> {l s='plus Shipping'}</a>
                                        </p>
                                        <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
                                    {/if}
                                </p>
                                <p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
                                    <span id="reduction_percent_display">
                                        {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
                                    </span>
                                </p>
                                <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
                                    {if $priceDisplay >= 0 && $priceDisplay <= 2}
                                        <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
                                        {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if}
                                    {/if}
                                </p>
                                {if $priceDisplay == 2}
                                    <br />
                                    <span id="pretaxe_price">
                                        <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
                                        {l s='tax excl.'}
                                    </span>
                                {/if}
                            </div> <!-- end prices -->

Where is the set value for $priceDisplay configured exactly?

 

In the above code from product.tpl I have enabled the display of the tax label (which was commented out) and added a "plus Shipping" note linked to the shipping CMS page, but I am unsure if this is the proper way.

 

What I want is the tax label always being visible (it has to be clear at all times if a shown price includes VAT or not), and the "plus Shipping" shown whenever a price is displayed.

 

In my setup and visiting the page as a visitor I now get the following display:

 

co5ciolurju6poh58.jpg

 

If I let the price excl. VAT to show as well (by changing {if $priceDisplay == 2} to {if $priceDisplay <= 2}) it looks as follows:

 

co5ckjckts5vk88ng.jpg

 

Although the style of the price excl. VAT doesn't fit, I like the idea of having the price excl. VAT shown as well IF the price shown above includes VAT (otherwise that would not make any sense).

 

Any ideas?

 

$priceDisplay is set in BackOffice and it is related to customer groups

 

CUSTOMERS  >  GROUPS - Show prices YES/NO

 

the value is boolean so it means it can be only FALSE or TRUE ----> 0 or 1

so you cannot set 2

Link to comment
Share on other sites

OK, if that's the case, what is this part in the prices section of product.tpl for?

                               {if $priceDisplay == 2}
                                    <br />
                                    <span id="pretaxe_price">
                                        <span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
                                        {l s='tax excl.'}
                                    </span>
                                {/if}

If $priceDisplay is boolean, that part is obsolete, in which case I'd like to rewrite the prices section to show the price excl. VAT as well IF the price above is shown incl. VAT.

 

Or is there nevertheless any case where $priceDisplay == 2 ?

Link to comment
Share on other sites

Sorry for not letting go, but I'm confused.

{if $priceDisplay >= 0 && $priceDisplay <= 2}

This suggests there are at least 3 relevant states for action: 0, 1 and 2.

With a value of > 2 no price is shown, so this could mean "catalog mode"?

{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}

This tells if $priceDisplay is

 

0 then show 'tax incl.'

1 then show 'tax excl.'

2 then show ' tax incl.'

{if $priceDisplay == 2} ... {l s='tax excl.'}

So if $priceDisplay is 2 both prices are shown as in the already shown picture:

 

co5ckjckts5vk88ng.jpg

 

That pretty much what I want, so where in the backend can it be configured to have $priceDisplay = 2 ?

Edited by Master One (see edit history)
Link to comment
Share on other sites

if you set in Customers >Groups Price display method - Tax incl. then the value is 0

if you set in Customers >Groups Price display method - Tax ecxl. then the value is 1

 

the only way I know how to set $priceDisplay == 2 is to go to database table ps_group and manualy set price_display_method to 2 for group you want

Edited by UniqueModules (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...