0

I need to add additional information for Magento attribute set, like when i add custom attribute for invoice like this:

Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array(
 'type' => 'datetime',
 'backend_type' => 'datetime',
 'frontend_input' => 'datetime',
 'is_user_defined' => true,
 'label' => 'Last Sync',
 'visible' => true,
 'required' => false,
 'user_defined' => false,
 'searchable' => true,
 'filterable' => true,
 'comparable' => true,
 'default' => NULL
);
$installer->addAttribute('invoice', 'last_sync', $attribute); 
$installer->endSetup();

so i can load the data like this:

$attributeSetCollection = Mage::getResourceModel('eav/entity_attribute_set_collection');
foreach ($attributeSetCollection as $id=>$attributeSet) { 
 $lastSync = $attributeSet->getLastSync();
}
Rahul Singh
1,6702 gold badges20 silver badges40 bronze badges
asked May 30, 2018 at 7:22

1 Answer 1

0

I think you're trying to say that you want to load a custom attribute from an invoice to get it's value. The example you have going on is not what you're looking for, if that's the case.

$invoice = Mage::getModel('sales/invoice')->load( .. );
$invoice->getLastSync(); // this will retrieve the new invoice attribute value for the invoice

If this is not what you're looking for please clarify your question.

answered May 31, 2018 at 12:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.