Magento 2 print product, customer, order object

Conman problem while we are writing some custom code in magento 2 for print any  object. Request go to the infinite look and memory issue.

For resolve the issue i found some workaround debug() method. You can find code in

https://github.com/magento/magento2/blob/2.3-develop/lib/internal/Magento/Framework/DataObject.php#L461-L489

For print any object you can use below code.

$object->debug();

For example if we want to print product object:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get(‘Magento\Catalog\Model\ProductFactory’);
$product->debug();

Magento 2 API postman collection for cart

Hello everyone here i am posting Postman collection for magento cart process. This collection have below methods.

  • Login customer
  • Create cart
  • Add Simple product to cart
  • Add configurable product to the cart

 

https://www.getpostman.com/collections/a7900127aac366535a20

I will post some more collection for magento 2 API once i will be ready.