6 replies [Last post]
JJR
JJR's picture
Offline
Joined: 11/15/2012
Juice: 93
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: 1738
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: 93
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: 1738
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: 82
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

eric's picture
Offline
Joined: 11/25/2007
Juice: 82
Re: Re: Display discount price next to original price on product

hkvega01: where can I download this module?

Chun Ming (Eric) Wong
Managing Director
Portable Electronics Ltd

eric's picture
Offline
Joined: 11/25/2007
Juice: 82
Specials catalog using Ubercart views

Hi guys,

I figured out a workaround using Ubercart views.

1) I added a Catalog taxonomy term called Specials
i.e. you will need to put the product you want labelled Specials into the special catalog
Note: you will need to create this taxonomy term manually.
2) labelled List price = Normal Price
3) Price = Special Price
4) Sorting is based on Updated date (asc).

Import the attached file into ubercart views.

This is not ideal but will work until someone can work out a better solution. Enjoy..

Feel free to change it the way you want and contribute here.

AttachmentSize
uc_specials.txt 6.03 KB

Chun Ming (Eric) Wong
Managing Director
Portable Electronics Ltd