Announcement

Collapse
No announcement yet.

how can i have a print function for just product not whole page?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by los_design
    where's Dolly when you need her?!
    probably sticking pins in dolls somewhere....
    Tracey

    Comment


      #17
      Originally posted by budgetbumps
      probably sticking pins in dolls somewhere....
      PMSL.............
      Affordable solutions for busy professionals.
      Website Maintenance | UK Web Hosting

      Comment


        #18
        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


          #19
          You enclose the area of the product details within
          Code:
          <div id="product-wrapper">
          .
          .
          .
          </div>
          leave the Cart button, choices, etc out of this area.

          Then all your popup page needs is
          Code:
          <script type="text/javascript">
          document.write(window.opener.document.getElementById("product-wrapper").innerHTML);
          </script>
          Note that this is only useful for single products per page (the <div id="product-wrapper"> would be repeated).

          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


            #20
            Originally posted by NormanRouxel
            leave the Cart button, choices, etc out of this area.
            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:

            Code:
            .cart-button {
                display: none
                }
            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.

            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
            Cheers

            David
            Located in Edinburgh UK

            http://twitter.com/mcfinster

            Comment


              #21
              Here's the general one for many product per page
              Surround the code you want printable with
              Code:
              <div id="pfp_<actinic:variable name="EncodedProductAnchor" />">
              .
              .
              .
              </div>
              (omit the cart button, choices, product form, etc from this area)

              Make the link like this
              Code:
              <a href="printer_friendly.html?pfp_<actinic:variable name="EncodedProductAnchor" />" target="_blank">Printer Friendly Page</a>
              And the popup page (printer_friendly.html) simply contains the JavaScript
              Code:
              <script type="text/javascript">
              document.write(window.opener.document.getElementById(location.search.substr(1)).innerHTML);
              </script>
              Make a copy of printer_friendly.html into your site's PreviewHTML folder so you can see it on previews.

              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

              Working...
              X