When an option within an attribute contains a price adjustment, a comma is added to the formatting. For example:

Adobe Photoshop, +$50.00

How can I remove the comma? I would prefer that each item display without the comma:

Adobe Photoshop +$50.00

Comments

Status:Active» Fixed

You can override theme_uc_attribute_option() to change this.

Could you provide specifics about how to override it? I am a site builder, not a programmer, so coding is not my strong suit. Thanks.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status:Closed (fixed)» Active

I'm reopening this because my request for help was not answered. I am a site builder, not a coder/programmer, so I would greatly appreciate a solution suitable for someone who is not fluent in PHP. Thank you.

Status:Active» Fixed

If your theme is called MYTHEME then you would add this to your template.php file:

<?php
function MYTHEME_uc_attribute_option($variables) {
 
$output = $variables['option'];
  if (
$variables['price']) {
   
$output .= ' ' . $variables['price'];
  }
  return
$output;
}
?>

Save the file, clear your caches, and the comma should be gone.

Further theming support questions should be asked in the main forums on drupal.org or ubercart.org.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Version:7.x-3.0» 6.x-2.11
Priority:Normal» Major
Status:Closed (fixed)» Active

#5 didn't work for me on 6.x-2.11. Even tried to remove the comma in the module file changing this

function theme_uc_attribute_option($option, $price) {
  $output = $option;
  if ($price) {
    $output .= ', ' . $price;
  }
  return $output;
}

to this

function theme_uc_attribute_option($option, $price) {
  $output = $option;
  if ($price) {
    $output .= ' ' . $price;
  }
  return $output;
}

Priority:Major» Normal
Status:Active» Fixed

It looks like your theme function has been overridden. You need to modify the override version. Don't forget to clear your caches.

See https://drupal.org/theme-guide/6-7 for more information on theming.

This is not an appropriate forum for this sort of issue. See http://www.ubercart.org/forum/theming_and_design for Ubercart-specific theming questions.

I don't think so. I've changed theme to Garland, flushed all caches, it's still there.

Editing that function, or overriding it in template.php, definitely works for me in a clean install of 6.x. Maybe you have another module installed that affects the product attribute system that is overriding this?

When I inspect it with Theme Developer, the function is called from the overridden function. So it should be working. Anyway, maybe some other modules interfering as you say. I'll investigate.

Thanks.

Yes indeed, Ajax Attribute Calculations was overriding it. Removing the comma from line 134 did it for me.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.