4 replies [Last post]
JJR
JJR's picture
Offline
Joined: 11/15/2012
Juice: 60
Was this information Helpful?

Seems simple, but I can't find how to do it.

I would like to put a product on special offer.

I would like the original price to be displayed, next to the new special price, on the product page, so that customers can see there is a discount and how much it is.

Is there any way to do this?

Many thanks

DanZ's picture
Offline
Joined: 08/07/2011
Juice: 1643
Here's one way: Administer

Here's one way:

Administer your product type at admin/structure/types. Click on the appropriate "Manage Display" link.

Hide or display the appropriate "List Price", "Display Price", and "Sell Price" fields. Assuming that you enter these values for each product, you'll get what you want.

Actually re-arranging the display of these prices on the page requires theming the product node page.

JJR
JJR's picture
Offline
Joined: 11/15/2012
Juice: 60
Thanks for the reply. I tried

Thanks for the reply.

I tried that way before... trouble is there doesn't seem to be a way to hide or show the 'list price' field on a per-product basis. If I enable it in admin, it shows on all of the....

Hmmm... had a thought... hold this page!

DanZ's picture
Offline
Joined: 08/07/2011
Juice: 1643
Re: Thanks for the reply. I tried

The way to do it on a per-product basis is to theme the product page. If the list price and the display price are different, display both. If not, just display the one.

hkvega01's picture
Offline
Joined: 09/05/2012
Juice: 81
Re: Display discount price next to original price on product pag

i wrote a module to do this in product node page

function custom_node_view($node, $view_mode, $langcode){

    if ($node->type == 'product' ){
  //var_dump($node->content['list_price']);
  $sell_price = $node->content['sell_price']['#value'];
  $list_price = $node->content['list_price']['#value'];
  if ($list_price > $sell_price) {
$node->content['sell_price']['#attributes']['class'][] = "red-sell-price";
$node->content['list_price']['#attributes']['class'][] = "cross-list-price";
  } else {
unset($node->content['list_price']);
  }
 
    }
}

But for views, catalog, i use preprocess_views_view_fields to do, it is much more diffcult