You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
lang-js
$produto[0], though, would it? Edit: Oh, yes, I see, it would be. Probably make more sense just to drop the[]:$produto = array('sku' => $product->getSku(), 'name' => $product->getName()); echo(json_encode($produto));$produto[]to assign another array,$produto[0]isn't wrong here. It would work. But if he want to have more products there, he have to useecho json_encode($produto);and do more actions on JS side ... but that belongs to the usecase. @T.J.Crowder