Originally posted by los_design
Announcement
Collapse
No announcement yet.
how can i have a print function for just product not whole page?
Collapse
X
-
PMSL.............Originally posted by budgetbumpsprobably sticking pins in dolls somewhere....Affordable solutions for busy professionals.
Website Maintenance | UK Web Hosting
Comment
-
Hi guys
I can see this thread i started has stired up some interest, its a great feature to have and Dave what you did is just what i am looking for. I had a look at the code but am still unsure how you acheived it, i can see the link and put it in my product code but how do you make the details jump over to the empty page? could you point me in the right direction with a few more pointers please
cheers
paul
Comment
-
You enclose the area of the product details within
leave the Cart button, choices, etc out of this area.Code:<div id="product-wrapper"> . . . </div>
Then all your popup page needs is
Note that this is only useful for single products per page (the <div id="product-wrapper"> would be repeated).Code:<script type="text/javascript"> document.write(window.opener.document.getElementById("product-wrapper").innerHTML); </script>
Hang on and I'll post a general one that works with many product per page.Norman - www.drillpine.biz
Edinburgh, U K / Bitez, Turkey
Comment
-
You can take it one stage further and create a print.css file that is called from within the pop up. You can then selectively display div's within the main div you are calling by using display: none, ie:Originally posted by NormanRouxelleave the Cart button, choices, etc out of this area.
And wrapping the cart button in a blank div (or, if it's already in a div just add that to the file). This can also be used to 'turn off' Actinic styling if you don't need it, just add the relevant classes to print.css and add display: none to them.Code:.cart-button { display: none }
This means you can wrap your entire product layout in the div you plan to print and then choose not to display items you dont want to (with some select div'ery)
HTH
Comment
-
Here's the general one for many product per page
Surround the code you want printable with
(omit the cart button, choices, product form, etc from this area)Code:<div id="pfp_<actinic:variable name="EncodedProductAnchor" />"> . . . </div>
Make the link like this
And the popup page (printer_friendly.html) simply contains the JavaScriptCode:<a href="printer_friendly.html?pfp_<actinic:variable name="EncodedProductAnchor" />" target="_blank">Printer Friendly Page</a>
Make a copy of printer_friendly.html into your site's PreviewHTML folder so you can see it on previews.Code:<script type="text/javascript"> document.write(window.opener.document.getElementById(location.search.substr(1)).innerHTML); </script>
Also add printer_friendly.html into Design / Additional files (actinic doesn't detect pages like printer_friendly.html?xyz).Norman - www.drillpine.biz
Edinburgh, U K / Bitez, Turkey
Comment
Comment