Jump to content

Call for pricing help in Prestashop V1.6


Recommended Posts

  • 2 weeks later...

You can try enabling catalog mode, then add a link leading to the contact page with the test 'contact us for a quote' somewhere inside product.tpl, using something like the following:

 

<a href="{$link->getPageLink('contact')}">{l s="Contact us for a quote"}</a>

  • Like 1
Link to comment
Share on other sites

Thanks , That works .. is there any option to enable this for only certain type of products in the shop and not all of them .Kindly advise .

 

I dont have idea of PHP . I want some thing like this

 

if <price of product = 0>

 

display "Call for pricing"

 

End if 

 

Updated at approx 7:30 PM IST ========================================================

 

I came through the below while searching in the forum but it is for PrestaShop 1.5.2 

 

http://www.prestashop.com/forums/topic/135602-call-for-price/

 

will it work in PS V1.6 

 

Updated at 10:38 PM IST ========================================================

 

the above did not work for me in the localhost . Kindly help me with alternatives .

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

{if $product.price == 0}

code here

{/if}

for the product list, or

 

{if $productPrice == 0}

code here

{/if}

 

 

The code here is to be replaced with the below piece of code . Kindly confirm

 

<a href="{$link->getPageLink('contact')}">{l s="Contact us for a quote"}</a>

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 3 months later...

So, here's where to put the code:

 

In the file product.tpl (themes/default-bootstrap/product.tpl)

 

immediately below: 

 

<!-- prices -->

<div class="price">
 

add:

 

{if $productPrice == 0}
   <p class="callforprice">Call For Price</p>
{else}

 

and then immediately above:

 

</div> <!-- end prices -->

 

add:

 

{/if}

 

In the file product-list.tpl (themes/default-bootstrap/product-list.tpl)

 

Immediately after:

 

<div class="content_price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
 
add:
 
{if $product.price == 0}
  <p class="callforprice">Call For Price</p>
{else}
 
and immediately before the closing </div> tag after:
 
{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{/if}
 
add another:
 
{/if}
 

Then style the callforprice class if you wish.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

That's managed by product-list.tpl, for both modules. Locate the spot where your price is displayed, the default it

 

 

<span itemprop="price" class="price product-price">
{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
</span>
 
And change accordingly, following the above. Please notice it might be necessary to clear the shop's cache
Link to comment
Share on other sites

Thank you for reply, I have found the code in themes/default-bootstrap/product-list.tpl, but don't know how to change it. Would you please advise step by step. Thank you very much!

 

<span itemprop="price" class="price product-price">
{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
</span>
Link to comment
Share on other sites

That's way more complex. Attributes are (sadly) all managed by javascript. I am not sure how to do it out of my head myself, but you must edit the updatePrice function of product.js, here

 

$('#our_price_display').text(formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank));

Link to comment
Share on other sites

I have solved my problem

 

Nemo1 thank you to put me in the right direction. Here below my solution.

 

 

 

in product.js you can find

$('#our_price_display').text(formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank));

the "our_price_display" is then transfered to the product.tpl page 

									<span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>

i have changed the formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank) to a var "text_or_price" and  i have added an if check on the basePriceDisplay and when this is not null i change my var "text_or_price" to formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank) else i change my var "text_or_price" to the text i want to display if the price for the combination is null.

 

 

so in product.js you can search for

$('#our_price_display').text(formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank));

and replace it with

if (basePriceDisplay > 0)
	
{
var text_or_price = formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank);
}

else
{
var text_or_price = "Not available" ;
}
	
$('#our_price_display').text(text_or_price);

And if you want you can hide the counter and add to cart button also if you want.

Just add it to the else but don't forget to add the show also in the if statement otherwise it will stay hidden when you switch between your combinations.

So then it becomes

if (basePriceDisplay > 0)
	
{
var text_or_price = formatCurrency(priceWithDiscountsDisplay * currencyRate, currencyFormat, currencySign, currencyBlank);
$('#quantity_wanted_p').show();	 //show quantity counter if it's hidden
$('#add_to_cart').show();	 //show add to cart if it's hidden
}

else
{
var text_or_price = "Not available" ;
$('#quantity_wanted_p').hide();	 //show quantity counter if it's hidden
$('#add_to_cart').hide();	 //show add to cart if it's hidden
}
	
$('#our_price_display').text(text_or_price);

Maybe someone can use this.

  • Like 3
Link to comment
Share on other sites

×
×
  • Create New...