1

I need to know how to retrieve each product's custom options (name/value) in an order.

For example in my order I have 1x product of lets say "Coloured Crayon". This product has a custom option of "Colour" which the customer selects when adding the product to their basket.

When I process the customer's order I would like to be able to retrieve the option name and option value.

Note 1 Using Magento 1.7 community edition, developing in .Net using SOAP with Magento API v2.

I discovered that a salesOrderEntity Items property called product_options contains what looks like a JSON encoded list of product option VALUES ONLY. This list contains no attribute names but instead has what looks like ID's where I'd think to see option names.

salesOrderEntity theOrder = apiService.salesOrderInfo(sSessionId, "100000001");      
string sProductOptions = theOrder.items[0].product_options; // returns JSON like string syntax
1
  • I can't even get started calling the Magento API via .NET. If you make progress, could you take a look at this question? stackoverflow.com/questions/12088459/… Commented Aug 23, 2012 at 19:25

1 Answer 1

2

After further investigation I've discovered that the response I am getting from the product_Options property is serialised php (wth?).

It looks something like this (similar to JSON) if you neaten it up:

a:3:{s:7:"colours";a:3:{i:0;s:4:"pink";i:1;s:6:"orange";i:2;s:3:"red";}s:6:"intkey";i:1;s:6:"colour";s:4:"blue";}

I've looked around and found a C# php serialiser/deserialiser and have successfully deserialised the response from the API.

Here is the link to the C# deserialiser.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.