So i have created a few products and added some data to it:
In my custom route i am then trying to get all products out using the following code:
$products = \Drupal\commerce_product\Entity\Product::loadMultiple();
$response['data'] = $products;
$response['method'] = 'GET';
return new JsonResponse($response);
However this returns the following reponse:
{"data":{"3":{},"6":{},"7":{}},"method":"GET"}
Can anyone tell me what ive done wrong?
