GithubHelp home page GithubHelp logo

Comments (7)

simmsy avatar simmsy commented on August 14, 2024

@huoxito What are thoughts on this please? Cheers

from spree-product-assembly.

huoxito avatar huoxito commented on August 14, 2024

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.

from spree-product-assembly.

huoxito avatar huoxito commented on August 14, 2024

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.

from spree-product-assembly.

hipsterelitist avatar hipsterelitist commented on August 14, 2024

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

from spree-product-assembly.

huoxito avatar huoxito commented on August 14, 2024

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.

from spree-product-assembly.

cristianogregnanin avatar cristianogregnanin commented on August 14, 2024

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.

from spree-product-assembly.

yf6 avatar yf6 commented on August 14, 2024

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.

from spree-product-assembly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.