Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Just Adding 'From' Before The Prices In Catalog?


mystifier_uk

Recommended Posts

I have a page with my products on here:

 

http://www.clm-ladders.co.uk/shop/catalog/index.php?cPath=21

 

And the prices listed are the lowest price - and when you click on a product you can select the different sizes which have different prices.

 

I want to know how do you put 'from' before the price?

 

So on the link above, it would say 'from £290.23' instead of just '£290.23'

 

Is this possible?

Link to comment
Share on other sites

You would have to code this manually in the pages that have to show the from. For example some code from the catalog/includes/modules/product_listing.php

 

$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

 

would have to be altered in:

$lc_text = 'from ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

 

Note that the price is shown on several pages and in several listings and so you have to change an amount of files like the example above.

Link to comment
Share on other sites

An easier method to use would be to change includes/classes/currencies.php

 

change ..

 

	function display_price($products_price, $products_tax, $quantity = 1) {
  return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}

 

To ..

 

	function display_price($products_price, $products_tax, $quantity = 1) {
  return 'From ' . $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}

 

As you are removing your price from the attribute dropdowns this should be ok. Otherwise you would need to remove the "From" with a str_replace().

Link to comment
Share on other sites

Then I would go with the first suggestion, about adding the text from within the product_info.php page! If you are one step ahead of the game, you would even add a script to have it add "from" only if the product had attributes. If a product has no attributes and thus only one price, why the "from" ;-).

 

In product_info.php you could add:

 

if ($products_attributes['total'] > 1) {

 

to do this. But only go there if you know enough about php :-)

 

Luke

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...