Announcement

Collapse
No announcement yet.

where to place javascript so it only appears on Shopping Cart page?

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

    where to place javascript so it only appears on Shopping Cart page?

    Hi -

    I wonder if anybody can advise me on the following please? -

    I have a tiny piece of Javascript code (it's actually from Google Website Optimizer) that I want to ONLY appear on the Shopping Cart page. It's meant to be placed ideally before the closing <BODY> tag.

    So I have gone into Design View, selected Shopping Cart page, and pasted this piece of javascript before the closing <BODY> tag of the 'Layout Code - Works Best with Technical' (my theme is Technical). i.e. this page is at the top of the Design Tree over to the right of the screen.

    Problem is, this piece of javascript is now appearing on ALL my content pages, not just the Shopping cart page. My feeling is that to get this code to appear JUST on the Shopping Cart page AND NOT ON ANY OTHER PAGE I need to move deeper into the Design Tree and actually paste the javascript somewhere in there, but where?

    Any ideas, anybody? Thkx in advance

    #2
    In Design | Layouts, select the existing layout, right click and choose New.

    Give it a new name, and add your code to this new layout. Then go to Design | Themes, click the Advanced Themes button, and set your cart pages to use the new Layout.

    What could be simpler?
    Bill
    www.egyptianwonders.co.uk
    Text directoryWorldwide Actinic(TM) shops
    BC Ness Solutions Support services, custom software
    Registered Microsoft™ Partner (ISV)
    VoIP UK: 0131 208 0605
    Located: Alexandria, EGYPT

    Comment


      #3
      Thanks

      Hi Bill -

      Thanks for that great reply.

      That was just the 'steer' I needed - I'll be putting that into effect later tonight.

      Thanks again

      pete

      Comment


        #4
        just one little thing ...

        Sorry to bother you again, but when you said 'In Design | Layouts, select the existing layout ... ' how do you do that exactly?

        Is this something you do under the 'Design' tab, i.e. where you see the page preview and the layout code, or is this something where you go to the top menu 'Design' - you know, where the menu expands to show Themes ... // Design Options ... // Text ... etc.

        I can see you can go via this menu Design | Library | Layouts , but once there I can't see 'Shopping cart' in the list of layouts.

        Sorry for the ignorance!

        Comment


          #5
          No, you'll be creating/amending a new copy of Works Best with Technical and then selecting that against Shopping Cart (and Checkout?) in Advanced Themes.
          Bill
          www.egyptianwonders.co.uk
          Text directoryWorldwide Actinic(TM) shops
          BC Ness Solutions Support services, custom software
          Registered Microsoft™ Partner (ISV)
          VoIP UK: 0131 208 0605
          Located: Alexandria, EGYPT

          Comment


            #6
            Thanks for your patience!

            That's what I'm having trouble with, making a copy of 'Works Best with Technical'. I'm in the code, and I right-click, a menu appears, but there is no 'New' on it.

            I highlight the code in the code window, then right-click, but again no 'New' on the menu.

            I can't think of any other way to try to select this Layout, there don't seem to be any other options on any menu anywhere ...

            Comment


              #7
              You want to be in the design library not the design tab.

              Comment


                #8
                Great - now looking down the list of Layouts listed there.

                There is all sort of stuff there that relates to bits and pieces of the shopping cart page - but nothing that seems to refer to the layout for the complete shopping cart page as a whole, such that I could insert some javascript just before the closing <BODY> of just the Shopping cart page.

                Unless I'm missing something!

                While digging round, I've discovered something on the server in /acatalog called 'SCTemplate.html'. Now, this DOES seem to be the whole shopping cart page, with <BODY> and </BODY> tags. Wouldn't I be better off just inserting my Javascript into that? Or do you think it would just keep getting overwritten with every store Update?

                Comment


                  #9
                  Don't change anythng on your server - Actinic will overwrite it.

                  Comment


                    #10
                    Well, completely stumped now - I can see in Design Manager | Layouts how you can create a new Layout (so thats progress I suppose!).

                    But it seems Catch 22 -

                    To create a New Layout, you have to base it on an existing Layout (which is what you meant in your original reply - 'select the Layout'), But the Layout I need isn't there (the layout for the whole Shopping Cart page, as a whole, not just little bits of it).

                    What's it called in your Design | Layouts box? perhaps that might help.

                    Comment


                      #11
                      I think you'd be better contacting someone to do this for you to be honest. It's a 5 minute job, just hard to explain without typing for ages. You select the existing layout, copy it and add your Javascript, you then apply that new layout to the areas where you want to use it, assigning this layout can be done in a few places, site options would be my recommended place.

                      You could also have a blockif just testing for the specific pages where you want it and adding it for you on your overall layout, which means you only have one layout to maintain then. There are many options, but you need to understand the fundamentals of a template/layout based product to do them.

                      Comment


                        #12
                        I'm most greatful for your help anyway. Have a nice evening.

                        Comment


                          #13
                          Hi Bill,

                          All sorted now, with your help.

                          Just in case anybody else comes across this thread, I found what I wanted under Settings | Site Options | Layout. Once there, under 'Site', under 'View Cart Page Layout' the drop-down box was displaying my current layout 'Works Best with Technical'. Scroll down to the bottom of this drop-down box, and you get the <New> option.

                          Click on <New> and a 'New Layout' dialog box comes up where you can create a new Layout based on the current whole-page layout, which is just what I needed.

                          As Bill said, from there, it is all plain sailing, because when you go back into the Design view, with preview page & code window etc, and select 'Shopping Cart' page as the page you want to work with it's the new Layout you have just created that comes up in the preview / code window. Excellent!

                          If you create a new Layout this way, you don't then need the step of going into Design | Themes etc. and selecting the new Layout page, this is done automatically for you.

                          Why the original Layout isn't included in the Design Library is anybody's guess - if it had been, it would have saved me a bit of time ....

                          Comment


                            #14
                            Originally posted by worthydealer
                            Why the original Layout isn't included in the Design Library is anybody's guess - if it had been, it would have saved me a bit of time ....
                            I think your problem is that it is located towards the bottom of the list, by which time you have probably given up and cannot be bothered to look properly.

                            DESIGN | LIBRARY | LAYOUTS | Web Page Outer Layout?

                            Comment


                              #15
                              Well, I'll be blowed!

                              Yes, there it is, right where you said ! - I'd swear it wasn't it in the list yesterday!

                              So that's it, that neatly resolves everything.

                              The only thing now is that after all that, I'm not entirely sure if the Shopping Cart page is the right place for my piece of javascript afterall, but that's a different thing entirely ... !

                              Comment

                              Working...
                              X