Forums / Templates, Stylesheets, Page Layout / New Products on Main Page - How to NOT show product text

New Products on Main Page - How to NOT show product text

Locked

Started by ecomanuk on 23 Oct 2009, 3:25 PM · Views: 2,298

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
23 Oct 2009, 3:25 PM
#1
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

New Products on Main Page - How to NOT show product text

Appreciate any ideas and help please.

I would like new products to just show basic information e.g. name, image, price when listed at the bottom of the main page. There is a setting in admin that achieves this exactly for when a user clicks the New Products category however when a user arrives at the main page and sees the New Products for ... they get all the product description text as well as the basic info.

Images attached should explain better.

Thanks

Mainpage

Hoping for something more like

23 Oct 2009, 3:52 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: New Products on Main Page - How to NOT show product text

I think you can turn off the Product Description in Admin - Configuration - New Listing.

If it were me, I'd also turn off the Date Added.

23 Oct 2009, 3:58 PM
#3
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

Thanks for trying to help. Unfortunately I have done that and indeed it does help for New Products category as shown in one of the images I posted but not for the way it displays on the bottom of the Main page.

26 Oct 2009, 12:15 PM
#4
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

Any more ideas anyone please?

26 Oct 2009, 2:43 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: New Products on Main Page - How to NOT show product text

That looks more like a customization to your template for the New Products centerbox rather than the New Products Listing ...

As that is not part of Zen Cart, by default, you will have to see what changes have been made to the centerboxes ... if that is what your image is ... it is hard to say for 100% certain from an image rather than an URL to your site ...

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!

26 Oct 2009, 2:58 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

In a stock install, the "New Products For" box displays only image, title and price. Your template has apparently hard-coded another display, so we can't help without seeing the site live. Parts of your template will probably need to be recoded; the template maker will know best how to do this.

28 Oct 2009, 10:31 AM
#7
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

Thanks for more thoughts.

As the template make does not know how this has come about or how to rectify. Could someone point me in the direction of the files that effect what is displayed for New products in the context of the main page please?

28 Oct 2009, 4:07 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

Your home page is probably using /includes/templates/your_template/templates/tpl_index_default.php, though we can't know for sure without seeing your site live.
That file calls /includes/templates/your_template/templates/tpl_modules_whats_new.php, which then calls other files to do the processing.

29 Oct 2009, 10:36 AM
#9
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

Thanks for those thoughts.

I have looked at the sequence of files and it seems to lead on a trail that starts with

tpl_index_default.php which refers to a file called
tpl_modules_whats_new.php which in turn seems to refer to a file called
tpl_columnar_display.php which is where the trail appears to end. I have pasted it below. Is this the file to amend to get the desired output, and if so any ideas what to change please?

<?php /** * Common Template - tpl_columnar_display.php * * This file is used for generating tabular output where needed, based on the supplied array of table-cell contents. * * @package templateSystem * @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: tpl_columnar_display.php 3157 2006-03-10 23:24:22Z drbyte $ */ ?> <?php if ($title) { ?> <?php echo $title; ?> <?php } ?> <?php if (is_array($list_box_contents) > 0 ) { for($row=0;$row<sizeof($list_box_contents);$row++) { $params = ""; //if (isset($list_box_contents[$row]['params'])) $params .= ' ' . $list_box_contents[$row]['params']; ?> <?php for($col=0;$col<sizeof($list_box_contents[$row]);$col++) { $r_params = ""; if (isset($list_box_contents[$row][$col]['params'])) $r_params .= ' ' . (string)$list_box_contents[$row][$col]['params']; if (isset($list_box_contents[$row][$col]['text'])) { ?>
<?php echo '<div' . $r_params . '>' . $list_box_contents[$row][$col]['text'] .  '</div>' . "\n"; ?>
<?php } } ?> <br class="clearBoth" /> <?php } } ?>
29 Oct 2009, 3:08 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

/includes/modules/your_template/new_products.php is where the centerbox content is created```php
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_NEW_PRODUCTS));

29 Oct 2009, 3:34 PM
#11
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

I can only find the following....Is this a standard one for all zen installs. Or has it been altered to stop it displaying New products correctly on the main page, do you think?

<?php
/**
 * new_products.php module
 *
 * @package modules
 * @copyright Copyright 2003-2007 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 6424 2007-05-31 05:59:21Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

// initialize vars
$categories_products_id_list = '';
$list_of_products = '';
$new_products_query = '';

$display_limit = zen_get_new_date_range();

if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
  $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and   p.products_status = 1 " . $display_limit;
} else {
  // get all products and cPaths in this subcat tree
  $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit);

  if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
    // build products-list string to insert into SQL query
    foreach($productsInCategory as $key => $value) {
      $list_of_products .= $key . ', ';
    }
    $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                  p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_id in (" . $list_of_products . ")";
  }
}

if ($new_products_query != '') $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_query == '') ? 0 : $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']);
    if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_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']), 'cPath=' . $productsInCategory[$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']), 'cPath=' . $productsInCategory[$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;
  }
}
?>
29 Oct 2009, 3:47 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

What is the exact folder path to this file (from /includes/)? It appears to be stock, as there is no provision in it for outputting the description. Some other file must be active. Can we see your site?

What does the include at the top of your /includes/templates/your_template/templates/tpl_modules_whats_new.php look like? If it calls the new products listing module file, that would be the problem.

29 Oct 2009, 3:54 PM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

TM could have redefined FILENAME_NEW_PRODUCTS to point to the listing file instead of the centerbox file. In Tools > Developers Toolkit, paste FILENAME_NEW_PRODUCTS in the lower left box, select all files and search. Among the results will be the file and line number where it is defined. If there is more than one, post them both.

30 Oct 2009, 9:44 AM
#14
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

includes/filenames.php

Line #173 : define('FILENAME_NEW_PRODUCTS', 'new_products.php');

includes/templates/template_default/templates/tpl_modules_whats_new.php

Line #11 : include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_NEW_PRODUCTS));

includes/templates/template_default/templates/tpl_product_info_noproduct.php

Line #49 : include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_NEW_PRODUCTS));

Thanks for perservering and trying to help me reach a solution.

30 Oct 2009, 9:58 AM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

OK, FILENAME_NEW_PRODUCTS points to the stock version of the standard file... so the problem is somewhere else.
(What is the folder path to your new_products.php?)

There do not seem to be any template overrides for the centerbox, yet you are getting non-standard display. We really need to see your site live to have a chance of helping more.

30 Oct 2009, 10:26 AM
#16
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

Not sure if this helps but this is the css information relating to the product description text that's appearing on Main Page under the new products. This is the product description text that I dont want to see at all.

html > body #indexBody > div #mainWrapper > div .main_cont_c > div .main_cont > table #contentMainWrapper > tbody > tr> td > div .main_indent > div #indexDefault .centerColumn > div #whatsNew .centerBoxWrapper > div .centerBoxContentsNew centeredContent back > div .product_list > div .right > div .margin > div .text

I will investigate (What is the folder path to your new_products.php?) and post response.

30 Oct 2009, 10:42 AM
#17
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

Folder path to new_products.php is

includes/modules/new_products.php

30 Oct 2009, 3:11 PM
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

The CSS info proves, if the screenshot detail didn't, that you have a Template Monster template. Apparently they have set up a parallel file or group of files with different names to do the job (so the files we have been looking at sit unused), and it will be impossible for us to help without actually seeing your site live and probably looking at more of your files. This is really a question you need to ask TM; they should support the product they sold you at least to the extent of telling you which files they used.

You may be able to satisfactorily hide the text by adding to one of your stylesheets```
.centerBoxContentsNew .text {display: none;}

30 Oct 2009, 4:03 PM
#19
ecomanuk avatar

ecomanuk

New Zenner

Join Date:
Oct 2009
Location:
United Kingdom
Posts:
10
Plugin Contributions:
0

Re: New Products on Main Page - How to NOT show product text

A VERY BIG THANKYOU

.centerBoxContentsNew .text {display: none;} in the css solved the problem perfectly.

Just for the record the template maker was very unhelpful ( I have tried not to say too much in this thread as I don't like speaking badly of others) hence me turning to the forum for help or at least pointing me in the right direction.

I appreciate the patience and hope this thread may help others in a similar plight.

For the record the template was theme 054.

30 Oct 2009, 5:04 PM
#20
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: New Products on Main Page - How to NOT show product text

Glad it's taken care of now:)
Of course, if you had let us see the site when it was first requested four days ago in post #5, we could have given at least that answer immediately. If there is a reason you can't or won't show us the site, it would have been nice to say so.