访问自定义订单属性

时间:2013-05-14 11:20:22

标签: magento magento-1.7

我创建了三个自定义订单属性sales_person_name,sales_type,referral

我试图在不同的模块中访问它们。

任何人都可以告诉我如何在不同的模块中访问这些订单属性

我是否必须打电话给某个型号

我试过

$order = Mage::getModel('sales/order')->load($order);

我的输出低于输出,但无法获得数据。

Mage_Sales_Model_Order Object
(
    [_eventPrefix:protected] => sales_order
    [_eventObject:protected] => order
    [_addresses:protected] => 
    [_items:protected] => 
    [_payments:protected] => 
    [_statusHistory:protected] => 
    [_invoices:protected] => 
    [_tracks:protected] => 
    [_shipments:protected] => 
    [_creditmemos:protected] => 
    [_relatedObjects:protected] => Array
        (
        )

    [_orderCurrency:protected] => 
    [_baseCurrency:protected] => 
    [_actionFlag:protected] => Array
        (
        )

    [_canSendNewEmailFlag:protected] => 1
    [_historyEntityName:protected] => order
    [_resourceName:protected] => sales/order
    [_resource:protected] => 
    [_resourceCollectionName:protected] => sales/order_collection
    [_cacheTag:protected] => 
    [_dataSaveAllowed:protected] => 1
    [_isObjectNew:protected] => 
    [_data:protected] => Array
        (
        )

    [_hasDataChanges:protected] => 
    [_origData:protected] => Array
        (
        )

    [_idFieldName:protected] => 
    [_isDeleted:protected] => 
    [_oldFieldsMap:protected] => Array
        (
            [payment_authorization_expiration] => payment_auth_expiration
            [forced_do_shipment_with_invoice] => forced_shipment_with_invoice
            [base_shipping_hidden_tax_amount] => base_shipping_hidden_tax_amnt
        )

    [_syncFieldsMap:protected] => Array
        (
            [payment_authorization_expiration] => payment_auth_expiration
            [forced_do_shipment_with_invoice] => forced_shipment_with_invoice
            [base_shipping_hidden_tax_amount] => base_shipping_hidden_tax_amnt
            [payment_auth_expiration] => payment_authorization_expiration
            [forced_shipment_with_invoice] => forced_do_shipment_with_invoice
            [base_shipping_hidden_tax_amnt] => base_shipping_hidden_tax_amount
        )

)

我按如下方式创建了订单属性

<?php
$installer = $this;
$installer->startSetup();

$installer->addAttribute("order", "sales_person_name", array("type"=>"varchar"));
$installer->addAttribute("order", "sales_type", array("type"=>"varchar"));
$installer->addAttribute("order", "referral", array("type"=>"varchar"));
$installer->addAttribute("quote", "sales_person_name", array("type"=>"varchar"));
$installer->addAttribute("quote", "sales_type", array("type"=>"varchar"));
$installer->addAttribute("quote", "referral", array("type"=>"varchar"));
$installer->endSetup();

我正在尝试访问以下文件中的订单属性

  

C:\ xampp \ htdocs \ practice1 \ app \ code \ core \ Mage \ Adminhtml \ Block \ Widget \ Grid.php

0 个答案:

没有答案