Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to Display FROM Price?


Guest

Recommended Posts

I have searched and searched and searched but cannot find an answer so I do apologise if this question has been asked before, but if it has, I haven't found it.

 

Is there a way to have some of the products showing a price from?

 

For example: From £10.00

 

The reason for this is that as my store is a body jewellery store, some of the jewellery comes in very large sizes and the much larger sizes are more expensive than the smaller ones. I appreciate that I use the products attributes to put on the extra price i.e +1.00 or +10.00 but that only shows up in the attributes drop down menu on the product description page.

 

What I was trying to do was have the product description display a from price for these items.

 

Any help is appreciated.

 

Many thanks

Link to comment
Share on other sites

Really easy.

 

Open up product_info.php and...

 

Step 1: Find these two lines of code (possibly about line 124 and 125):

 

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);

 

Remove them from where they are and replace them underneath this code (about line 18):

 

$product_check = tep_db_fetch_array($product_check_query);

 

So lines 18 to 20 now look like this:

 

$product_check = tep_db_fetch_array($product_check_query);
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);

 

Step 2: Find this piece of code:

 

<?php echo $products_price; ?>

 

and replace with this:

 

<?php if ($products_attributes['total'] > 0) echo TEXT_PRODUCT_PRICE_FROM; ?><?php echo $products_price; ?>

 

Step 3: Open up /includes/languages/english/product_info.php and add this code:

 

define('TEXT_PRODUCT_PRICE_FROM', 'From ');

 

Repeat for any other languages that you use.

 

That should just about do it.

Link to comment
Share on other sites

Could I also ask for your help for something else?

 

Is there a way to make the product attributes in the drop down box on the description page list in a certain way?

 

i.e.

sizes 10

12

14

16

18

for example even though I put the attributes on in that order, in the drop down box they are listed

 

18

16

14

12

10

 

which obviously doesn't look that great (to me anyway).

 

Is there a way to change it please? I've looked in configuration but can't see it there.

Link to comment
Share on other sites

Really easy.

 

Open up product_info.php and...

 

Step 1: Find these two lines of code (possibly about line 124 and 125):

 

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);

 

Remove them from where they are and replace them underneath this code (about line 18):

 

$product_check = tep_db_fetch_array($product_check_query);

 

So lines 18 to 20 now look like this:

 

$product_check = tep_db_fetch_array($product_check_query);
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);

 

Step 2: Find this piece of code:

 

<?php echo $products_price; ?>

 

and replace with this:

 

<?php if ($products_attributes['total'] > 0) echo TEXT_PRODUCT_PRICE_FROM; ?><?php echo $products_price; ?>

 

Step 3: Open up /includes/languages/english/product_info.php and add this code:

 

define('TEXT_PRODUCT_PRICE_FROM', 'From ');

 

Repeat for any other languages that you use.

 

That should just about do it.

 

Sorry but I've just noticed there's a small flaw !!! My fault for not telling you.

Not all attributes have different prices and so the help that you gave is showing From on all products with any attributes. Is there a way to make it so that it only applies to the attributes that have a price increase?

Many thanks

Link to comment
Share on other sites

Could I also ask for your help for something else?

 

Is there a way to make the product attributes in the drop down box on the description page list in a certain way?

 

i.e.

sizes 10

12

14

16

18

for example even though I put the attributes on in that order, in the drop down box they are listed

 

18

16

14

12

10

 

which obviously doesn't look that great (to me anyway).

 

Is there a way to change it please? I've looked in configuration but can't see it there.

 

Found the answer to this one here http://www.oscommerce.com/forums/index.php?showtopic=123629

Link to comment
Share on other sites

Sorry but I've just noticed there's a small flaw !!! My fault for not telling you.

Not all attributes have different prices and so the help that you gave is showing From on all products with any attributes. Is there a way to make it so that it only applies to the attributes that have a price increase?

Many thanks

 

Hey Fallen Angel,

 

Did you come up with a solution to this? That the From would show up on any product with an Attribute.

 

As well, does the "From" show up on pages generated from the index.php page? Cause on mine it doesn't, the "From" only shows up when you click the individual product.

 

Cheers

Link to comment
Share on other sites

Hi zoooooooooom,

 

Your right the "From" does only show up on the product itself, not on the index page.

 

I did get a solution to it in the end but (and your gonna hate this) the email that contained the answer I archived as an xls document (as the my messages says to do) and now I can't read it when I open it!!!!!

Don't know if I need a special programme or not, but when it opens it's just all symbols, quotes etc and is quite unreadable.

If I manage to find something that will open it so I can read it again, I will certainly post it here.

 

Kind regards

Hey Fallen Angel,

 

Did you come up with a solution to this? That the From would show up on any product with an Attribute.

 

As well, does the "From" show up on pages generated from the index.php page? Cause on mine it doesn't, the "From" only shows up when you click the individual product.

 

Cheers

Link to comment
Share on other sites

Hi zoooooooooom,

 

Your right the "From" does only show up on the product itself, not on the index page.

 

I did get a solution to it in the end but (and your gonna hate this) the email that contained the answer I archived as an xls document (as the my messages says to do) and now I can't read it when I open it!!!!!

Don't know if I need a special programme or not, but when it opens it's just all symbols, quotes etc and is quite unreadable.

If I manage to find something that will open it so I can read it again, I will certainly post it here.

 

Kind regards

 

Sounds good.

 

Let me know if you are able to open the email, it would be nice to fix this.

 

Cheers

Link to comment
Share on other sites

I'm sorry zoooooooooom,

 

I have tried everything and it's not working.

 

It seems that Excel opens it but there are stlll lots of symbols and quotes and it seems that the data either isn't all there or didn't save correctly as when I try to read through the symbols, the whole of the message isn't there.

 

Really sorry, I think I learnt a lesson here though - on the oscommerce messaging archive system, always save the files as html documents !!!!!

That's what I'll do in the future, saves losing valuable information when the inbox fills up so quickly.

 

Hopefully somebody might be able to help out with this, but unfortunately, I just can't get in at it.

 

Kind regards

 

Sounds good.

 

Let me know if you are able to open the email, it would be nice to fix this.

 

Cheers

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...