Log in
Model

BuyRequestBuilder

Magento\Quote\Model\Cart\BuyRequest\BuyRequestBuilder

What it does

This class constructs a buy request DataObject used when adding products to a shopping cart in Magento 2.

Developers use this when programmatically adding items to quotes/carts, as it gathers product quantity and additional data from registered providers (like custom options, configurable attributes) into a standardized format required by Quote::addProduct().

Public Methods

  • build()