Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / static text and print on every product

static text and print on every product

Views: 587

Results 1 to 4 of 4
27 Jan 2011, 9:05 PM
#1
unsub avatar

unsub

New Zenner

Join Date:
Dec 2010
Posts:
31
Plugin Contributions:
0

static text and print on every product

Can someone post an example of how to put a "print" button and the text " Printed by ... " on every product.
I've looked at everything a cant figure it out. Please help with sample code.

27 Jan 2011, 9:39 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: static text and print on every product

There is no need for a "print" button on your page, if you use the standard print_stylesheet.css that is in Zen Cart by default. It will cause the browser's file > print function to print a cleaned-up version of the page content. You can tailor this to your liking, and even add a line to the tpl_product_info_display.php file for "Printed by <whatever you want>" that will be hidden on the screen but appear on the printout.

If you feel you need to encourage customers to print the product page, you can include a message to the effect that it will print neatly with their browser's print function (then hide that message for the paper copy).

27 Jan 2011, 10:32 PM
#3
unsub avatar

unsub

New Zenner

Join Date:
Dec 2010
Posts:
31
Plugin Contributions:
0

Re: static text and print on every product

gjh42:

You can tailor this to your liking, and even add a line to the tpl_product_info_display.php file for "Printed by <whatever you want>" that will be hidden on the screen but appear on the printout.

That sounds great, can you please let me know what code to use.
I would greatly appreciate it.

27 Jan 2011, 11:09 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: static text and print on every product

Add to /includes/templates/your_template/templates/tpl_product_info_display.php```php

<div id=printMsgScreen">This page will print neatly with your browser's Print function</div> <div id=printMsgPaper">Printed by <?php echo (whatever specific info you want);?></div> ```

Add to your stylesheet.css```
#printMsgScreen {text-align: whatever; color: #778899;}

#printMsgPaper {display: none;}

Add to your print_stylesheet.css```
#printMsgScreen {display: none;}

#printMsgPaper {text-align: whatever; color: #778899; }

Adjust styling for your particular page layout.