Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to create Kits using Products and let the user pick the variant #75

Open
peterberkenbosch opened this issue May 8, 2014 · 7 comments

Comments

@peterberkenbosch
Copy link
Member

Add the ability to create Kits using Products, thereby letting the user select the product's variant from the options provided.

An example would be a Snow Board and Bindings. The User would be required to select the size of Snowboard and also the size of Binding to build the Kit.

@peterberkenbosch peterberkenbosch changed the title [feature] Add the ability to create Kits using Products and let the user pick the variant Add the ability to create Kits using Products and let the user pick the variant May 8, 2014
@simmsy
Copy link

simmsy commented May 22, 2014

@huoxito What are thoughts on this please? Cheers

@huoxito
Copy link

huoxito commented May 22, 2014

Hey @simmsy I haven't really had any chance to take a deeper look at this to reply with ideas and examples on how to achieve it but I will take a look once I'm back home on Monday. We're at Spree Team week until tomorrow.

@huoxito
Copy link

huoxito commented Jun 2, 2014

Hey @simmsy finally looked for a bit to into what I'd change to have that feature here.

First thing we need to allow users to select a general product on backend "products/:product_id/parts". Right now you need to pick a variant. We should make it so that something like let customer choose shows up on the Options dropdown for that page. Of course besides changing the UI we need to make the backend code handle that. We could pass a variant_id and a product_id so we'd know where to look. See this piece of code here.

Considering the admin user is able to also add a product to a bundle. Then we need to make the OrderContents object in spree core smarter (or extend it) to build the LineItem#parts on the fly. For example: Customer would pick which variants available for the bundle they want to purchase. Once they click the Add to Cart button we would persist those variant ids in some new table associated to line items or perhaps an attribute on the line item itself.

By doing that we should be able to change the implementation of this method to return those parts chosen by the customer when necessary. So any time spree builds the shipments it should gracefully pick the proper variants and we wouldn't have to change much, perhaps very little of the Packer and Spree::Stock logic in general. See this code for reference on how this extension currently build the parts for a bundle / kit. It all starts by fetching the parts of the line items.

That is the approach I'd take to add the feature to this extension. Can't say I'm 100% sure that is the best way to do it without actually doing it and see if any challenges come up. Over all I think it's a great feature and surely could be implemented using the current product-assembly code base. No idea when or if this will get in here any time soon though but wanted to log my thoughts in case someone else of even me what to give that a try in the future.

@hipsterelitist
Copy link

@huoxito Hey, I was just wondering how your strategy for this would change now that the Packer uses InventoryUnits instead of LineItems.

@huoxito
Copy link

huoxito commented Jan 14, 2015

hey @hipsterelitist, I probably know less about this extension now than when I wrote that but I think I'd still start using the same line of thought more or less, perhaps now it would build the parts earlier on the InventoryUnitBuilder and the change from LineItem to InventoryUnit on the Packer should make this easier to implement.

@cristianogregnanin
Copy link

Hi, have you some update for this issue? My ecommerce sells computers and users want to customize
the computers with Ram, cpu, Hdd,.... Every component can be sell or can be sell in a bundle (computer).
Example: I can sell a Ram product or I can give the user the ability to customize him computer with a Ram. The Ram product is the same.

@yf6
Copy link

yf6 commented Feb 3, 2017

It's been a while so I don't remember the details, but I believe this commit in master allows user to select the variant in a bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants