0

我创建了一个正在运行的自定义运输模块。我想将结帐页面上显示的 2 个文本设置为来自翻译文件。

配置文件

<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>

管理员屏幕:

在此处输入图像描述

结帐前端屏幕:

在此处输入图像描述

问题:我想将代码中的“aaa”和“bbb”文本设置为来自翻译文件。

我可以使用在代码中设置“aaa”文本
$method->setMethodTitle(Mage::helper("starmall_config")->__("Starmall_shipping_method_title"));

然后显示:

在此处输入图像描述

如何在代码中设置“bbb”文本?

以下不起作用:

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

1 回答 1

0

是的,使用翻译功能!

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

然后将此字符串添加到您的翻译 CSV 文件中!

于 2013-10-15T09:43:20.520 回答