In some use cases, you will link a visitor to your site when they directly add a product to the cart; for example, when you have a campaign with a buy now button on an external website.
Open your browser with your shop and navigate to Catalog | Manage Products in the backend.
In the next steps, we will create a URL where a product will be added to the cart:
Find a product in your frontend you want to add to the cart. For example, navigate to Furniture | Living Room | Ottoman.
Find this product in the backend and keep the ID in mind.
To add a product, we have to call the
checkout/cart/add
URL with the product ID as theGET
parameter. So, the final URL will behttp://magento-dev.local/checkout/cart/add?product=51
.While calling this URL, you will be redirected to the cart page with one item of this product in the cart.
When you add the
qty
parameter to the query, you can add more than one item of the same product to the...