We're currently unable to easily add a CSS class to prices when sell price < list price. This is particularly useful for strikethrough on a list price and/or hiding the sell price when it is the same as the list price.

Please add this to product node displays, catalog and views output. NOTE: the views output will not be able to determine the difference between list and sell prices if one is missing from the view. A note placed in the field settings page for all price fields reading something like, "In order to have CSS classes added when discounts apply to the product you need to add the field to the view. Fields can be marked as hidden using the checkbox below."

CommentFileSizeAuthor
#1 product_prices.patch3.51 KBIsland Usurper

Comments

Island Usurper’s picture

Status: Active » Needs review
StatusFileSize
new3.51 KB

This can be done with a price alter handler, so I've made a patch that adds one to uc_product. I'm not convinced that's the proper place for it though. It almost seems more like something for a contrib or custom module. But an extra class to the markup is fairly harmless as changes go, so I don't see it as being that big of a problem. It just feels a bit like bloat.

Anyway, here's the patch.

rszrama’s picture

Issue tags: +price, +ubercamp sprint

If it feels like bloat, should we put it in? This could just be a simple contrib, right?

jday’s picture

I don't see it as bloat, every store has sales. Either way (ubercore or contrib) I can't imagine anyone not using this wonderous fix. My review: 5 stars!

stephthegeek’s picture

Big +1 to have a standard, simple implementation of this in UC core itself. It's such a common request on the forums, and with it in UC core the markup would be standardized.

Will try to test this out shortly.

jeremycaldwell’s picture

I applied the patch today and it worked great but I do have a suggestion to help everyone with theming it. The problem with how the "uc-price-reduced" class is applied now is that it is added to the "sell" and the "list" class for the price. I like the fact that the class is the same when applied to the "price" fields but there also needs to be a unique class that is applied to the item as well.

The problem with how it's set now is that it prints two classes which are inline and IE6 does not handle inline classes at all. So we really want to avoid chaning CSS classes like that. Perhaps a different variation of the "price-reduced" class such as "price-reduced price-reduced-sell" and "price-reduced price-reduced-list" to avoid the need to chain the classes. This would work much better as you can style the "price-reduced" class once and apply it to both items or you could target them individually with "price-reduced-sell" and "price-reduced-list".

tr’s picture

Status: Needs review » Needs work

Let's sic the testbot on this one. It's going to fail due to the age of the patch, but it's a start ...

tr’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: -price, -ubercamp sprint

The last submitted patch, product_prices.patch, failed testing.

sittard’s picture

Please advise on the current status of this issue? Some alternative discussions around this idea:

http://www.ubercart.org/forum/support/32882/display_discount_price_next_...
http://www.ubercart.org/forum/support/543/items_sale_how#comment-68522
https://drupal.org/node/645920
(also see related Drupal issues - top right)

Would be good to have this functionality in Ubercart 3.x.