Closed (fixed)
Project:
Display Suite
Version:
6.x-2.x-dev
Component:
Field UI
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2011 at 18:32 UTC
Updated:
5 Nov 2012 at 15:40 UTC
I'm not too sure if this is the right area to be posting and if not please direct me to a more appropriate place. I have installed Ubercart + Display Suite and I'm having problems getting the "price" field to show when I customize a layout. There is not even an option in the layout for the field to be placed in any region. I checked all the modules to make sure everything was turned on and it appears so. Does anyone have any suggestions as to why the price field will not show?
Comments
Comment #1
F0rumus3r commentedI kind of solved this problem but created another one along the way. For those who may be interested:
I went to Display Suite> Node Displays > Fields
Click 'Add new code field'
Populate Field Key and Field Title
Select which types of content you want to EXCLUDE from the new field
Toggel 'Toggle this checkbox if you are using tokens in this field" ON
Go through the list and find which Token is best suited, for me it was [sell_price]
Save Code Field
Now you can select where you want this field on your layout page
Now the problem . . .
The price displays now but unfortunately it has added extra decimal places -6 to be exact. Instead of an amount displaying as $150.99 it is now displaying as $159.990000
I did check my store configuration to make sure I had the currency correct and I do. I'm not to sure where to go from here.
Comment #2
swentel commentedYou can either use the uc_price() function (included in uc_store/includes/uc_price.inc) or use php functions like money_format (see php.net/money_format)
Comment #3
F0rumus3r commentedThank you for the suggestion! Unfortunately PHP is not a strength (I've never used it before today). I looked up the tutorial and I kind of get it. I've tried to implement the code and I've been having a hell of a time trying to get it to work.
Show examples of my failed attempts include:
I can't get get any combination of these to work. I'm pretty frustrated.
Comment #4
jami3z commentedI had the same issue. seems like a bug. if [sell_price] is already available then why would it not work?
i did the same work around as #1, but to get the themed price i added the following in the field code:
Comment #5
designate commentedSince I'm no php-type-of-guy; How to only show the price on the above mentioned (#4) way when the sell price is greater than 0.00? Thus not showing the price [and label] when it's 0 [in case of ubercart price quote] What syntax to use?