public function getCacheKeyInfo() { $info = parent::getCacheKeyInfo(); $info[] = Mage::app()->getStore()->getCurrentCurrencyCode(); $info[] = Mage::getSingleton('customer/session')->getCustomerGroupId(); $info[] = $this->getProduct()->getId(); return $info; }
/** * Get cache key informative items with the position number to differentiate * * @return array */ public function getCacheKeyInfo() { $cacheKeyInfo = parent::getCacheKeyInfo(); foreach (Mage::app()->getLayout()->getXpath('//action[@method="addPriceBlockType"]') as $element) { if (!empty($element->type)) { $prefix = 'price_block_type_' . (string) $element->type; $cacheKeyInfo[$prefix . '_block'] = empty($element->block) ? '' : (string) $element->block; $cacheKeyInfo[$prefix . '_template'] = empty($element->template) ? '' : (string) $element->template; } } $cacheKeyInfo[] = $this->getPosition(); return $cacheKeyInfo; }
/** * Get cache key informative items with the position number to differentiate * * @return array */ public function getCacheKeyInfo() { $cacheKeyInfo = parent::getCacheKeyInfo(); $elements = Mage::app()->getLayout()->getXpath('//action[@method="addPriceBlockType"]'); if (is_array($elements)) { foreach ($elements as $element) { if (!empty($element->type)) { $prefix = 'price_block_type_' . (string) $element->type; $cacheKeyInfo[$prefix . '_block'] = empty($element->block) ? '' : (string) $element->block; $cacheKeyInfo[$prefix . '_template'] = empty($element->template) ? '' : (string) $element->template; } } } $cacheKeyInfo[] = $this->getPosition(); if (!is_null($this->getItem())) { $cacheKeyInfo['item_id'] = $this->getItem()->getId(); } return $cacheKeyInfo; }
/** * Cache this block for each product separately * * @return array */ public function getCacheKeyInfo() { $info = parent::getCacheKeyInfo(); $info[] = 'PRODUCT_' . $this->getProduct()->getId(); return $info; }
public function getCacheKeyInfo() { return array_merge(parent::getCacheKeyInfo(), array(Mage::getSingleton('customer/session')->getCustomerGroupId(), ($product = $this->getProduct()) ? $product->getId() : null, $this->getData('attribute_code'), $this->getData('product_count'))); }