Re: This might help. Nifty

Posts: 19
Joined: 04/08/2008

Thanks for pointing me that great tutorial!

I added the following lines to my own node-product.tpl.php:

<?php
if ($sell_price < $list_price) {
  print
"<div id=\"price_box\" class=\"low-price-box\"><p class=\"list_price striked\">" . $list_price . "</p><p class=\"sell_price offer\">" . $sell_price . "</p><p class=\"offer_text\">Low price!</p></div>";
  }
  else {
    print
"<div id=\"price_box\"><p class=\"sell_price\">" . $sell_price . "</p></div>";
  }
?>

Then I used CSS to style:

#price_box
.low-price-box
.list_price
.striked
.sell_price
.offer
.offer_text

There is one big problem, though: I use this contrib http://www.ubercart.org/contrib/1532 (in Europe item prices must include taxes). With such module enabled, the code above only works for user #1, while other users display price including VAT, so my code doesn't apply.

I am no code guru, so I would appreciate if someone could tell me how to fix my code.

TIA, gabble.

Sell price striked through when less than list price By: gabble (9 replies) Wed, 04/23/2008 - 12:03