本文整理汇总了PHP中Mage::App方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage::App方法的具体用法?PHP Mage::App怎么用?PHP Mage::App使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage
的用法示例。
在下文中一共展示了Mage::App方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCacheKey
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;
}
示例2: getCacheKey
public function getCacheKey()
{
if (!$this->_isCacheActive()) {
parent::getCacheKey();
}
$cacheKey = 'MediaJsList_' . $this->getPid() . '_' . Mage::App()->getStore()->getCode() . '_' . '';
return $cacheKey;
}
示例3: getCacheKey
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())) . '_';
}
示例4: include
<?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());
}
示例5: strlen
<?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']);
}