0

Hi i need to view one additional product attribute in magento admin panel. i need to get info_buyRequest->projectid. My database table is sales_flat_order_item my field Name is product_options

My record is given below

a:7:{s:15:"info_buyRequest";a:9:{s:2:"id";s:3:"715";s:7:"product";s:3:"288";s:15:"related_product";s:0:"";s:15:"super_attribute";a:2:{i:143;s:2:"69";i:144;s:2:"71";}s:7:"options";a:4:{i:79;s:3:"165";i:80;s:3:"166";i:78;s:3:"163";i:81;s:3:"359";}s:15:"attachment_hash";a:1:{i:215;s:32:"cbe019a075d376c0632dae49774370bb";}s:9:"projectid";s:2:"39";s:3:"qty";i:1;s:11:"reset_count";b:1;}s:7:"options";a:4:{i:0;a:7:{s:5:"label";s:7:"Coating";s:5:"value";s:21:"UV - Ultra High Gloss";s:11:"print_value";s:21:"UV - Ultra High Gloss";s:9:"option_id";s:2:"79";s:11:"option_type";s:9:"drop_down";s:12:"option_value";s:3:"165";s:11:"custom_view";b:0;}i:1;a:7:{s:5:"label";s:6:"Colors";s:5:"value";s:18:"Full Color 2 Sides";s:11:"print_value";s:18:"Full Color 2 Sides";s:9:"option_id";s:2:"80";s:11:"option_type";s:9:"drop_down";s:12:"option_value";s:3:"166";s:11:"custom_view";b:0;}i:2;a:7:{s:5:"label";s:5:"Paper";s:5:"value";s:20:"14pt Thick Cardstock";s:11:"print_value";s:20:"14pt Thick Cardstock";s:9:"option_id";s:2:"78";s:11:"option_type";s:9:"drop_down";s:12:"option_value";s:3:"163";s:11:"custom_view";b:0;}i:3;a:7:{s:5:"label";s:13:"Need a Design";s:5:"value";s:20:"Yes, I need a Design";s:11:"print_value";s:20:"Yes, I need a Design";s:9:"option_id";s:2:"81";s:11:"option_type";s:9:"drop_down";s:12:"option_value";s:3:"359";s:11:"custom_view";b:0;}}s:15:"attributes_info";a:2:{i:0;a:2:{s:5:"label";s:8:"Quantity";s:5:"value";s:4:"1000";}i:1;a:2:{s:5:"label";s:10:"Turnaround";s:5:"value";s:15:"4 Business Days";}}s:11:"simple_name";s:34:"2.75x4 Flyers-1000-4 Business Days";s:10:"simple_sku";s:33:"275x4-flyers-1000-4 Business Days";s:20:"product_calculations";i:1;s:13:"shipment_type";i:0;}

I need to get projectid in magento admin panel

admin/sales_order/view/order_id/43/ page

How can i get it please advise...

2 Answers 2

0

Take a look getAdditionalData() in Mage_Sales_Model_Order_Item

Try

$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
$items = $order->getAllVisibleItems();

foreach ($items as $itemId => $item){
    $item->getAdditionalData('projectid')
}
0
0

If you are using Magento version 2, just load the order by the order_id from the order repository. After doing so, you will get the info_buyrequest inside the data, which you can get by getBuyRequest(), and deserialize it by using json_decode or calling the Magento tools. The data you are showing from buy_request is from Magento version 1, which uses the PHP deserializer to do it, and it is not supported in Magento version 2.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.