public function getCacheKey() { if (!$this->_isCacheActive()) { parent::getCacheKey(); } $this->_category = Mage::getSingleton('catalog/layer')->getCurrentCategory(); $total = $this->_getProductCollection()->getSize(); Mage::getSingleton('core/session')->setSizeValue(''); $toolbar = new Mage_Catalog_Block_Product_List_Toolbar(); $cacheKey = 'ProductList_' . $this->_category->getId() . '_' . $toolbar->getCurrentOrder() . '_' . $toolbar->getCurrentDirection() . '_' . $toolbar->getCurrentMode() . '_' . $toolbar->getCurrentPage() . '_' . $toolbar->getLimit() . '_' . $total . '_' . Mage::App()->getStore()->getCode(); foreach (Mage::app()->getRequest()->getParams() as $key => $value) { if (is_array($value)) { $value = implode('_', $value); } $realValue = ''; $valueArray = array(); $valueArray = explode('_', $value); asort($valueArray); $value = implode('_', $valueArray); if (is_array($value)) { foreach ($value as $k => $v) { $realValue .= '_' . $v; } } else { $realValue = $value; } if (!in_array(strtolower($key), array('utm_source', 'utm_content', 'utm_campaign', 'utm_medium', 'utm_term', 'gclid'))) { $cacheKey .= "_" . $key . '-' . $realValue; } } return $cacheKey; }
public function getCacheKey() { if (!$this->_isCacheActive()) { parent::getCacheKey(); } $cacheKey = 'MediaJsList_' . $this->getPid() . '_' . Mage::App()->getStore()->getCode() . '_' . ''; return $cacheKey; }
public function getCacheKey() { if (!$this->_isCacheActive()) { parent::getCacheKey(); } //Mage::log($this->getPid()); $cacheKey = 'SwatchList_' . $this->getPid() . '_' . Mage::App()->getStore()->getCode() . '_' . ''; return $cacheKey; }
public function getCacheKey() { if (!$this->_isCacheActive()) { return parent::getCacheKey(); } $_taxCalculator = Mage::getModel('tax/calculation'); $_customer = Mage::getSingleton('customer/session')->getCustomer(); $_product = $this->getProduct(); return 'ProductView' . $_product->getId() . '_' . Mage::App()->getStore()->getCode() . '_' . Mage::App()->getStore()->getCurrentCurrencyCode() . '_' . $this->helper('customer')->isLoggedIn() . '_' . $_customer->getGroupId() . '_' . $_taxCalculator->getRate($_taxCalculator->getRateRequest()->setProductClassId($_product->getTaxClassId())) . '_'; }
public function getCacheKey() { if (!$this->_isCacheActive()) { parent::getCacheKey(); } $_taxRateRequest = Mage::getModel('tax/calculation')->getRateRequest(); $_customer = Mage::getSingleton('customer/session')->getCustomer(); $this->_category = Mage::getSingleton('catalog/layer')->getCurrentCategory(); $_page = $this->getPage(); $toolbar = new Mage_Catalog_Block_Product_List_Toolbar(); $cacheKey = 'ProductLayerView_' . $this->_category->getId() . '_' . $toolbar->getCurrentOrder() . '_' . $toolbar->getCurrentDirection() . '_' . $toolbar->getCurrentMode() . '_' . $toolbar->getCurrentPage() . '_' . $toolbar->getLimit() . '_' . Mage::App()->getStore()->getCode() . '_' . Mage::App()->getStore()->getCurrentCurrencyCode() . '_' . $_customer->getGroupId() . '_' . $_taxRateRequest->getCountryId() . "_" . $_taxRateRequest->getRegionId() . "_" . $_taxRateRequest->getPostcode() . "_" . $_taxRateRequest->getCustomerClassId() . "_" . Mage::registry('current_tag') . '_' . ''; /* ... layern navigation + search */ foreach (Mage::app()->getRequest()->getParams() as $key => $value) { $cacheKey .= $key . '-' . $value . '_'; } return $cacheKey; }
<?php include('../app/Mage.php'); Mage::App('default'); //might be "default" $order = Mage::getModel('sales/order') -> loadByIncrementId('100000863'); $m_items = $order -> getAllItems(); //print_r($m_items); foreach ($m_items as $item) { print_R($item->getData()); }
<?php require '../app/Mage.php'; Mage::App('default'); $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $_POST['sku']); if (strlen($product['sku'] > 0) && $product['sku'] == $_POST['sku']) { echo strlen($product['sku']); } else { echo strlen($product['sku']); }