1

There will be some products that are selectable on my product detail page which you can add cart with a dropdown. I mean there will be 2 products in cart. Maybe the customer doesnt want to add product on dropdown.

enter image description here

How can I add some products on the dropdown in product detail page?

2

You can always add more items to cart using the related_products field. You can take a look better in checkout/cart/add controller...

You can try it in your product view page something like this:

<input type="hidden" name="related_product" value="a valid product id here" />

This will add your current product and the one specified in the hidden field... U can use your select field normally just having the values as the product ids you want to use.

  • Your way worked very well, thanks. Can I do that with dropdown? – Ibrahim Mumcu Apr 21 '14 at 8:06
  • @ibrahim. Please mark this answer as selected if it solved your problem. – Marius Aug 25 '14 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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