I am trying to ensure that at checkout all the data about the customer order is sent to our server using the POST rest API, However the product object is very complicated and using json_encode() on it, strips it down to only a couple of details. I would like to have all the details of a product object, in a nice json format during checkout, but so far the only way i have found is by using print_r($product,true) which basically sends the whole object to the api?

Is there any way i can send a nicely encoded json format, which has all the necessary product details? ( as mentioned, using json_encode on the product object strips away a lot of its useful details to only a couple of fields)

$jsonData = Mage::helper('core')->jsonEncode($product->getData());

getData() gives Product data in array format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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