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?

1 Answer 1

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.

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

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.