Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / New products on home page - where's the php code inside tpl_header?

New products on home page - where's the php code inside tpl_header?

Views: 1,847

Results 1 to 7 of 7
8 Jun 2011, 12:22 PM
#1
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

New products on home page - where's the php code inside tpl_header?

I'd like to display our new products on the home page. However, the tpl_header page is from a modified template, so I can't just get them to show via the admin>config>index listings. I've been looking inside tpl_header code but am not sure ... could someone have the kindness to let me know what's the code, from the tpl_header (template_default) that shows the new products on the home page?

8 Jun 2011, 12:26 PM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: New products on home page - where's the php code inside tpl_header?

tpl_header controls the header. What exactly are you trying to do? New products should automatically display on the home page.

9 Jun 2011, 6:18 AM
#3
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: New products on home page - where's the php code inside tpl_header?

Show New Products on Main Page is set to 1 in the admin but the new products do not display on the home page. Here's the site ezistock dot com

9 Jun 2011, 6:36 AM
#4
misty avatar

misty

Inactive

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

Re: New products on home page - where's the php code inside tpl_header?

Try
/includes/templates/nameofyourtemplate/templates/tpl_index_default.php

9 Jun 2011, 7:33 AM
#5
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: New products on home page - where's the php code inside tpl_header?

thanks Misty! I was actually just looking at it as well as tpl_index_categories.

The only difference from the 2 original templates is the code in red:

<?php?>
<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 } ?>-->

<?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"><?php require($define_page); ?></div>
<?php } ?>


[B]<?php if (!$this_is_home_page) { ?>[/B]


<?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
?>

[B]<?php } ?>[/B]

</div>

Removing do the trick, but would it be safe to remove it permanently?

9 Jun 2011, 1:10 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: New products on home page - where's the php code inside tpl_header?

Yes, it would be safe to remove the red code. Just be sure to remove both parts so you don't have an extra }.

10 Jun 2011, 10:16 AM
#7
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: New products on home page - where's the php code inside tpl_header?

gjh42:

Yes, it would be safe to remove the red code. Just be sure to remove both parts so you don't have an extra }.

Thanks!