Jon*_*alb 2 static-block magento
我知道在 .phtml 文件中您可以这样做,例如:
<?php echo $this->helper('derco_core')->getStoreUrl('dcmotosesp')?>
Run Code Online (Sandbox Code Playgroud)
我想在静态块内做同样的事情。提前致谢。
没有使用短代码 ( {{store url}}) 获取特定商店的 url 的“干净”方法。
...因为store短代码处理程序像这样结束(请参阅Mage_Core_Model_Email_Template_Filter::storeDirective()):
return Mage::app()->getStore(Mage::getDesign()->getStore())->getUrl($path, $params);
Run Code Online (Sandbox Code Playgroud)
这意味着 store 不能作为参数传递。
下面的方法可能可行,但有点难看。___store这个想法是通过$_GET告诉 Magento 切换到特定商店来发送参数。
<a href="{{store url="some/url/here" _query="___store=store_code_here"}}">TEST LINK</a>
Run Code Online (Sandbox Code Playgroud)
(将“store_code_here”替换为您的特定商店代码)。
另一种选择是扩展上述方法并允许它接收参数store_code。