Take the 2-minute tour ×

I want to change the template of my Ubercart products. More in detail, I want to add the label "From..." in front of each price. But I cannot find the template to do it.

I'm also using theme developer module and this is what I get:

zen_uc_product_price < phptemplate_uc_product_price < theme_uc_product_price

But I cannot find such files.


share|improve this question

2 Answers 2

up vote 0 down vote accepted

You can also make a node-product.tpl.php file, if so this is the way to get prices:

    $context = array(
      'type' => 'product',
      'revision' => 'altered', // using altered to get the bare price with no themeing
      'field' => 'sell_price',
      'subject' => array('node' => $node)
    $dp = uc_price($node->sell_price, $context);
    $context['field'] = 'list_price';
    $lp = uc_price($node->list_price, $context);

  <div class="price clear-block <?php if($dp != $lp) print 'discounted'; ?>">
    <?php print 'From: ' . $node->content['display_price']['#value']; ?>
    <?php //print $node->content['list_price']['#value']; ?>

This became a bit more than it should be: Use: content['display_price']['#value']; ?>

Unless you want to theme discounted pricing :-)

Just copied out from one of my projects.

Last: you can probably use theme_uc_product_price: you add a function in template.php (Pasting in default implementation from uc_product.module

function zen_uc_product_price($price, $context, $options = array()) {
  $output = '<div class="product-info '. implode(' ', (array)$context['class']) .'">';
  $output .= uc_price($price, $context, $options);
  $output .= '</div>';

  return $output;

Inspect the $context variable for when to add the "From" part.

share|improve this answer
Here is a tutorial for theming product pages: ubercart.org/forum/development/3868/… , just dont use uc_currency format, uc_price is the right way to do it, especially if you use a price handler as in a multi price module and uc_vat –  Tom Jul 11 '10 at 10:03

To add a prefix or suffix to the price, you can go to /admin/store/settings/store/edit/format

share|improve this answer
where exactly ? This is what I have: dl.dropbox.com/u/72686/price.png . If you meant the field "Current Sign", this doesn't work, because it replaces the currency sign. I just want to add "From:" before it. –  Patrick Jul 10 '10 at 19:58
You just write "From: £" in the currency sign field. –  Tom Jul 11 '10 at 9:24
I cannot do that, because I'm using multi-currency custom module to handle euros and pounds. And I don't want to display "From" in the cart as well. Is there any product php template I can edit ? –  Patrick Jul 11 '10 at 9:29

Your Answer


