Forums / Setting Up Categories, Products, Attributes / Product Description on front page

Product Description on front page

Locked

Views: 4,651

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
23 Dec 2006, 2:10 PM
#1
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Product Description on front page

How can i add the product description on the front page where my new products added and my featured products are? Also how can i extend the product title length if you look some of the tiltes are long and they get cut off where can i adjust this? https://www.wonderfultoyz.com

EDIT: WARNING: Adult Site ...

30 Dec 2006, 2:15 PM
#2
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

Can anyone help with this?

30 Dec 2006, 2:30 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Description on front page

The easiest method would be to use a function to get this:

zen_get_products_description($product_id, $_SESSION['languages_id'])

Note: due to the nature of products_description field and its contents it is best cleaned before displaying it ...

zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($products_id, $_SESSION['languages_id']))), 150)

Where products_id would be the known products_id where you are trying to display the products description ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Dec 2006, 2:47 PM
#4
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

im not that good where i know what and where i make these changes im sorry can u explain a little more for ajeh?

30 Dec 2006, 2:52 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Description on front page

And example would be on the:
/includes/modules/new_products.php

copy to your templates and overrides directory:
/includes/modules/your_template_dir/new_products.php

Find the line for:

    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);

And change to:

    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))), 150));

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Dec 2006, 3:03 PM
#6
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

did not work.....Parse error: syntax error, unexpected T_IF in /home/wonderf/public_html/includes/modules/new_products.php on line 1

30 Dec 2006, 3:09 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Description on front page

Check around line 1 for spaces, blank lines, missing <?php ... or other assorted errors ...

Or, start again ... you have a typo ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Dec 2006, 3:11 PM
#8
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

i copied exactly what you said to replace with>

'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))), 150));

30 Dec 2006, 4:33 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Description on front page

To make sure that there is no confusion, here is the code with the code before and after it:

    $products_price = zen_get_products_display_price($new_products->fields['products_id']);

    $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);

    $col ++;

This is changed to:

    $products_price = zen_get_products_display_price($new_products->fields['products_id']);

    $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))), 150));

    $col ++;

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Dec 2006, 5:10 PM
#10
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

i appreciate your help but everything you tell me dosent work i copied everything you told me and it will not work

30 Dec 2006, 5:21 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Description on front page

You copied the file:
/includes/modules/new_products.php

/includes/modules/sophyblue/new_products.php

And made the changes and loaded it to your site ... correct?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Dec 2006, 9:31 PM
#12
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

i dont have anything in /includes/modules/sophyblue/new_products.php

its empty

31 Dec 2006, 12:01 AM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Description on front page

Put back the original file from the Zen Cart zip for:
/includes/modules/new_products.php

Make sure it is working correctly ...

Now, you want to make a copy of that file to:
/includes/modules/sophyblue/new_products.php

And make your changes to it so that it will not be overwritten on your next upgrade ...

What the change should do, is when you have a product with a description, it should show the normal new product info in the Centerbox and the products_description ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 Dec 2006, 3:28 PM
#14
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

ok i put a copy of my new products.php in modules/sophyblue but i still have the problem of the title getting cut off and i want the description on the front page under new products and featured products

8 Jan 2007, 12:33 AM
#15
hondauser85 avatar

hondauser85

Zen Follower

Join Date:
Apr 2005
Posts:
95
Plugin Contributions:
0

Re: Product Description on front page

here is my new_products.php file................

<?php /** * new_products.php module * * @package modules * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: new_products.php 4629 2006-09-28 15:29:18Z ajeh $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } // display limits //$display_limit = zen_get_products_new_timelimit(); $display_limit = zen_get_new_date_range(); if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_date_added from " . TABLE_PRODUCTS . " p where p.products_status = 1 " . $display_limit; } else { $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_date_added, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = 1 " . $display_limit; } $new_products = $db->ExecuteRandomMulti($new_products_query, MAX_DISPLAY_NEW_PRODUCTS); $row = 0; $col = 0; $list_box_contents = array(); $title = ''; $num_products_count = $new_products->RecordCount(); // show only when 1 or more if ($num_products_count > 0) { if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS == 0 ) { $col_width = floor(100/$num_products_count); } else { $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS); } while (!$new_products->EOF) { $products_price = zen_get_products_display_price($new_products->fields['products_id']); $new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']); $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price); $col ++; if ($col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 1)) { $col = 0; $row ++; } $new_products->MoveNextRandom(); } if ($new_products->RecordCount() > 0) { if (isset($new_products_category_id) && $new_products_category_id != 0) { $category_title = zen_get_categories_name((int)$new_products_category_id); $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '' ) . '</h2>'; } else { $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . '</h2>'; } $zc_show_new_products = true; } } ?>
10 Feb 2008, 8:58 AM
#16
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Product Description on front page

Ajeh:

To make sure that there is no confusion, here is the code with the code before and after it:

This is changed to:

$products_price = zen_get_products_display_price($new_products->fields['products_id']);

$new_products->fields['products_name'] = zen_get_products_name($new_products->fields['products_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))), 150));

$col ++;
Code change works fine ajeh, could you please amend so that there is break/space after products price please?

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

10 Feb 2008, 9:53 AM
#17
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Product Description on front page

could you please amend so that there is break/space after products price please?
Sorted..
i.e.

. $products_price . '<br />'

Dezina ZenCart Templates
Please do not PM for support queries..Post in forums..help others

21 Jul 2008, 10:39 AM
#18
thetankgirl avatar

thetankgirl

New Zenner

Join Date:
Jul 2005
Posts:
33
Plugin Contributions:
0

Re: Product Description on front page

Is it possible to have a row for each product in the ' new products' area?
Can I add an <tr></tr> somewhere?
Thanks in advance!

24 Jul 2008, 2:57 PM
#19
ben_harry avatar

ben_harry

Zen Follower

Join Date:
Mar 2007
Location:
Cornwall - uk
Posts:
462
Plugin Contributions:
0

Re: Product Description on front page

I tried this and it also didnt work for me. Im still getting half my title cut off. Any Idea's?