1

読み飛ばしてただけ

http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/system_email_template/index#email_variables

これらの変数を自分で見つける方法を知っている人はいますか? wiki ページには、実際には機能しない可能性があると書かれており、使用しようとしている変数は {{var shippingMethod}} ですが、空白が返されます。

1 つはそれが正しい変数名である場合、2 つはそれが正しい変数名である場合、カスタム配送方法にどの機能を追加する必要があるかということです。

ありがとうございました!

ジェフ

4

1 に答える 1

3

これがあなたを助けるかもしれないコードの一部です:

public function sendMail() {
    $mailTemplate = Mage::getModel('core/email_template');
    $template = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE); // template id of email template
    $email = Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT); // recipient example: example@yahoo.com
    $mailTemplate->setDesignConfig(array('area'=>'frontend'))
        ->sendTransactional(
        $template,
        Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY),
        $email,
        null,
        array(
            'subject'   => $this->getSubject(),
            'line'      => $this->getLine(),
            'message'   => $this->getMessage()
        )
    );
    $translate->setTranslateInline(true);
    return $this;
}

の配列

        array(
            'subject'   => $this->getSubject(),
            'line'      => $this->getLine(),
            'message'   => $this->getMessage()
        )

{{var subject}} {{var line}} {{var message}} で取得できます


次に、shippingMethodを取得する方法は??

配送方法のモデルを取得し、最初に配送方法をロードしてから配列に設定する必要があります。

于 2013-02-28T02:11:35.117 に答える