Forums / Templates, Stylesheets, Page Layout / Show product description on main-page?

Show product description on main-page?

Locked

Views: 19,523

Results 41 to 60 of 67
This thread is locked. New replies are disabled.
1 Sep 2010, 7:22 PM
#41
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Show product description on main-page?

Ajeh:

Make sure you are addressing the right code ...

The Centerbox for the New Products is different than the New Products page ...

In the module:
/includes/modules/new_products.php

you would copy to your templates and overrides directory ...

Then you need to customize the code ...

First, the two select statements:

$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, pd.products_description
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;

> 
> ```
    $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, pd.products_description
                           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
                           and p.products_id in (" . $list_of_products . ")";

Then, to display the description cleanly, you can use:

$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 . '<br>' . zen_trunc_string(zen_clean_html(stripslashes($new_products->fields['products_description']))) );

Thanks for all your help,

I have done all that and it still dosnt show the descriptions, i am also trying to edit the file so that the main page shows the define_main_page, it seems that this coding is "unedit" friendly.
1 Sep 2010, 11:52 PM
#42
ajeh avatar

ajeh

Oba-san

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

Re: Show product description on main-page?

I am not sure what to tell you on why this would not work, as it works perfectly fine for me ... :unsure:

What happens if you switch to the Classic Template ... and put this code into a clean copy of:
new_products.php

and load it to:
/includes/modules/classic/new_products.php

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!

1 Sep 2010, 11:53 PM
#43
ajeh avatar

ajeh

Oba-san

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

Re: Show product description on main-page?

Delights:

i am also trying to edit the file so that the main page shows the define_main_page, it seems that this coding is "unedit" friendly.

I am not sure what you are trying to say/ask here ...

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!

2 Sep 2010, 5:56 AM
#44
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Show product description on main-page?

Delights:

Thanks for all your help,

I have done all that and it still dosnt show the descriptions, i am also trying to edit the file so that the main page shows the define_main_page, it seems that this coding is "unedit" friendly.

I tired it on the Basic template and the index stopped loading about 1/2 way through loading.

2 Sep 2010, 5:58 AM
#45
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Show product description on main-page?

Ajeh:

I am not sure what you are trying to say/ask here ...

I was trying to get the Main_Page_Defined to come up on the main page. However ever with help from some of the other members it seems as the Template is very heavy modified and seems like it is very very hard to edit.

Maybe that is why they want to charge me $50 to edit the template.....

2 Sep 2010, 3:06 PM
#46
ajeh avatar

ajeh

Oba-san

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

Re: Show product description on main-page?

Delights:

I tired it on the Basic template and the index stopped loading about 1/2 way through loading.

Sounds like you have an error on the:
new_products.php

so the page cannot complete ...

If you look in your /cache directory you should see the debug logs and if you open and read the errors it will help with the problem ...

Check your code in the:
/includes/modules/your_template_dir/new_products.php

It should read:

<?php
/**
 * new_products.php module
 *
 * @package modules
 * @copyright Copyright 2003-2008 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 8730 2008-06-28 01:31:22Z drbyte $
 */
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, pd.products_description
                           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, pd.products_description
                           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
                           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 . '<br />' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($new_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) );

    $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;
  }
}
?>

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!

7 Sep 2010, 3:07 PM
#47
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

Hello, I just installed the modern zentemplate and I am trying to figure out how to enable or install additional menu (Product Description,Features,Specification,FAQ,Reviews)under the product info as seen in this example.
http://www.dealport.co.uk/index.php?main_page=product_info&cPath=0&products_id=3

Any help would be truly appreciated.

Thank You,
djace

Sucess is the Sum of Small Efforts

7 Sep 2010, 4:56 PM
#49
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

Thank You for the hint. I will definetly try Tabbed Products Pro.
Do you know by any chance how or where do I modify the main_page in this template. The regular admin main page seems to be not working.

Thanks in advance,
djace

Sucess is the Sum of Small Efforts

8 Sep 2010, 1:29 PM
#50
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

I got the tabbed products working.
Thank You again.
Does anyone knows where do I modify the main_page so it shows a welcome message below a flash?
Thank You.

djace

:clap:

Sucess is the Sum of Small Efforts

8 Sep 2010, 1:54 PM
#51
gjh42 avatar

gjh42

Black Belt

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

Re: Show product description on main-page?

Editing define_main_page.php, either in Define Pages Editor or in a text editor on your computer, will work if your template hasn't been customized to disable the function. We can't even begin to guess where your problem is without seeing your site live.

8 Sep 2010, 2:27 PM
#52
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

Hello, in admin page_define seems to be not working correctly.

What I am trying to somehow enable the welcome text on my main page right below the flash that can be seen in the demo http://phuong.ridevelopement.com/ri-0007/
It starts with :
"Hello and welcome. This is define main page

You are viewing the demo of the template RubikIntegration007 proudly brought to you by RubikIntegration.com

Please note that our demo uses some of the modules that are NOT included in the template package. The Banner Rotator mod above, for example, is not in the package....."

The web site is work in progress and can be seen at:
https://www.savedirectnow.com

In addition, I am trying to disable the product description under "New Products for September" section.

Thank you in advance,
djace

Sucess is the Sum of Small Efforts

8 Sep 2010, 2:41 PM
#54
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

Here is the entire contect of the file. It says on the top to define the page content. however I am nt sure where since I am fairly new to this.
Any help would be appreciated.

djace

<?php /** * Page Template * * Main index page<br /> * Displays greetings, welcome text (define-page content), and various centerboxes depending on switch settings in Admin<br /> * Centerboxes are called as necessary * * @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_index_default.php 3464 2006-04-19 00:07:26Z ajeh $ */ ?> <div class="centerColumn" id="indexDefault"> <h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1> <?php if (SHOW_CUSTOMER_GREETING == 1) { ?> <h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2> <?php } ?> <!-- deprecated - to use uncomment this section <?php if (TEXT_MAIN) { ?> <div id="" class="content"><?php echo TEXT_MAIN; ?></div> <?php } ?>--> <!-- deprecated - to use uncomment this section <?php if (TEXT_INFORMATION) { ?> <div id="" class="content"><?php echo TEXT_INFORMATION; ?></div> <?php } ?>--> <div id="bannersWrapper" class="unitPng"> <div id="bannersInnerWrapper"> This banner section is located in tpl_index_default.php </div> </div> <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?> <?php /** * get the Define Main Page Text */ ?> <div id="indexDefaultMainContent" class="content"> <div id="indexDefaultContent"> <?php require($define_page); ?> </div> </div> <?php } ?> <?php $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN); while (!$show_display_category->EOF) { ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS') { ?> <?php /** * display the Featured Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_SPECIALS_PRODUCTS') { ?> <?php /** * display the Special Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_NEW_PRODUCTS') { ?> <?php /** * display the New Products Center Box */ ?> <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?> <?php } ?> <?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_UPCOMING') { ?> <?php /** * display the Upcoming Products Center Box */ ?> <?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS)); ?><?php } ?> <?php $show_display_category->MoveNext(); } // !EOF ?> </div>

Sucess is the Sum of Small Efforts

8 Sep 2010, 3:09 PM
#55
gjh42 avatar

gjh42

Black Belt

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

Re: Show product description on main-page?

The code is just as it should be, which means that you have some setting wrong, or you are not getting edits to the right place for some reason.

Which folder path is that file in?

8 Sep 2010, 3:12 PM
#56
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

The file is located in :
includes/templates/RI_TEMPLATE_07/templates/tpl_index_default.php

djace

Sucess is the Sum of Small Efforts

8 Sep 2010, 3:21 PM
#58
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

I believe so. I do notice if you go to my savedirectnow.com domain name and do right mouse click and select "view Source" you can see that the actual code is not the same.
I wonder what file that is?
djace

Sucess is the Sum of Small Efforts

8 Sep 2010, 3:26 PM
#59
gjh42 avatar

gjh42

Black Belt

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

Re: Show product description on main-page?

The PHP code will not show in view source, only the HTML that it generates. Something is telling the code to not display the define page content.

8 Sep 2010, 3:34 PM
#60
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Re: Show product description on main-page?

Oh I see. I think that you are right. Something I am not editing correctly. Even though If I put my flash code into this file it works just fine. So yes, this tpl_index_default is the nain controlling file.
I do notice that my generated html code that we can see from view source does not show the text around line 188. where on that demo store site it does. It is almost as if I am not making edits on the right file.

Sucess is the Sum of Small Efforts