/** * Retrieve block cache tags * * @return array */ public function getCacheTags() { return array_merge(parent::getCacheTags(), $this->getItemsTags($this->getItemCollection())); }
/** * Retrieve array of cross-sell products * * @return array */ public function getItemCollection() { if (is_null($this->_items)) { // if has just added product to cart - load cross-sell products for it $productsByLastAdded = $this->_getProductsByLastAddedProduct(); $limit = $this->getPositionLimit(); if (count($productsByLastAdded) < $limit) { // reset collection $this->_linkCollection = null; parent::getItemCollection(); // products by last added are preferable $this->_items = $productsByLastAdded + $this->_items; $this->_sliceItems(); } else { $this->_items = $productsByLastAdded; } $this->_orderProductItems(); } return $this->_items; }
/** * Retrieve block cache tags * * @return array */ public function getCacheTags() { $tags = parent::getCacheTags(); $ids = $this->getAllIds(); if (!empty($ids)) { foreach ($ids as $id) { $tags[] = Mage_Catalog_Model_Product::CACHE_TAG . '_' . $id; } } return $tags; }