Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product description with product listing


trout

Recommended Posts

Posted

Hello,

 

Is it possible to have the products description along with the actual products listing? As in you don't have to click on the product to go to another screen to display the description - you just get to see it on the actual products listing page.

 

I know this will probably take up a lot more room as is, but would be preferable for me.

 

Thanks for any answer.

 

trout.

Posted
Hello,

 

Is it possible to have the products description along with the actual products listing? As in you don't have to click on the product to go to another screen to display the description - you just get to see it on the actual products listing page.

 

I know this will probably take up a lot more room as is, but would be preferable for me.

 

Thanks for any answer.

 

trout.

 

In index.php look for the following:

 

$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                           'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                           'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                            'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                           'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                           'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                           'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                           'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 

Add the product_desctiption field to this array. This will tell osC to select the description field as well when it retrieves the data. Change this as follows:

 

$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                           'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                           'PRODUCT_LIST_DESCRIPTION' => PRODUCT_LIST_DESCRIPTION,
                           'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                            'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                           'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                           'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                           'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                           'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 

Now that it's defined you need to update the switch so it adds the SQL code. Replace this code:

 

switch ($column_list[$i]) {
case 'PRODUCT_LIST_MODEL':
 $select_column_list .= 'p.products_model, ';
 break;
case 'PRODUCT_LIST_NAME':
 $select_column_list .= 'pd.products_name, ';
 break;
case 'PRODUCT_LIST_MANUFACTURER':
 $select_column_list .= 'm.manufacturers_name, ';
 break;
case 'PRODUCT_LIST_QUANTITY':
 $select_column_list .= 'p.products_quantity, ';
 break;
case 'PRODUCT_LIST_IMAGE':
 $select_column_list .= 'p.products_image, ';
 break;
case 'PRODUCT_LIST_WEIGHT':
 $select_column_list .= 'p.products_weight, ';
 break;
}

 

With the following:

 

switch ($column_list[$i]) {
case 'PRODUCT_LIST_MODEL':
 $select_column_list .= 'p.products_model, ';
 break;
case 'PRODUCT_LIST_NAME':
 $select_column_list .= 'pd.products_name, ';
 break;
case 'PRODUCT_LIST_DESCRIPTION':
 $select_column_list .= 'pd.products_description, ';
 break;
case 'PRODUCT_LIST_MANUFACTURER':
 $select_column_list .= 'm.manufacturers_name, ';
 break;
case 'PRODUCT_LIST_QUANTITY':
 $select_column_list .= 'p.products_quantity, ';
 break;
case 'PRODUCT_LIST_IMAGE':
 $select_column_list .= 'p.products_image, ';
 break;
case 'PRODUCT_LIST_WEIGHT':
 $select_column_list .= 'p.products_weight, ';
 break;
}

 

That's the easy part. You now need to modify the display portion of it so the description shows in the list. There's probably a number of ways you could possibly do this. You can modify the way this appears in includes/modules/product_listing.php.

 

I don't have the time right now to update it for you, but the file isn't too big and shouldn't be too difficult to modify to have it display the way you want it to.

Posted

perhaps you might want to consider one of the product description listing contributions!

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

I use one that gives a short (first dozen words or so) description so it doesn't take up a ton of room. You could also tweak the font size to bring down the size. The contribution I use is called Description in Product Listing v2.5 and it isn't easy to load into your files, but I think it is worth the effort.

Archived

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

×
×
  • Create New...