Forums / Templates, Stylesheets, Page Layout / move specials above main page editor

move specials above main page editor

Results 1 to 20 of 21
12 Apr 2007, 21:09
#1
jford avatar

jford

Zen Follower

Join Date:
Mar 2006
Posts:
162
Plugin Contributions:
0

move specials above main page editor

I have been trying to move the specials on the home page of the store above the area where the define_main_page text goes. I have looked at a few other threads and have moved things around in the tpl_index_default.php page and it either removes the main page text or removes it all. Can someone please help me? The domain is: concealmentindustries.com/catalog

Thanks in advance!
12 Apr 2007, 22:28
#2
tmc_sherpa avatar

tmc_sherpa

Zen Follower

Join Date:
Mar 2007
Posts:
158
Plugin Contributions:
0

Re: move specials above main page editor

I can tell you what its doing, but I haven't quite figured out how to fix it....

there is a loop going on after it checks a database to see what should be displayed on the page, so moving the code for special products to be before the main page text breaks it as it does not have access to the db to see if it should be displayed or not.

moving the display main text to below it in the code results in it being displayed several times as the code loop executes.
so.....if your sure you will never ever want to turn it off from admin......

cut

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


and paste

<?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>


somewhere above

<!-- deprecated - to use uncomment this section
<?php if (TEXT_MAIN) { ?>
<div id="" class="content"><?php echo TEXT_MAIN; ?></div>
<?php } ?>-->
12 Apr 2007, 22:45
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: move specials above main page editor

What you want to end up with is the code in blue before the code in red
<div class="centerColumn" id="indexDefault">
<h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

<?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_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 } ?>
12 Apr 2007, 23:22
#4
tmc_sherpa avatar

tmc_sherpa

Zen Follower

Join Date:
Mar 2007
Posts:
158
Plugin Contributions:
0

Re: move specials above main page editor

kobra:

What you want to end up with is the code in blue before the code in red
<div class="centerColumn" id="indexDefault">
<h1 id="indexDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

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

blah 
blah 
blah


except the database doesn't get read until

<?php
  $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
  while (!$show_display_category->EOF) {
?>


which is after the TEXT_MAIN, which is why I chopped out the if{} statement
12 Apr 2007, 23:31
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: move specials above main page editor

I see this??? Did you try it??

I have successfully moved "Featured" and above the db query so it functioned in my case...but it would not be difficult to place this above the specials.
<?php
  $show_display_category = $db->Execute(SQL_SHOW_PRODUCT_INFO_MAIN);
  while (!$show_display_category->EOF) {
?>
12 Apr 2007, 23:46
#6
tmc_sherpa avatar

tmc_sherpa

Zen Follower

Join Date:
Mar 2007
Posts:
158
Plugin Contributions:
0

Re: move specials above main page editor

I didn't try to move the db check above it but I did attempt to move the TEXT_MAIN down below, the loop gets called I think 4 times so it just repeated the text block over and over. when I tried moving the whole chunk (with the if block)I don't think it got executed but I was doing my testing with future releases.
*shrug* what ever works
27 Aug 2008, 14:20
#7
gsdcypher avatar

gsdcypher

Totally Zenned

Join Date:
Feb 2007
Posts:
816
Plugin Contributions:
0

Re: move specials above main page editor

I tried moving this code to display the specials box at the top of the main page. but it did not move the specials up and it placed the main page image and text on the main page 3 times...

<?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_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_CUSTOMER_GREETING == 1) { ?>
<h2 class="greeting"><?php echo zen_customer_greeting(); ?></h2>
<?php } ?>


any ideas on what to try next to get the specials to appear at the top of the main page?

thanks.
07 Sep 2008, 16:17
#8
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: move specials above main page editor

this is weird after i went and reset store manager the featured center box is now below defined main page text again, nothing changed in the code

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

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


it doesn't make sense
07 Sep 2008, 16:23
#9
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: move specials above main page editor

gsdcypher i see it wasn't working for you to start out with! damb everything was perfect until i reset the store because of the catagory changes i was making
09 Sep 2008, 13:19
#10
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: move specials above main page editor

does anyone have any ideas for this issue?
24 Sep 2008, 04:58
#11
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: move specials above main page editor

i'm still scratching my head over this issue anyone have any new idea of what could of happened here?
11 Dec 2008, 13:28
#12
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: move specials above main page editor

To display the main page defines text below all the specials and featured products find the line in the tpl_index_defines.php:

<div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
Then cut it and move it right down to the bottom of the file and reinsert it before the last </div> on the file, so the last two lines look like

<div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
</div>
11 Dec 2008, 14:03
#13
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: move specials above main page editor

or why not just make your main page defines text blank...so you can add images etc later if you want to above the featured/specials, and just pick a blank defines page (i.e i've used number 4 in this example) then add the following before the last </div> in the same file

<?php $define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_PAGE_4, 'false'); 
?>
<div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
13 Dec 2008, 18:06
#14
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: move specials above main page editor

sorry, file is tpl_index_default, NOT tpl_index_defines as i wrote before!
14 Nov 2009, 19:22
#15
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: move specials above main page editor

what ever i do to the templates/mytemplate/templates/tpl_index_default.php does nothing i deleted my main custom greeting and the main text stuff in changes nothing on my main page?


then i deleted other random parts of the file still no change on my main page makes me assume this file isn't working for some reason or at least isn't being used
14 Nov 2009, 19:35
#16
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: move specials above main page editor

now i'm playing with the /templates/template_default/templates/tpl_index_default.php file and moved the main text content to the bottom of the page with no changes to the frontpage of the site. then i started cutting out everything up to the this peice of code
<?php if ($show_display_category->fields['configuration_key'] == 'SHOW_PRODUCT_INFO_MAIN_FEATURED_PRODUCTS') { ?>
<?php



nothing changed on the site and i cleared my cache and everything what is this file for and where is there another file that i might of missed
14 Mar 2010, 07:50
#17
mcpisik avatar

mcpisik

Zen Follower

Join Date:
Jan 2007
Posts:
417
Plugin Contributions:
0

Re: move specials above main page editor

MB1:


nothing changed on the site and i cleared my cache and everything what is this file for and where is there another file that i might of missed

Same for me. Did you find a solution or reason?
27 Jun 2011, 11:05
#18
byronnz avatar

byronnz

New Zenner

Join Date:
Nov 2010
Posts:
3
Plugin Contributions:
0

Re: move specials above main page editor

I am by no means a PHP developer but so far I have got this to work by looking for the following code

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

Cutting it from its present position and pasteing it immediately prior to the last </div>

So far I have only made this change in my localhost test store but it appears to be working fine.

I would appreciate feedback if this is not good coding or may cause problems later.


Cheers
Brett
www.1-daydeals.com
28 Jun 2011, 00:35
#19
april3508 avatar

april3508

New Zenner

Join Date:
Jun 2011
Posts:
3
Plugin Contributions:
0

Re: move specials above main page editor

I am not sure this is the correct place to post this but I am going to give it a shot.....I used an older version via godaddy app. I messed up a file trying to redirect url in a php file (everything was DONE) go daddy advised to uninstall and reinstall ugh! did that now it's a different version v1.3.9h and I am so lost! none of my notes are any good. none of the files are where they used to be. I am a self taught user. All I need at this point is to remove "Congratulations! You have successfully installed your Zencart" and "Sales Message Goes here" I am sick :( Please help!!! Thank you in advance.
28 Jun 2011, 01:42
#20
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Posts:
31,500
Plugin Contributions:
4

Re: move specials above main page editor

Start your own thread

april3508:

All I need at this point is to remove "Congratulations! You have successfully installed your Zencart" and "Sales Message Goes here"

The tutorials are a reference for these basic and often asked questions
These are in the same place for years

I searched for Congratulations
https://www.zen-cart.com/tutorials/index.php?article=129

I searched for Sales Message
https://www.zen-cart.com/tutorials/index.php?article=127