Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4121526
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:21:46+00:00 2026-05-20T23:21:46+00:00

I have the following chunk of code in my footer.phtml <!– Customer Modal –>

  • 0

I have the following chunk of code in my footer.phtml

 <!-- Customer Modal -->
 <?php if (array_key_exists("customer_select", $_COOKIE) == FALSE ): ?>
    <script type="text/javascript" src="<?=$this->getSkinUrl('js/jqModal.js')?>"></script>
    <script type="text/javascript">
        jQuery(document).ready(function(){
            jQuery("#customer_type_dialog").jqm().jqmShow();
        });
    </script>
    <?php include("../../templates.eu/templates.sbc.de/_includes/customer_select.php"); ?>
<?php endif; ?>

When I turn on the block caching it stops evaluating this an only returns the value that was cached. HOw do I work around this problem or what is a better way to do this? Basically I’m checking to see if a cookie exists and if it does I’m adding some js and another file to the page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:21:47+00:00Added an answer on May 20, 2026 at 11:21 pm

    Put the above code in it’s own template file and make this layout change:

    <reference name="before_body_end">
        <block type="core/template" template="your/cookie/check/file.phtml" />
    </reference>
    

    This way the footer gets to be cached (which helps keep pages fast) and your cookie check is evaluated each time. Also the Javascript is left until the last possible point of the page which is a best practice for inline scripts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following chunk of code. It works perfectly. <div id=restaurant_locations></div> <script type=text/javascript>
I have the following chunk of header and footer code appearing in alot of
I came across the following weird chunk of code.Imagine you have the following typedef:
I am learning jQuery. I have the following chunk of code in an HTML
Having a major brain freeze, I have the following chunk of code: // Get
I have the following chunk of python code: import hashlib class User: def _set_password(self,
I have the following code (sorry for the large code chunk, but I could
I have tried the following code in single.php file in wordpress. I used these
I have a the following chunk of code that's adding up to six Player
I have the following chunk of Python code (running v2.7) that results in MemoryError

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.