因此,當您閱讀標題時,我需要與magento靜態塊的幫助,我的任務是讓2個商店中的靜態塊內容不同,如果甚至可能的話? ty尋求答案。 P.S.對不起英語不好。Magento商店店鋪中的不同內容的靜態塊
0
A
回答
0
試試這個它適合我。我用html/javascript製作了它。您可以通過
var shopName= '{{config path="general/store_information/name"}}';
然後根據您的需要進行比較來獲得店名。將代碼粘貼到靜態塊編輯器中。
<!DOCTYPE html>
<html>
<body onload="websiteMessage()">
<p>Happy new years !!!</p>
<p id="static_block"></p>
<script>
function websiteMessage() {
var shopName= '{{config path="general/store_information/name"}}';
var string = "";
if(shopName.localeCompare("Leather_shoes_shop") == 0)
{
string = "leather shoes";
}
else if(shopName.localeCompare("Rubber_shoes_shop") == 0)
{
string = "rubber shoes";
}
else
{
string = "other";
}
document.getElementById('static_block').innerHTML = string;
}
</script>
</body>
</html>
+0
謝謝!!!多數民衆贊成我正在尋找。 – 2014-12-02 18:30:56
1
FYI正確Magento的方式多店做,這是建立兩個具有相同ID的靜態塊和分配每一個你想讓它顯示在商店視圖。 Magento將根據當前正在查看的商店加載正確的版本。
相關問題
- 1. Woocommerce店內店鋪
- 2. Magento:將靜態塊分配給所有商店的主頁
- 3. 在商店創建中靜態定義商店中的數據
- 4. Magento的每個商店的不同SKU
- 5. magento商店視圖
- 6. Magento的:更新庫存數量和狀態不同商店
- 7. Magento的商店 - 通過
- 8. Magento的商店 - SQL錯誤
- 9. Magento的商店 - 擴展
- 10. 商店的不同實例
- 11. Magento的集店鋪標識編程
- 12. Magento - 2個不同購物車和不同的商店搜索
- 13. 從Windows應用商店應用中的WebView打印靜態內容
- 14. Google Play商店新的內容評級
- 15. 在不同的Magento商店視圖中禁用產品
- 16. Magento商店ID在cronjob
- 17. Magento;派遣多商店
- 18. 獲取magento商店列表
- 19. Magento多商店SSL分享
- 20. Magento:在商店代碼Dash
- 21. magento多個商店視圖
- 22. Magento商店中的Paypal IPN錯誤
- 23. 更改Magento中商店的域名
- 24. Vuex商店狀態不定
- 25. 使用Magento建立獎勵店鋪
- 26. Magento商店 - 不能編輯最近查看的區塊
- 27. Angular - Karma - ngrx - 沒有店鋪提供商
- 28. extjs動態商店?
- 29. Magento的:正在同步的產品/類別從「商店1>德國商店查看」翻譯爲「商店2>德國商店查看」
- 30. 不能連接到Magento商店
這是在一個多商店設置或2個完全獨立的網站? – PixieMedia 2014-12-02 19:34:14
多店鋪設置,它與mac444s的答案。 – 2014-12-03 22:10:51