Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2008
    Posts
    129
    Plugin Contributions
    0

    Default Adding to end of body for shipping cart page - Google Analytics

    Hi,

    I want to add code to the end of the body section, but for a single page only, like the shopping cart.

    I found great info on adding it to the bottom of the head tag for a single page (putting the code in /includes/modules/pages/shopping_cart/jscript_compete-com.php) but is there a similar kind of hook to add to the body, right before the end body tag?

    Thanks, Susie
    Last edited by susb8383; 5 Jun 2011 at 07:11 PM. Reason: subscription

  2. #2
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Adding to end of body for shipping cart page

    1. Find the name of your present template.
    2. go to /includes/templates/YOUR_TEMPLATE_NAME_HERE/ and create a new folder called shopping_cart
    3. Copy the /includes/templates/YOUR_TEMPLATE_NAME_HERE/common/tpl_footer.php file into that new shopping_cart folder.
    (If you don't have such a file in your YOUR_TEMPLATE_NAME_HERE/common folder, then copy the one from template_default/common instead.)
    4. Make any page-specific customizations to this new copy of the file.

    Alternatively you could copy tpl_main_page instead of tpl_footer, but tpl_footer is less likely to be altered in upgrades so would be a simpler place to put your custom code.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Adding to end of body for shipping cart page

    Hey, that worked! Thanks!

    But it brings up an unrelated question...when I look at the page source of the shopping cart, I don't have an /body or /html at all. The last thing I see is the comment End mainWrapper.

    Do you happen to know why this is?

    Thanks, Susie

  4. #4
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Adding to end of body for shipping cart page

    Sounds like whatever you added caused the rest of the PHP execution to die with an error.

    Errors don't display to the screen, for security reasons. You'll have to find the error by looking at the logs: https://www.zen-cart.com/tutorials/index.php?article=82
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Feb 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Adding to end of body for shipping cart page

    Hmm...it seems to be related to me creating the shopping_cart folder. After I undid my changes, I still got an error in the log that it can't find
    shopping_cart//google_analytics.php

    Note there are two slashes.

    I should probably start a different thread, huh? Unless you happen to know the problem off the top of your head...

    --Susie

  6. #6
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Adding to end of body for shipping cart page - Google Analytics

    Moderator's note - thread has been moved and renamed for clarity.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  7. #7
    Join Date
    Jul 2009
    Posts
    22
    Plugin Contributions
    0

    Default Re: Adding to end of body for shipping cart page

    Quote Originally Posted by susb8383 View Post
    Hmm...it seems to be related to me creating the shopping_cart folder. After I undid my changes, I still got an error in the log that it can't find
    shopping_cart//google_analytics.php

    Note there are two slashes.

    I should probably start a different thread, huh? Unless you happen to know the problem off the top of your head...

    --Susie
    Did you figure out the double slash issue? I'm seeing the same problem.

  8. #8
    Join Date
    Feb 2008
    Posts
    129
    Plugin Contributions
    0

    Default Re: Adding to end of body for shipping cart page

    Quote Originally Posted by Mr.Pibb View Post
    Did you figure out the double slash issue? I'm seeing the same problem.
    No, I never did.

    Moderator, if you move and rename a thread, it would be really helpful if you included a link to it, or at the very least, tell us where you moved it to and what you renamed it to. Now I have to find it...

    Thanks.

 

 

Similar Threads

  1. my site went down..... Adding Google Analytics
    By lrfowler in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 1 Mar 2012, 01:39 AM
  2. Adding tracking code for analytics To Every Page?
    By fabienne in forum Basic Configuration
    Replies: 4
    Last Post: 14 Jul 2010, 08:02 PM
  3. no "body" tag in view source after installing the Simple Google Analytics module
    By notageek in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 19 May 2010, 04:31 AM
  4. uninstalling SQL patch for Google Analytics, which messed up my cart
    By sruti_geneles in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 20 Jul 2009, 06:35 PM
  5. Counter Hstory vs adding google analytics to track
    By karenkte in forum General Questions
    Replies: 10
    Last Post: 30 Jul 2008, 05:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR