Note that there are some explanatory texts on larger screens.

plurals
  1. POFull Page Cache in Magento EE 1.12
    primarykey
    data
    text
    <p>We are running a Advance Product Option Extension in EE 1.12. On top of the extension we modified it to use cookies so if customer has selected particular custom options, those are saved in the cookie and next time he visits the product page again the options are populated again from the cookie.</p> <p>The problem is the Cookie values are Cache in Magento FPC. We tried using hole punching for by passing this but unfortunately it is not working as well. </p> <p>(1) Is there any other way to counter this issue other than hole punching? (2) As this is a custom module, do we modify the module/etc/cache.xml or pagecache/cache.xml for hole punching. </p> <p>Regards,</p> <p>Steve</p> <p>Below is the part of the code we have for cookie:</p> <pre><code>&lt;?php $pres_saved_data = Mage::helper('customoptions')-&gt;isCookieExist(); //$cookieModel = Mage::getModel('core/cookie'); //$pres_saved_data = $cookieModel-&gt;get('myprescription'); $show_prefilled_data = false; $pres_data = array(); $other_pres_data = array(); if($pres_saved_data){ $sql = "select * from customer_prescription where id = '".$pres_saved_data."'"; $rowdata = $readConnection-&gt;fetchRow($sql); if($rowdata){ $show_prefilled_data = true; $optionsdata = unserialize($rowdata['prescription_options']); $pres_data['options'] = unserialize($optionsdata['options']); /* store all the option data which is there in cookie*/ $options_data = array(); $options_sku = array(); foreach($pres_data['options'] as $_data){ $label = strtolower(str_replace(" ",'_',$_data['label'])); if($label == 'prescription_type' || $label == 'lens' || $label =='pd' || $label == 'anti_reflective_coating') { $options_data[] = $_data['value']; $options_sku[] = $_data['sku']; } else{ $other_pres_data[$label] = $_data['value']; } } $sql = sprintf("SELECT v.option_type_id ,t.title,c.option_id,v.sku FROM catalog_product_option as c inner join `catalog_product_option_type_value` as v on c.option_id = v.option_id inner join catalog_product_option_type_title as t on v.option_type_id = t.option_type_id and v.sku in ('%s') and product_id = %s and t.title in ( '%s') where store_id in( 0,".Mage::app()-&gt;getStore()-&gt;getId().")",implode("', '",$options_sku),$current_product-&gt;getId(),implode("', '",$options_data)); $option_cookie_data = $readConnection-&gt;fetchAll($sql); } } ?&gt; &lt;?php endif; ?&gt; </code></pre> <p>The container we have is :</p> <pre><code>&lt;?php class MageWorx_Customoptions_Model_Container_cachetest extends Enterprise_PageCache_Model_Container_Abstract { protected function _getIdentifier() { return $this-&gt;_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, ''); } protected function _getCacheId() { return 'customoptions' . md5($this-&gt;_placeholder-&gt;getAttribute('cache_id') . $this-&gt;_getIdentifier()); } protected function _renderBlock() { $blockClass = $this-&gt;_placeholder-&gt;getAttribute('block'); $template = $this-&gt;_placeholder-&gt;getAttribute('template'); $block = new $blockClass; $block-&gt;setTemplate($template); return $block-&gt;toHtml(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload