How to remove ", +" sign and display product price on product page ?

Project:Ubercart Contributions
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Hello,

I have search this website forum and other content of net also to find solution but i didn't get it. So i have created this issue.

My problem is when any product is displayed with attributes than price of that attribute is displayed in this manner

Attribute Name :
option 1, +$10.00
option 2, +$20.00
option 3, +$30.00

Now instead of this i want to display it like

Attribute Name :
option 1, $10.00
option 2, $20.00
option 3, $30.00

I have tried attribute display option.
1st is Do not display. Which is not recommended for my website
2nd and 3rd is Display price adjustment / total price but it display + sign.

I have tried StringOverride module but it doesn't helped as code of ", +" might be not added in t() function or it is concated at time of display in string.

So anyone know solution please help me out and i recommend to developer to add new option at time of listing whether they want to display "+ " sign or not.

Thank you
Tejas Mehta

Joined: 02/10/2010
Juice: 130

Open ubercart/uc_attribute/uc_attribute.module

There are a few options. In my case, I don't want the price at all because I'm adding gift cards and already have the price listed as the name of the option. Currently it appears like this: $25, +$25.00

If you comment out line 751 like this: //$options[$option->oid] .= $display_price;

then the price is completely hidden, i.e. it now appears: $25

If you just want to remove the + sign, then go to line 739 and replace this: $display_price = ($option->price != 0 ? ', '. ($option->price > 0 ? '+' : '') . uc_price($price_info, $context) : '');

with this: $display_price = ($option->price != 0 ? ', '. ($option->price > 0 ? '' : '') . uc_price($price_info, $context) : '');

Joined: 04/25/2009
Juice: 52

Hello Charlie,

I appreciate your help but won't be it harmful to make changes in core code of module ? I am not expert of drupal but when we have to upgrade module than those changes will be removed and you have to do this manual changes again.

Again i thanks to you for this useful information and also asking you that if you have another alternative for this ? i know its hard as it took lot of time to search from my side also and at last i have to ask here.

Thank you
Tejas Mehta

Joined: 02/10/2010
Juice: 130

You are correct in that applying future updates would result in this issue.

I never hack Drupal core, but due to my various client's needs I have had to hack Ubercart's package modules several times in the past few months.

I just keep a txt file in the modules directory noting the files, lines, and changes I have made. I really only have a handful of these, so upgrading Ubercart would require an extra 15-20 minutes to make sure my changes are still in-place.

Joined: 02/10/2010
Juice: 130

I've thought about this some more. Since this formatting isn't created by uc_price or any other modules, but is only hard-coded right here in uc_attribute.module, there are really only 2 options:

- Modify line 739 as I mentioned above, OR
- Extend the uc_attribute module so that you can specify how to display the options, whether it be select, checkbox, or radios.

The 2nd method wouldn't require too much coding. I'd be willing to help with it, but I wouldn't want my work to be for naught if it's not accepted into core, and I really don't know how to go about that right now.

Joined: 04/25/2009
Juice: 52

Hello csdesignco,

I appreciate your initiative to help me out. Modifying code is strictly prohibited in my work of area so i have two options

- Create new module
- Set in theme

For option 1 i found that in uc_attribute.module file you have mentioned this code on line 739 and i have at line 707. Might be not latest version updated on server but we need solution for all version until ubercart provide such type of support.

For option 2, themes will be get changed site by site so we have to do it manually in all theme. This is time consuming than enabling module.

Also you wrote that you would not work until your work will be accepted by core. What i believe is first we can try to make such type of solution and if it good than ubercart maintainer will definitely accept it in new release.

Thank you
Tejas Mehta