Jump to content

some of our products dont't have a price, how do we display text instead?


Recommended Posts

Some of our products dont't have a price, how do we display text instead?

 

For instance instead of displaying "€0" we should display "Call now for a quote".

 

Alternatively, is it possible to hide the price when it's zero?

 

Is this possible?

 

David

Link to comment
Share on other sites

You can do something like this in the template (product.tpl) where the price is displayed.

 

{if $product.price == 0}
   {l s='Call for a quote'}
{/if}

 

Of course, you need to integrate it qith the current price display to avoid showing 0.

Link to comment
Share on other sites

thanks Nemo, unfortunately that's not working for me no matter what I do, I've taken it this far...

 

           	 {if $priceDisplay >= 0 && $priceDisplay <= 2}
                   <span id="our_price_display">{convertPrice price=$productPrice}<br /><span class="price-vat">{l s='+ VAT.'}</span></span>

		    {elseif $product.price == 0}
			    {l s='Call for a quote'}
		    {/if}

 

But still no joy, it's still displaying the zero price, but at least the page is displaying. I don't really know Smarty that well.

 

D

Link to comment
Share on other sites

Right, I forgot about javascript

 

Product.js, about line 379

 

 var our_price = '';
 if (productPriceDisplay > 0) {
  our_price = formatCurrency(productPriceDisplay, currencyFormat, currencySign, currencyBlank);
 } else {
  our_price = formatCurrency(0, currencyFormat, currencySign, currencyBlank);
 }
 $('#our_price_display').text(our_price);

 

Put a condition here, do the text substitution only if the price is not 0. THis should fix it :D

Link to comment
Share on other sites

Okay, try this then

var our_price = '';
 if (productPriceDisplay > 0) {
  our_price = formatCurrency(productPriceDisplay, currencyFormat, currencySign, currencyBlank);
 } else {
  our_price = formatCurrency(0, currencyFormat, currencySign, currencyBlank);
 }
if(our_price != 0)
 $('#our_price_display').text(our_price);

 

 

And in the template

 

 {if $priceDisplay >= 0 && $priceDisplay <= 2}
{if $product.price !=0}
			    <span id="our_price_display">{convertPrice price=$productPrice}<br /><span class="price-vat">{l s='+ VAT.'}</span></span>
					    {elseif $product.price == 0}
							    {l s='Call for a quote'}
					    {/if}
{/if}

Link to comment
Share on other sites

  • 1 year later...
  • 9 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...