Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding Printable Version to Embeded Static Pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-27-2007, 07:16 AM
 
taylork taylork is offline
 

Newbie
  
Join Date: Jan 2007
Posts: 3
 

Question Adding Printable Version to Embeded Static Pages

Hello All,

I am a new x-cart user and have been working with it for over a week now. So far so good. I have been able to find the answers and fix things myself. But I am very stuck on one thing...

I swear I have read every post in this forum - twice trying to find out.

I have a bunch of articles that I want to make embeded static pages. I have a couple of them done for testing purposes right now, but there is no "Printable Version" link like there are for categories and products.

How can I add that in so all my embeded static pages show the "Printable Version" link?

I REALLY appreciate any help you could offer!

Thanks a MILLION!
__________________
Taylork
______________
X-Cart Version 4.0.19
Reply With Quote
  #2  
Old 02-02-2007, 09:49 AM
 
taylork taylork is offline
 

Newbie
  
Join Date: Jan 2007
Posts: 3
 

Default Re: Adding Printable Version to Embeded Static Pages

Okay - I got the answer from X-Cart. Maybe this will help somebody else out.

It's VERY easy! I copied and pasted and all was well...
___________________
Unfortunately, standard X-Cart does not support such functionallity - printable version for embeded static pages.

However since X-Cart has open source code it can be customized to meet your needs. You can modify the cart by yourselif, please follow the instruction below to implement the feature you need:

1. Modify the "<xcart_dir>/skin1/head.tpl" template, replace the following code:

{if (($main eq 'catalog' && $cat ne '') || $main eq 'product' || ($main eq 'comparison' && $mode eq 'compare_table') || ($main eq 'choosing' && $smarty.get.mode eq 'choose')) && $config.Appearance.enabled_printable_version eq 'Y'}

with this one:

{if (($main eq 'catalog' && $cat ne '') || $main eq 'product' || $main eq 'pages' || ($main eq 'comparison' && $mode eq 'compare_table') || ($main eq 'choosing' && $smarty.get.mode eq 'choose')) && $config.Appearance.enabled_printable_version eq 'Y'}

__________________
Taylork
______________
X-Cart Version 4.0.19
Reply With Quote
  #3  
Old 02-03-2007, 05:54 AM
 
Jonjolt1 Jonjolt1 is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 49
 

Default Re: Adding Printable Version to Embeded Static Pages

Just another Tip, you can use CSS to automaticly change the layout for print.

http://www.w3schools.com/css/css_ref_print.asp
__________________
4.1.9
Reply With Quote
  #4  
Old 03-24-2007, 09:30 AM
 
Seacat Seacat is offline
 

Advanced Member
  
Join Date: Feb 2007
Posts: 29
 

Default Re: Adding Printable Version to Embeded Static Pages

Quote:
Originally Posted by taylork

1. Modify the "<xcart_dir>/skin1/head.tpl" template, replace the following code:

{if (($main eq 'catalog' && $cat ne '') || $main eq 'product' || ($main eq 'comparison' && $mode eq 'compare_table') || ($main eq 'choosing' && $smarty.get.mode eq 'choose')) && $config.Appearance.enabled_printable_version eq 'Y'}

with this one:

{if (($main eq 'catalog' && $cat ne '') || $main eq 'product' || $main eq 'pages' || ($main eq 'comparison' && $mode eq 'compare_table') || ($main eq 'choosing' && $smarty.get.mode eq 'choose')) && $config.Appearance.enabled_printable_version eq 'Y'}


added the above, and nothing changes on 4.1.6. Did you have any other places to add the part for $main eq 'pages' ?
__________________
Seacat
X-Cart Gold v4.1.6 [linux]
PHP 5.2.2
My SQL 5.0.24
DSEFU Mod
Cartlab CSS Skin
Several other mods
Self-Defense Weapons
Reply With Quote
  #5  
Old 07-08-2007, 08:44 PM
 
mjfontec mjfontec is offline
 

Member
  
Join Date: Jul 2007
Posts: 14
 

Default Re: Adding Printable Version to Embeded Static Pages

This works great in 4.1.8, thank you!!

Mike
__________________
X-cart Gold
v. 4.1.8
Unix
Reply With Quote
  #6  
Old 12-02-2008, 12:59 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: Adding Printable Version to Embeded Static Pages

This works fine in 4.1.10 as well.

Just make sure you add the the double-pike OR symbol... ||

Also, if you would like to have the Printable Version added to your Search Results as well, then just add: || $main eq 'search'

This in the the file: skin1/head.tpl (near the bottom):

Here's the complete replacement code:
Code:
{if (($main eq 'catalog' && $cat ne '') || $main eq 'product' || $main eq 'pages' || $main eq 'search' || ($main eq 'comparison' && $mode eq 'compare_table') || ($main eq 'choosing' && $smarty.get.mode eq 'choose')) && $config.Appearance.enabled_printable_version eq 'Y'}
Robert
__________________
X-cart 4.1.10
Reply With Quote
  #7  
Old 01-05-2010, 10:17 AM
 
cmodesign cmodesign is offline
 

Member
  
Join Date: Oct 2009
Posts: 20
 

Default Re: Adding Printable Version to Embeded Static Pages

I tried changing the code in /skin1/head.tpl but it didn't seem to change anything. I am using X-Cart v4.2.2. Has anyone else been able to get it to work for this version?

Here is the code I used:
Code:
{if (($main eq 'catalog' && $cat ne '') || $main eq 'product' || $main eq 'pages' || ($main eq 'comparison' && $mode eq 'compare_table') || ($main eq 'choosing' && $smarty.get.mode eq 'choose')) && $config.Appearance.enabled_printable_version eq 'Y'}

Do I need to place any code in the actual static pages?
__________________
X-Cart Gold - v4.2.2
PHP: 4.4.9
MySQL: 5.1.55-rel 12.6
Apache: 2.0.54
Reply With Quote
  #8  
Old 01-05-2010, 10:30 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Adding Printable Version to Embeded Static Pages

Is the printable version working for the other pages?

Quote:
Originally Posted by cmodesign
I tried changing the code in /skin1/head.tpl but it didn't seem to change anything. I am using X-Cart v4.2.2. Has anyone else been able to get it to work for this version?

Here is the code I used:
Code:
{if (($main eq 'catalog' && $cat ne '') || $main eq 'product' || $main eq 'pages' || ($main eq 'comparison' && $mode eq 'compare_table') || ($main eq 'choosing' && $smarty.get.mode eq 'choose')) && $config.Appearance.enabled_printable_version eq 'Y'}

Do I need to place any code in the actual static pages?
__________________
xcart 5.1.2
Reply With Quote
  #9  
Old 01-05-2010, 10:52 AM
 
cmodesign cmodesign is offline
 

Member
  
Join Date: Oct 2009
Posts: 20
 

Default Re: Adding Printable Version to Embeded Static Pages

Yes it works fine on the Category and Product pages. A "Printable version" link and icon appear in the top right, on the same line as the breadcrumbs.

Nothing appears for my static pages.
__________________
X-Cart Gold - v4.2.2
PHP: 4.4.9
MySQL: 5.1.55-rel 12.6
Apache: 2.0.54
Reply With Quote
  #10  
Old 01-05-2010, 01:51 PM
 
cmodesign cmodesign is offline
 

Member
  
Join Date: Oct 2009
Posts: 20
 

Default Re: Adding Printable Version to Embeded Static Pages

I also noticed another problem. When I select "Printable Version" from any Categories section that has a long list, it takes me to a new page that looks like it should print properly but when I actually select Print Preview from my browser it cuts things off after the first page. It also places the store logo on a completely separate page.

Pg1 = Company Logo then a bunch of blank space
Pg2 = whatever products that fit on 1 page (the rest are cut off)
__________________
X-Cart Gold - v4.2.2
PHP: 4.4.9
MySQL: 5.1.55-rel 12.6
Apache: 2.0.54
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:27 PM.

   

 
X-Cart forums © 2001-2020