Jump to content

[SOLVED] Want to add the text "as low as" before the price


Recommended Posts

Hi Wise Ones,

I am trying to figure out how I can add the phrase "as low as" in small font next to the price of an item?

So, for example, if you clicked on a category in my website and were looking at all the products, the price of each one would look something like this:

as low as $1.60

The reason why (in case you were wondering) is because I am going to be using the attribute fields to create a dropdown that customers will choose their quantity from; ie: 10 cards @ $2.00 each is $20.00. 20 cards @ $1.95 each is $39, etc.

I'm hoping this is something I can do myself, I have very limited programming skills.

I appreciate your help greatly!

Kate

Link to comment
Share on other sites

Go to themes/prestashop/product-list.tpl and find the line {convertPrice price=$product.price} and change it to: as low as {convertPrice price=$product.price}. If you have a multi-language shop you need to have it as: {l s='as low as'} {convertPrice price=$product.price} and then change the traslation for each language. Depending how you have configured the tax displaying you may need to change the line {convertPrice price=$product.price_tax_exc} also the same way - basically everything starting with {convertPrice.... you need to add the 'as low as' before it.

Link to comment
Share on other sites

That's because the default place is replaced by the attribute price using Javascript. You need to change lines 257-260 of js/product.js in your theme's directory from:

$('#our_price_display').text(formatCurrency(priceProduct, currencyFormat, currencySign, currencyBlank));
$('#pretaxe_price_display').text(formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank));
$('#old_price_display').text(formatCurrency(productPriceWithoutReduction2, currencyFormat, currencySign, currencyBlank));
$('#ecotax_price_display').text(formatCurrency(selectedCombination['ecotax'], currencyFormat, currencySign, currencyBlank));



to:

$('#our_price_display').text('As low as ' + formatCurrency(priceProduct, currencyFormat, currencySign, currencyBlank));
$('#pretaxe_price_display').text('As low as ' + formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank));
$('#old_price_display').text('As low as ' + formatCurrency(productPriceWithoutReduction2, currencyFormat, currencySign, currencyBlank));
$('#ecotax_price_display').text('As low as ' + formatCurrency(selectedCombination['ecotax'], currencyFormat, currencySign, currencyBlank));

Link to comment
Share on other sites

Rocky, that worked! THANK YOU!!

I am able to see the "as low as" on the individual product pages right next to the price.

Any chance you could point me in the right direction of having it say "as low as" at the category level too?

http://www.sweetcricket.com/6-birth-announcements

To both of you, many thanks for taking the time to help me. I truly appreciate your kindness.

Kate

Link to comment
Share on other sites

You'll need to change line 18-19 of product-list.tpl in your theme's directory:

{if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.price}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if}
{if $priceDisplay}{convertPrice price=$product.price_tax_exc}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/if}



to:

{if !$priceDisplay || $priceDisplay == 2}{l s='As low as'} {convertPrice price=$product.price}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if}
{if $priceDisplay}{l s='As low as'} {convertPrice price=$product.price_tax_exc}{if $priceDisplay == 2} {l s='-Tx'}{/if}{/if}

Link to comment
Share on other sites

  • 1 year later...

Yes, the line numbers will be different, but the principle is the same. Search for all prices in the TPL files and add 'Add low as' before the price and edit js/product.js in your theme's directory to add it to the start of the text function calls for all the prices.

Link to comment
Share on other sites

This doesn't seem to work on 1.4, I need it to show 'from only' before the price in the product list on the products that only have attributes, in 1.3 the code is like in the product-list.tpl

{if $product.id_product_attribute}{l s='from only'}{/if} {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}



I have tried to put {if $product.id_product_attribute} before 'from only' and this doesn't work in 1.4

Any help please?

Regards,

Mark.

Link to comment
Share on other sites

I just tested that code you posted on my PrestaShop v1.4.2 test site and it worked fine. Check to make sure that "Force compile" is set to "Yes" on the Preferences > Performance tab to make sure the modified file was recompiled.

Link to comment
Share on other sites

The code you posted above displays "from only" only on products with attributes on my test site. It shouldn't display on all products unless you've added attributes to all products. How did you create your attributes? Did you use the "Product combinations generator", the "4. Combinations" tab or the CSV import?

Link to comment
Share on other sites

  • 1 month 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...