String Override
Hi,
I am setting up a multi-lingual ubercart store and i am having a hard time finding out how i can edit the price labels in the product page.
What i am refering to is the list price and sell price, which are called in node-product.tpl.php as follows:
<?php print $uc_list_price; ?>
<?php print $uc_sell_price; ?>
I would like to change "List price" to "Shop price" and "Sell price" to "Buy online".
I was able to do this successfully for a single language system by replacing the above 2 lines by:
Shop price: <?php print uc_currency_format($node->list_price); ?>
Buy online: <?php print uc_currency_format($node->sell_price); ?>
However, since i have multiple languages, my best bet is to go the stringoverrides module way. I was able to override the t('List price') and t('Sell price') in other parts of the website, but i cannot find the string that $uc_list_price and $uc_sell_price are refering to.
I have searched in multiple files to find that string, but no luck yet. Any pointers?
Cheers,
Simon
Tags:
Hi,
I am setting up a multi-lingual ubercart store and i am having a hard time finding out how i can edit the price labels in the product page.
What i am refering to is the list price and sell price, which are called in node-product.tpl.php as follows:
<?php print $uc_list_price; ?>
<?php print $uc_sell_price; ?>
I would like to change "List price" to "Shop price" and "Sell price" to "Buy online".
I was able to do this successfully for a single language system by replacing the above 2 lines by:
Shop price: <?php print uc_currency_format($node->list_price); ?>
Buy online: <?php print uc_currency_format($node->sell_price); ?>
However, since i have multiple languages, my best bet is to go the stringoverrides module way. I was able to override the t('List price') and t('Sell price') in other parts of the website, but i cannot find the string that $uc_list_price and $uc_sell_price are refering to.
I have searched in multiple files to find that string, but no luck yet. Any pointers?
Cheers,
Simon
i found a solution, looks like it's working.
In node-product.tpl.php, i change the lines:
<?php print $uc_list_price; ?>
<?php print $uc_sell_price; ?>
for these lines:
<?php print t('List price'); ?>: <?php print uc_currency_format($node->list_price); ?>
<?php print t('Sell price'); ?>: <?php print uc_currency_format($node->sell_price); ?>
Works for me! Is there something semantically bad with this?
Simon
Sorry Simon, I didn't notice that there was an additional question here at first - just that you solved it.
That method is fine and I'll probably do it similarly in the Drupal 7 update. The variables in node.tpl.php were being setup in template.php - and to be honest, I'm not sure why I chose to do it that way at the time - in retrospect it seems a bit unnecessary, though I guess using the variables looks a bit cleaner? I'm a better designer than programmer. ;)



