Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento-检查存储是否存在的最快方法_Magento - Fatal编程技术网

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
}