1

in my magento install, all products are configurable products where the size is the super attribute, a while ago i was naming the products [PRODUCT_CODE] - [COLOUR], like 999MBELT - Black however this would have the colour displace twice as the colour attribute was in the product description and was told to remove it

i have now been tasked with fixing the invoices by including what colour a product is, i know how to do this, i just have to edit the serialized string in sales_flat_order_item.product_options and change

s:15:"attributes_info";a:1:{i:0;a:2:{s:5:"label";s:4:"Size";s:5:"value";s:2:"58";}

to something like this

s:15:"attributes_info";a:2:{i:0;a:2:{s:5:"label";s:4:"Size";s:5:"value";s:2:"58";}i:1;a:2:{s:5:"label";s:6:"Colour";s:5:"value";s:10:"Dark Brown";}}

now i know how i'm going to go about doing this, the problem is that i can't find out where to put my code

so i'm wondering, where does magento serialize the original array and store in in sales_flat_order_item

1

1 Answer 1

2

found it, at least where it works for me, in app\code\core\Mage\Sales\Model\Convert\Quote.php there is a line $orderItem->setProductOptions($options);, in setProductOptions or in a function called by setProductOptions is where it serializes the data so all i needed to do was array_push into $options['attributes_info']

this is useful if you want to add other attributes like material only as a cosmetic thing for orders

Your Answer

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

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