Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / add text on main page under "new products for.." box

add text on main page under "new products for.." box

Started by smokers_heaven on 7 Apr 2008, 10:40 AM · Views: 4,282

Results 1 to 16 of 16
7 Apr 2008, 10:40 AM
#1
smokers_heaven avatar

smokers_heaven

New Zenner

Join Date:
Mar 2008
Posts:
15
Plugin Contributions:
0

Post #1 by smokers_heaven

hello,
any ideas how to place text on main page under the "New products for..." box. I've tried with the define pages editor, define main page, but the matter is the text appears above the "New products for..." box and i need to place it below...
thnks in advance ;)

http://www.smokers-heaven.co.uk

7 Apr 2008, 12:45 PM
#2
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Post #2 by fairestcape

Do you want the text to display ONLY on the Main Page*, and ONLY if you have enabled "New Products " to be displayed?

  • You can also elect to have "New Products" box appear elsewhere - such as on Product Listing page... do you want text to appear there too?
8 Apr 2008, 6:24 AM
#4
smokers_heaven avatar

smokers_heaven

New Zenner

Join Date:
Mar 2008
Posts:
15
Plugin Contributions:
0

Post #4 by smokers_heaven

sorry, i didn' t expect such a quick reply ;)
i need the text to appear only on the main page in the center and below the "new products for.." box. this would be a small article re smoking, which would have a link at the end to a page in my site which would contain other interesting facts and articles! 10x

http://www.smokers-heaven.co.uk

8 Apr 2008, 7:20 AM
#5
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Post #5 by fairestcape

Okay... but my principal question remains...

As it's possible to "switch off" the display of "New Products" on the index page, the method we use to incorporate this block of text is important.

Remember also, that (depending on settings), the New Products Box can "switch itself off" too (for example, if you choose to set new products display to products less than 30-days old, the box will disappear automatically if you don't add any new products within this time limit.)

So...

  1. If we incorporate the additional text feature WITHIN the New Products Box, it will appear and disappear along with the box.

  2. If you want the text to be there, regardless of whether the New Products Box is "on" or "off", we need to configure it slightly differently.

Please indicate what you would like it to do...

8 Apr 2008, 7:36 AM
#6
smokers_heaven avatar

smokers_heaven

New Zenner

Join Date:
Mar 2008
Posts:
15
Plugin Contributions:
0

Post #6 by smokers_heaven

second option. i need the text in the page regardless of the status of the "new products for..." box! 10x for the quick reply ;)

http://www.smokers-heaven.co.uk

8 Apr 2008, 9:41 AM
#7
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Post #7 by fairestcape

  1. Find the following line (near line 640) in includes\languages\YOUR-TEMPLATE\english.php
///////////////////////////////////////////////////////////
// include email extras

Directly ABOVE it, put this:-

// Special Text to appear whenever New Products are listed on Index Pages
  define('SPECIAL_TEXT', 'This is my special message to you.<br />Here is an example of a hyperlink in this text.<a target="_top" href="http://www.your-link.co.uk">Go here</a>');

You will place your text and links as HTML between the single quotes. (So edit it as you would any define text).


  1. Make a COPY on your HARD DRIVE of:-

includes\templates\template_default\templates\tpl_index_default.php

Open this copy to EDIT, and RIGHT AT THE BOTTOM of the file, place this:-

<!--SPECIAL TEXT BLOCK START-->
<?php if (SPECIAL_TEXT) { ?>
<div id="" class="specialTextBlock"><?php echo SPECIAL_TEXT; ?></div>
<?php } ?>
<!--SPECIAL TEXT BLOCK END-->

So the last few lines of that php look like this:-

<?php
  $show_display_category->MoveNext();
} // !EOF
?>
</div>

<!--SPECIAL TEXT BLOCK START-->
<?php if (SPECIAL_TEXT) { ?>
<div id="" class="specialTextBlock"><?php echo SPECIAL_TEXT; ?></div>
<?php } ?>
<!--SPECIAL TEXT BLOCK END-->

SAVE the file (on your hard drive) then FTP it to:-

includes\templates\YOUR-TEMPLATE\templates\tpl_index_default.php

(YOUR-TEMPLATE is probably "classic", so you may need to create a sub-folder called "templates" in there.

includes\templates\classic\templates\tpl_index_default.php


STYLESHEET:

As this "DIV" has its own ID, (div id="" class="specialTextBlock") you can apply styles to it in the stylesheet.


8 Apr 2008, 3:08 PM
#8
smokers_heaven avatar

smokers_heaven

New Zenner

Join Date:
Mar 2008
Posts:
15
Plugin Contributions:
0

Post #8 by smokers_heaven

done with ease due to your great explanation!!!! two final questions and i promise not to take of your time anymore:

  1. will this text dissapear if the "new products for.." box is off?
  2. i want to add a text that is say one or two passages. how do i do that? i've tested entering several sentences and the result is that the main page looks completely mixed up!
    thanks again!

http://www.smokers-heaven.co.uk/

8 Apr 2008, 3:25 PM
#9
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Post #9 by fairestcape

  1. The text will NOT disappear when the new products display box is OFF (unless you have made other changes to tpl_ index_default.php)

The TEXT you enter here (my example below in RED) can be formatted as simple HTML. I use <br /> tags to split lines and my hyperlink opens up in a new window through target="_top".

You can format the html to your own needs.

define('SPECIAL_TEXT', 'This is my special message to you.<br />Here is an example of a hyperlink in this text.<a target="_top" href="http://www.your-link.co.uk">Go here</a>');

You can also apply STYLES to this as I have given it a DIV ID of: specialTextBlock

1 May 2008, 5:05 PM
#10
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Post #10 by mydanilo

I am looking for exactly the same but did not work for me. I can't see any text below my category pictures.

Will this work with defines text above the categories on my main page and then your solution for text below the categories?

I did everything as instructed.

Live and learn... the Zen way.

1 May 2008, 5:09 PM
#11
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Post #11 by mydanilo

I want to add that categories are enabled for the main page.
This is the site I want to use it for and move text below categories.

discountbabyshowerfavors.com

Live and learn... the Zen way.

3 May 2008, 6:34 PM
#12
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

Post #12 by mydanilo

Update:

If I set:
Categories - Always Show on Main Page - 0

Then it works. I see the text below the New Items pictures.

I guess I need it to work a bit differently. I want this text below the category pictures even when I set:
Categories - Always Show on Main Page - 1

Any suggestions?

Live and learn... the Zen way.

19 Dec 2008, 10:22 PM
#13
sillygrl1212 avatar

sillygrl1212

New Zenner

Join Date:
Aug 2008
Posts:
20
Plugin Contributions:
0

Post #13 by sillygrl1212

fairestcape:

  1. Find the following line (near line 640) in includes\languages\YOUR-TEMPLATE\english.php

///////////////////////////////////////////////////////////
// include email extras

> 
> Directly ABOVE it, put this:-
> 
> ```php
// Special Text to appear whenever New Products are listed on Index Pages
  define('SPECIAL_TEXT', 'This is my special message to you.<br />Here is an example of a hyperlink in this text.<a target="_top" href="http://www.your-link.co.uk">Go here</a>');

You will place your text and links as HTML between the single quotes. (So edit it as you would any define text).


  1. Make a COPY on your HARD DRIVE of:-

includes\templates\template_default\templates\tpl_index_default.php

Open this copy to EDIT, and RIGHT AT THE BOTTOM of the file, place this:-

<!--SPECIAL TEXT BLOCK START--> <?php if (SPECIAL_TEXT) { ?> <div id="" class="specialTextBlock"><?php echo SPECIAL_TEXT; ?></div> <?php } ?> <!--SPECIAL TEXT BLOCK END--> ``` > > > So the last few lines of that php look like this:- > ```php <?php $show_display_category->MoveNext(); } // !EOF ?> </div> <!--SPECIAL TEXT BLOCK START--> <?php if (SPECIAL_TEXT) { ?> <div id="" class="specialTextBlock"><?php echo SPECIAL_TEXT; ?></div> <?php } ?> <!--SPECIAL TEXT BLOCK END--> ``` > > SAVE the file (on your hard drive) then FTP it to:- > > includes\templates\YOUR-TEMPLATE\templates\tpl_index_default.php > > (YOUR-TEMPLATE is probably "classic", so you may need to create a sub-folder called "templates" in there. > > includes\templates\classic\templates\tpl_index_default.php > > ----------------------------------------------------------- > > > STYLESHEET: > > > As this "DIV" has its own ID, (div id="" class="specialTextBlock") you can apply styles to it in the stylesheet. > > -----------------------------------------------------------

Thanks for a great solution! Would you be so kind to provide an explanation how to adjust this solution so the additional text which appears under the upcoming products field on the bottom of the page shows up on all product info pages and category pages as well?
And also instead of the "typed in" text could it use existing META_DESCRIPTION tag text (if product ir category page is customized?

Thanks!

8 Mar 2011, 11:30 PM
#14
the_enchanted avatar

the_enchanted

New Zenner

Join Date:
Jun 2010
Location:
Virginia
Posts:
20
Plugin Contributions:
0

Post #14 by the_enchanted

Hi! I followed the instructions but all it said under my new products was:

SPECIAL_TEXT

Any suggestions?

Thanks!

9 Mar 2011, 12:08 AM
#15
the_enchanted avatar

the_enchanted

New Zenner

Join Date:
Jun 2010
Location:
Virginia
Posts:
20
Plugin Contributions:
0

Post #15 by the_enchanted

I realize I can use the define main page. My problem is I'm trying to post html code but it only shows the text :dontgetit

9 Mar 2011, 12:46 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #16 by drbyte

The Enchanted:

Hi! I followed the instructions but all it said under my new products was:

SPECIAL_TEXT

Any suggestions?

Thanks!
That's because you didn't create the define() for it as described earlier.

But, this is a very old thread and your issue seems like it's actually connected to something different. Probably better to discuss it in the other thread.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.