<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>footer | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/footer/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Tue, 04 Oct 2011 19:22:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>how to not cache the footer in magento</title>
		<link>https://nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/</link>
					<comments>https://nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/#comments</comments>
		
		<dc:creator><![CDATA[Max Girkens]]></dc:creator>
		<pubDate>Tue, 04 Oct 2011 03:10:45 +0000</pubDate>
				<category><![CDATA[eCommerce]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[footer]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1823</guid>

					<description><![CDATA[<p>With some advanced scheduled-post-voodoo i successfully managed to publish this post already yesterday with some completely unrelated queries and no text. this was not intended &#8211; please accept my apologies :P Anyway: In the footer of my magento shop we might have a summary of the shopping cart, which i simply put in the footer.phtml &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/" class="more-link">Continue reading<span class="screen-reader-text"> "how to not cache the footer in magento"</span></a></p>
The post <a href="https://nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/">how to not cache the footer in magento</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>With some advanced scheduled-post-voodoo i successfully managed to publish this post already yesterday with some completely unrelated queries and no text. this was not intended &#8211; please accept my apologies :P</p>
<p>Anyway: In the footer of my magento shop we might have a summary of the shopping cart,<br />
which i simply put in the footer.phtml template file:<br />
<span id="more-1823"></span></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if (Mage::getModel('checkout/cart')-&gt;getItemsCount() &gt; 0): ?&gt;
  &lt;div class=&quot;footer_cart_widget&quot;&gt;
    &lt;a href=&quot;/checkout/cart&quot; class=&quot;cart&quot;&gt;
      &lt;?php echo $this-&gt;__('Warenkorb') ?&gt;:&lt;br /&gt;
      &lt;span class=&quot;cart_meta&quot;&gt;
        &lt;?php echo Mage::getModel('checkout/cart')-&gt;getItemsCount() ?&gt;
        &lt;?php if (Mage::getModel('checkout/cart')-&gt;getItemsCount() == 1): ?&gt;
          Produkt: 
        &lt;?php else: ?&gt;
          Produkte: 
        &lt;?php endif; ?&gt;
        &lt;?php echo $this-&gt;helper('checkout')-&gt;formatPrice(Mage::getSingleton('checkout/cart')-&gt;getQuote()-&gt;getGrandTotal()); ?&gt;
      &lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;
&lt;?php endif; ?&gt;
</pre>
<p><a href="https://nerdpress.org/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-04-um-21.21.05.png"><img decoding="async" src="https://nerdpress.org/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-04-um-21.21.05-300x146.png" alt="Magento Footer Shopping cart Widget disable cache" title="Magento Footer Shopping Cart Summary" width="300" height="146" class="alignnone size-medium wp-image-1846" srcset="https://nerdpress.org/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-04-um-21.21.05-300x146.png 300w, https://nerdpress.org/wp-content/uploads/2011/10/Bildschirmfoto-2011-10-04-um-21.21.05.png 443w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>This means we might need to disable the caching for the footer HTML block,<br />
so that my cart summary will stay dynamically generated.</p>
<p>This is how you can do it:</p>
<p>copy</p>
<pre class="brush: bash; title: ; notranslate">app/code/core/Mage/Page/Block/Html/Footer.php</pre>
<p>to</p>
<pre class="brush: bash; title: ; notranslate">app/code/local/Mage/Page/Block/Html/Footer.php</pre>
<p>and just comment out the following lines:</p>
<pre class="brush: php; title: ; notranslate">
//$this-&gt;addData(array(
//    'cache_lifetime'=&gt; false,
//    'cache_tags'    =&gt; array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG)
//));
</pre>
<p>you could also put the cart values in the getCacheKeyInfo() method, but as this would result in caching a footer for any state of the shopping cart from my understanding, i don&#8217;t think it&#8217;s necessarily a good idea.</p>The post <a href="https://nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/">how to not cache the footer in magento</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/10/04/how-to-not-cache-the-footer-in-magento/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
	</channel>
</rss>
