Jump to content

[SOLVED] Product list PRICE LOWERED!


robkwal

Recommended Posts

Hi, I now have a grid view for my product list so when a product is on sale it interrupts the layout consistency. So I would like to know weather it is possible to remove the text 'PRICE LOWERED' and have something as simple as the price text changing to the color red if it was on sale, which would imply it was on sale, but not add a new line to the product and effect the layout? Is there an if statement that could be added or something?

Thanks.

Link to comment
Share on other sites

Hi!
In product_list.tpl modify the following lines

{if $product.on_sale}
{l s='On sale!'}
{elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product.reduction_from))}
{l s='Price lowered!'}
{/if}



so they will look like

{if $product.on_sale}
{l s='On sale!'}
{/if}



Change

{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}


to

{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}



In this case if the product is on sale it will display the text 'On sale', but in the case if the price is lowered the price will be displayed in red.

If you want to display the price in red only if the product is on sale, but you dont't want to indicate if the price is lowered or not than
delete

{if $product.on_sale}
{l s='On sale!'}
{elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product.reduction_from))}
{l s='Price lowered!'}
{/if}



and
do the following changes

{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}




Hope it works! ;)

Link to comment
Share on other sites

  • 5 months later...

it does not work on 1.3.1. .... I get this message in my shop:

Fatal error: Smarty error: [in .../public_html/themes/my_theme/./product-list.tpl line 28]: syntax error: invalid attribute name: 'lowered!�' (Smarty_Compiler.class.php, line 1550) in /usr/home/deb26947/domains/serviezenonline.nl/public_html/tools/smarty/Smarty.class.php on line 1095

Does anybody know how I can fix this?

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