Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / I want to add text below additional images

I want to add text below additional images

Views: 1,523

Results 1 to 14 of 14
16 Feb 2011, 10:57 PM
#1
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

I want to add text below additional images

Hi all,

I would love to be able to add a block of text below the additional images on product listings. We have a lot of description text and it currently send the "add to cart" as well as the additional images far down the page.

For both additional description purposes and for keyword reasons we have this added text that remains the same within a category. Could EZ boxes do this? Should I have someone create a listing template or mod?

Any thoughts on how to move a block of product description test below additional images?

Have a store running with 1.38a but working on programming a brand new installation of 1.39h

Thank you...

17 Feb 2011, 12:10 AM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: I want to add text below additional images

Try swguy's "boilerplate" tutorial, mentioned here. There are also mods for additional product description fields.

Another discussion of it here.

17 Feb 2011, 3:25 AM
#3
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

Thank you very much! I read everything I could find... I created a my-defines.php file... it includes:

<?php $descr_stringlist = array("PHP_PILLOWS", "PHP_WINDOWTREATMENTS", "PHP_FURNITURE"); define('PHP_PILLOWS', 'Text Pillows.'); define('PHP_WINDOWTREATMENTS', 'TheText for window treatments.'); define('PHP_FURNITURE', 'Text for furniture.'); ?>

I would like to just add the above conditions as type in my product descriptions and have the associated text appear below the additional photos...

this must be done in tpl_product_info_display.php but how exactly since it will be separate from the description text.

17 Feb 2011, 3:37 AM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: I want to add text below additional images

You don't want to add it to the description section, but a new section in tpl_product_info_display.php below the additional images section. You may want to do something as described in my second link, post 20.

17 Feb 2011, 4:11 AM
#5
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

I will try to use that... but isn't that a category specific bit of code? I see your post #20... that seems excellent!

Big problem first... my my_defines.php is giving me a white screen which I can not seem to get past...

Thank you.

17 Feb 2011, 4:57 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: I want to add text below additional images

You would need to tweak the tests and the code location for your particular criteria. If you are getting a white screen, look in the /cache/ folder in ZC root... what is in the latest myDebug file?

17 Feb 2011, 5:08 AM
#7
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

PHP Parse error: syntax error, unexpected T_STRING in

.../html/includes/languages/english/extra_definitions/apparel_boutique/my_defines.php on line 5

The latest came from SWG's my_defines.php code

<?php $descr_stringlist = array("PHP_ONE_WEEK_DELAY", "PHP_TWO_WEEK_DELAY", "PHP_THREE_WEEK_DELAY"); define('PHP_ONE_WEEK_DELAY', 'These decals will be shipped in one week after receiving your order.'); define('PHP_TWO_WEEK_DELAY', 'These decals will be shipped in two weeks after receiving your order.'); define('PHP_THREE_WEEK_DELAY', 'These decals will be shipped in three weeks after receiving your order.'); ?>
17 Feb 2011, 3:01 PM
#8
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

Due to the white screen... I decided to play with this...

Using Files Containing Boilerplate Text in the Zen Cart Product Description

http://www.thatsoftwareguy.com/zencart_boilerplate_files.html

This seems better as I want a couple of paragraphs and that is tedious with more chance of errors in a my_defines file.

I installed it, and while it works in the description block, it does not work when placed below... I would like it right below additional images.

Here is the current tpl_product_info_display code:

<!-- bof html description --> <?php function html_include_cb($match) { $prefix = "HTML_INCLUDE_"; $match_filename = str_replace($prefix, '', $match[0]); $filename = DIR_WS_LANGUAGES . $_SESSION['language'] . '/boilerplate/' . $match_filename . ".html"; $buffer = ""; if (file_exists($filename)) { $handle = @fopen($filename, "r"); while (!feof($handle)) { $buffer .= fgets($handle, 4096); } fclose($handle); } return $buffer; } if ($products_description != '') { $pattern = "/HTML_INCLUDE_[a-zA-Z0-9]*/"; $products_description = preg_replace_callback($pattern, "html_include_cb", $products_description, -1); } ?> <!-- eof html description -->

I want it conditional on HTML_INCLUDE_XYZ in product description, but how can I get this to show output where I want it? Thoughts?

Thank you!

17 Feb 2011, 3:57 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: I want to add text below additional images

There is no error in line 5. Something about the construction of the previous line causes it to be parsed as unfinished, which carries over to the next line. Just for fun, try single quotes instead of double quotes in line 2.

I've been working on something that came up while I was writing this... I'll have to look at it later.

18 Feb 2011, 10:19 PM
#10
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

Thank you!

I guess the HTML option makes more sense the more I think about it. I have it working but the text is of course not where I want it! I wish I knew more...

25 Feb 2011, 9:22 PM
#11
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

Trying to resurrect this one... This is what I have currently... I have tried to drop this below additional images but that does not work. This works fine for the added text that I have created but for the life of me, I can not figure out how to make the HTML paragraphs of text to output below the additional images.

<!-- bof html description -->
<?php
function html_include_cb($match) {
      $prefix = "HTML_INCLUDE_";
      $match_filename = str_replace($prefix, '', $match[0]); 
      $filename = DIR_WS_LANGUAGES . $_SESSION['language'] .  
                 '/boilerplate/' . 
                 $match_filename  . ".html";
      $buffer = ""; 
      if (file_exists($filename)) { 
          $handle = @fopen($filename, "r"); 
          while (!feof($handle)) {
              $buffer .= fgets($handle, 4096); 
          }
          fclose($handle);
      }
      return $buffer;
}
if ($products_description != '') { 
   $pattern = "/HTML_INCLUDE_[a-zA-Z0-9]*/"; 
   $htmldescription = preg_replace_callback($pattern, "html_include_cb", 
           $htmldescription);
}
?>
<!-- eof html description -->

 <!--bof Product description -->
<?php if ($products_description != '') { ?>
<div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div>
<?php } ?>
<!--eof Product description -->
<br class="clearBoth" />

Any thoughts?

26 Feb 2011, 2:06 PM
#12
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

My test product is at:

s p i r i t c r a f t p i l l o w s .com/index.php?main_page=product_info&cPath=1&products_id=2

The last three paragraphs are the HTML file output.

26 Feb 2011, 9:19 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: I want to add text below additional images

Here is a zip of the boilerplate adapted to your needs.

26 Feb 2011, 10:06 PM
#14
spiritcraft avatar

spiritcraft

New Zenner

Join Date:
May 2009
Posts:
34
Plugin Contributions:
0

Re: I want to add text below additional images

Glenn,

You are a gentleman and genius! That was easy... You created a real mod. It was very easy to implement and is exactly what I wanted. I bet this will help out many. It is great to me able to lessen the text before you scroll to the price and additional photos... Others could use this for disclaimer, words about color, further descriptions or for more keywords. Thank you again, this is a gem!

Skip