2013-10-15 140 views
0

我創建了一個正在工作的自定義裝運模塊。 我想將結賬頁面上顯示的兩個文本設置爲來自翻譯文件。Magento自定義裝運模塊翻譯

config.xml中

<default> 
    <carriers> 
     <starmall> 
      <active>1</active> 
      <model>Starmall_Shippingcost_Model_Carrier_Starmall</model> 
      <title>Carrier Title</title> 
      <name>Method Name</name> 
      <price>0.00</price> 
      <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg> 
     </starmall> 
    </carriers> 
</default> 

Admin屏幕:

enter image description here

結帳前端屏幕:

enter image description here

問:我想設置的 「AAA」 和「bbb」文本代碼爲c ome來自翻譯文件。

enter image description here

我怎樣才能在代碼中設置 「BBB」 文本:

我可以用
$method->setMethodTitle(Mage::helper("starmall_config")->__("Starmall_shipping_method_title"));

然後顯示這個在代碼中設置 「AAA」 的文字?

下不起作用:

 $method->setCarrierTitle("xxxxxx"); 
     $method->setTitle("xxxxx"); 
+0

作爲替代方式,您可以從左側下拉列表中選擇商店明智的標題和方法名稱,選擇您的商店並按商店添加新標題。 – liyakat

回答

0

是使用翻譯功能!

$method->setCarrierTitle(Mage::helper('core')->__('string1')); 
    $method->setTitle(Mage::helper('core')->__('string2')); 

然後將此字符串添加到您的翻譯CSV文件!

+0

這不行,我已經試過了。 – Guus