我有商店代码,如何检查商店是否存在?我试过了:
Mage::app()->getStore($storeCode);
Run Code Online (Sandbox Code Playgroud)
但如果商店不存在,它只打印404页面.
试试这个:
$store = Mage::getModel('core/store')->load($storeCode);
if ($store->getId()) {
//the store exists
}
else {
//the store does not exist
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1699 次 |
| 最近记录: |