Magento PDF发票:如何防止总计部分的翻译

时间:2012-07-13 23:07:00

标签: php magento

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

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'=>''),但它仍将“小计”翻译成另一种语言。有什么想法吗?

0 个答案:

没有答案