1

I am using magento 1.9.3 version. I got the specific products details in json format. Now i want show all the products details in json format. I referred some more sites, There is not examples of these problem .

1

Below code snippet we can use for get all products into in json format.

$product = Mage::getModel('cetalog/product')->getCollection(); // This will return all products.
$product = $product->getData() // This will convert product collection into the array. 
return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($product)); // Return Json response from Controller 

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.