Magento-检查存储是否存在的最快方法
我有一个商店代码,如何检查该商店是否存在?我试过:Magento-检查存储是否存在的最快方法,magento,Magento,我有一个商店代码,如何检查该商店是否存在?我试过: Mage::app()->getStore($storeCode); 但是如果商店不存在,它只打印404页。试试这个: $store = Mage::getModel('core/store')->load($storeCode); if ($store->getId()) { //the store exists } else { //the store does not exist }
Mage::app()->getStore($storeCode);
但是如果商店不存在,它只打印404页。试试这个:
$store = Mage::getModel('core/store')->load($storeCode);
if ($store->getId()) {
//the store exists
}
else {
//the store does not exist
}