magento - Access custom order attributes -
i have created 3 custom order attributes sales_person_name, sales_type, referral
i trying access them in different module.
can tell me how access order attributes in different module
do have call model
i tried
$order = mage::getmodel('sales/order')->load($order);
and got below output cant data in it.
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 ) )
i created order attributes follows
<?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();
i trying access order attributes in below file
c:\xampp\htdocs\practice1\app\code\core\mage\adminhtml\block\widget\grid.php
Comments
Post a Comment