Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding field to product info.php


itsgraham

Recommended Posts

Hi

I am trying to add the product weight so it appears directly under the price on the product info page ( actually I am trying to show the postage but I am using a hack that changed the weight field in the db :) )

 

I know very little about php and am hitting my head against the wall, I am entering variations of <br>$weight after the $price but I either get nothing showing or the code itself.

 

help appreciated :)

Link to comment
Share on other sites

You'll need to check the query to make sure it's pulling the products_weight from the database (I don't think it does on that page) and then echo something like $product_info['products_weight'] where you want the weight to show.

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Link to comment
Share on other sites

Thanks for the reply.

 

<quote>You'll need to check the query to make sure it's pulling the products_weight from the database (I don't think it does on that page)</quote>

 

I think that is the problem, how do i make it do that ?

Link to comment
Share on other sites

In product_info.php is a line that looks something like this:

select p.products_id, p.products_image, p.....

I don't have it in front of me so I'm shooting from the hip here - but find that and add in:

p.products_weight,

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Link to comment
Share on other sites

Change it to this:

<?=$product_info['products_weight']?>

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...