Product view does not show SKU/Model field title

Project:Ubercart Contributions
Component:Code
Category:
Priority:minor
Assigned:Unassigned
Status:patch (to be ported)
Description
Project: 
Ubercart

If Product SKU/Model is selected to be shown in settings, it shows up as a code without a field name that confuses the clients.

here is the patch:

inside uc_product.module line 2303,

change this code:

/**
* Format a product's model number.
*
* @ingroup themeable
*/
function theme_uc_product_model($model) {
  $output = '<div class="model">';
  $output .= t('!m', array('!m' => $model));
  $output .= '</div>';
  return $output;
}

with this code:

/**
* Format a product's model number.
*
* @ingroup themeable
*/
function theme_uc_product_model($model) {
  $output = '<div class="model">';
  $output .= t('SKU/Model: !m', array('!m' => $model)); //added the field name
  $output .= '</div>';
  return $output;
}

Version: 
Ubercart 1.3
goodeit's picture
Offline
Joined: 05/28/2008
Juice: 322
Re: Product view does not show SKU/Model field title

This is themeable, so there is no patch to core required to change the display. I have done this myself. Simply add

function *yourtheme*_uc_product_model($model) {
$output = '';
$output .= t('SKU/Model: !m', array('!m' => $model)); //added the field name
$output .= '';
return $output;
}

to your template.php, where *yourtheme* is the name of your theme.

EDIT: see also http://www.ubercart.org/faq/617

ga@drupal.org's picture
Offline
Joined: 08/07/2008
Juice: 27
Re: Re: Product view does not show SKU/Model field title
Assigned to:goodeit» ga@drupal.org

thanks goodeit for your input, i think it's the best way to fix the problem temporary before patching the core. let's look at this one more time, what is the point of showing a strange code to clients when they are viewing a product, without telling them, what it is??? it only confuses the end user. this is a core bug and must be fixed in next release.

I attached a patch for uc_product.module

and there is another serious problem with this field that i think i have to create another issue for it:
SKU (http://en.wikipedia.org/wiki/Stock-keeping_unit) and product model are two completely separate things. basically SKU is an internal number or code assigned by warehouse or retailer to a product; on the other hand product model is a number or code assigned by the manufacturer to the product.
SKU is a unique code within the warehouse/retailer but product model can easily have duplicates as it's unique within manufacturer. e.g. Samsung can choose T30023 as product model for a notebook and HP can choose the same code for a cartridge.

combining them into one field is as wrong as combining LastName/Birthday fields! having them in one field already caused lot's of confusion between uc users as i noticed within forums.

we need to patch the uc core to separate SKU/Model field into SKU and Model fields; and we need to do it carefully as right know uc requires SKU/Model field to be unique (requirement for SKU, 2 products can have the same model) but the machine readable field name is "model"

AttachmentSize
uc_product_patch_ga_01.txt 757 bytes
ga@drupal.org's picture
Offline
Joined: 08/07/2008
Juice: 27
Re: Re: Re: Product view does not show SKU/Model field title

I created a task for separating SKU/Model field here:

http://www.ubercart.org/issue/5969/skumodel_field