CRE Loaded templates, osCommerce templates, Zen Cart themes - WebArt4U.com - Articles and tutorials to manage and administer your cre loaded oscommerce store. - Tip & Tricks - Short Product Description for Product Listing
website templates CRE Loaded Template oscommerce template
zen cart template   WebArt4u.com - Home  Services  Portfolio cre loaded b2b  My Account  Tips & Tricks  Contact Info
cre

 

Categories
Templates
Contributions
Free Stuff
CRE Loaded Templates
osCommerce Templates
Zen Cart Templates
CRE Loaded Ecommerce
cre

 

Information
Links
Sitemap
Contact Us
 
Shipping and Returns
Privacy Policy
Warranties
Services
Donate
Terms of Use
cre
cre
 Short Product Description for Product Listing  by Kiran

Many times this has been asked how to get short desciption for product listing. Here it is in simple steps.

Note: Besure to backup your files before making any changes.

1. Copy piece of code in includes/function/general.php

// product description
function tep_get_products_description($product_id, $language = '') { global $languages_id; if (empty($language)) $language = $languages_id; $product_query = tep_db_query("select products_description from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'"); $product = tep_db_fetch_array($product_query); return $product['products_description'];
}
// end product description

2. Modify templates/TEMPLATE_NAME/mainpage_modules/new_products.php

Find,
while ($new_products = tep_db_fetch_array($new_products_query)) {

Add below it,
$new_products_description = tep_get_products_description($new_products['products_id']);

Find,
$new_products['products_name'] . '<br>' . $products_price);

Modify like below,
$new_products['products_name'] . '<br>' . $products_price . '' . preg_replace('/sS*$/i', '', substr($new_products_description, 0, 200)) . '...');

* In above mod, I am setting product description to first 200 charecters. If you need more charecters, change 200 to required value.

Note: Do not use, short description, if you are using tables, many formatted text in product desciption, that will damage layout.

For support post your queries in CRE Loaded Forums

cre
cre
cre

    Copyright 2008 WebArt4U.com. All rights reserved.  Chain Reaction Web   CRELoaded 6.15  Ecommerce Developers   


CRE Loaded Hosting 62_234x60_banner