Reviewed & tested by the community
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Products
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Jan 2013 at 20:59 UTC
Updated:
6 May 2015 at 09:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mandreato commentedA special format/widget for the field in admin/structure/types/manage/product/display would be the optimum, but at the moment this patch is what I can afford.
Comment #2
tr commentedI see this as a theming issue. If on your site you want to display the list price only in some circumstances, you can customize your site by overriding theme_uc_product_price(). I think a more common use case, if you're using list prices at all, would be to display list price with a strikethrough when the sell price differs from the list price. Setting list price to zero in those cases seems a little odd to me. Regardless, these sorts of things can and should be handled in the theme layer IMO.
Comment #3
mandreato commentedThe use case you described is exactly mine: I set the following CSS statement to indicate as a original price is discounted for a product.
.list-price { text-decoration: line-through; }But then I don't want to discount all products, so just a few have a list price !=0. I need to hide those with zero and probably it's a very common use case.
Since this behaviour is the same for dimensions (which also disappears when zero), I thought to manage it in Ubercart core, not via customization. Maybe the patch #1 is a rough way and it should have an option somewhere to enable/disable the field display.
Comment #4
longwaveWhile I agree that showing a list price of $0 will be uncommon, the right place to do this is in theme_uc_product_price(), so it can be overridden if necessary, and easily extended to other price fields if necessary. I guess a sell price of $0 is usually valid, while a list price or cost of $0 should probably be hidden by default.
Comment #5
mandreato commentedOK, I changed the patch by moving the exclusion logic into theme_uc_product_price()
Comment #6
philsward commentedIdeally, I think we need the ability to disable a product from purchase altogether. I have a separate custom module that will "hide" the price and checkout form but it doesn't yet work with panels or views.
Longterm, I'd love to see this integrated into core, but there's obviously some bugs that need worked out. I can share what I have if anyone is interested...
Comment #7
end user commentedMight be overboard but if you use views one you node page to display the price info/buy/now button you can set it to be not shown when the field is 0. I believe you have to remove the formating on the price other wise it doesn't work.
Comment #8
meshwetamandreato,
Thanks for the patch this worked for me. I was thinking to write jQuery for the same but your patch is too good. Thanks once again! God Bless You!
Comment #9
mandreato commentedPatch #5 is on my live site since 4 months with no problems.
Comment #10
carlodimartino commentedThanks. Patch #5 worked perfectly for me too.
Comment #11
Gemini Lights commentedJust wondering if patch #5 will be committed to a stable release version of Ubercart 7.x-3.x?
Comment #12
Gixxernutter commented+1 on #5 - thanks