I have been trying to work out the correct way to add a configurable product to the cart via a custom end point.

$cart->addProduct($product, $params);

I want to know if it is okay for $product to be a simple product, or whether it is more correct for it to be the configurable product with the correct configurable attributes. Is there any difference, or advantage to either approach? Is it wrong to add a simple product to the cart like this, when it actually has a configurable product parent?

2 Answers 2


You can use either type, see Adding a product to the cart via querystring

To add a simple product with custom options simply add options[id]=[value] to the end. The basic structure is:


For adding a Configurable Product to the Cart via Querystring you need a url format like following



I believe it is better to add the simple product for the inventory, the picture in the cart in case of color declinaisons... By the way, I never tried to add the configurable with options. So I do not know what is the best or even if it is possible and I cannot try at the moment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.