Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding extra fields in product listing


peterpil19

Recommended Posts

Hi,

 

I would like to display more information about the products which are listed when you click on a category. Currently the products are listed displaying name, price, image, description. 

 

I have worked out that product_listing.php is the relevant file.

 

I have not had much success trying to replicate the code which relate to product description or product name and referencing them to other product fields in the products table.

$prod_list_contents .= '      <p class="group inner list-group-item-text" itemprop="description">' . strip_tags($listing['products_description'], '<br>') . '…</p><div class="clearfix"></div>';
 

For example, the above code displays the product description which is in the products_description table.

How do I change it to display instead, say the product's weight which is in the products table?

Changing 'Products_Description' to e.g. "Products_weight' in the above has no effect.

 

Thanks,

 

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

Thanks,

 

Any tips if I want to use a custom field I've added myself to the products table, do I have to define it anywhere?

 

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

@@peterpil19,

 

you have to add them to the sql queries in index.php.

search for:

$listing_sql = "select.....

Link to comment
Share on other sites

@@peterpil19,

 

you have to add them to the sql queries in index.php.

search for:

$listing_sql = "select.....

 

Thank you so much!

Cannot believe it was that simple.

Don't know how I missed looking in index.php

 

Perfect!

 

 

 

 

 

@@peterpil19

 

There's an add-on for that: Extra Product Fields for osCommerce 2.3

 

Take care

Bill

 

Thanks Bill, I've added my own fields manually, which wasn't too hard, otherwise would look at that contribution.

 

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...