【问题标题】:How to Magento getBaseUrl on Frontend from Backend?如何从后端获取前端的 Magento getBaseUrl?
【发布时间】:2012-11-13 15:42:11
【问题描述】:

我的前端网址后端网址不一样。

例子,

前端:http://magento.com/

后端:http://my.magento.com/

那么,

如何从Backend获取Frontend基础url?

【问题讨论】:

    标签: php magento magento-1.7 magento-1.6 base-url


    【解决方案1】:

    我没有带有自定义管理区域 URL 的商店,但我想这应该可行:

    Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
    

    【讨论】:

    • 确保 $storeId 不为空。如果设置 'Add Store Code to Urls' 设置为 'Yes' 并且如果 $storeId 为 null,它将添加 'admin' 到 url。
    猜你喜欢
    • 2022-01-25
    • 1970-01-01
    • 2019-05-27
    • 1970-01-01
    • 2020-03-04
    • 1970-01-01
    • 2021-10-06
    • 1970-01-01
    • 2014-07-06
    相关资源
    最近更新 更多