solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Order controller populate method should be able to handle multiple variants

Open seand7565 opened this issue 4 years ago • 0 comments

I think there are a lot of circumstances where it's desirable for the order controller to be able to accept multiple variants. For instance, if I sell selectable "add-ons" or extras on a product page, that are separate products, I'd want to be able to add both the initial product and the add-on product to the cart at the same time, if it's selected.

I've made this change in other stores, and it's a pretty small one - order_controller just needs to be able to accept params[:variants] instead of params[:variant] and params[:quantity], then do the same action it's doing now, just looping over params[:variants]. Lots of people have custom frontends, so we'll need to deprecate this carefully, but it's a small change and introduces a lot of flexibility.

seand7565 avatar Mar 05 '21 19:03 seand7565