1

我想了解 Magento 打印 PDF 发票时如何省略翻译部分。总计部分包括小计、总计、折扣等。我对在语言环境文件夹中翻译这些不感兴趣,因为这些术语已在网站前端的其他部分使用,我想始终打印用简单的英文发票。

print_r($total);
$total->setOrder($order)->setSource($source);
if ($total->canDisplay()) {
    foreach ($total->getTotalsForDisplay() as $totalData) {
        print_r($total);
        ....
    }
}

我想我找到了告诉 Magento 翻译这些术语的代码。

print_r($total);

Mage_Tax_Model_Sales_Pdf_Subtotal Object
(
    [_data:protected] => Array
        (
            [@] => Array
                (
                    [translate] => title
                )

            [title] => Subtotal
            [source_field] => subtotal
            [font_size] => 7
            [display_zero] => 1
            [sort_order] => 100
            [model] => Mage_Tax_Model_Sales_Pdf_Subtotal Object
 *RECURSION*
        )

    [_hasDataChanges:protected] => 1
    [_origData:protected] => 
    [_idFieldName:protected] => 
    [_isDeleted:protected] => 
    [_oldFieldsMap:protected] => Array
        (
        )

    [_syncFieldsMap:protected] => Array
        (
        )

)


print_r($total);

Array
(
    [amount] => US$11.99
    [label] => 소계:    // translated term
    [font_size] => 7
)

我试过做$total['@'] = array('translate'=>''),但它仍然将“小计”翻译成另一种语言。有任何想法吗?

4

0 回答 0