I am implementing a rentals site where one can rent a vehicle. They require some minimum level of insurance. I'm thinking each insurance level will be set up as its own product.
I am able to check for the required level of insurance in add/update hooks, checking that for each vehicle in the cart, there's also an insurance product of at least the minimum coverage. This works fine, but I also need a way to associate the insurance CartItem with the vehicle's CartItem in case they rent multiple vehicles with different insurance levels.
Would this be an appropriate place to use setVirtualColumns()? Is that data persisted? Is it also available after payment, e.g. for receipt/invoicing purposes?
Instead of creating specific insurance levels products, why don't you use the attributes to attach insurance levels to insurable products ?
1) Define an "insurance level" attribute. 2) Create a product template "Insurable", and attach the "insurance level" attribute to it. 3) For insurable products, select the "Insurable" template. 4) Manually or using the attribute combination builder, create all required insurance level for each vehicle 5) Enter prices for each insurance level.
This way, your customers will always have to select an insurance level to add a vehicle in the cart, and you'll be sure that the proper level is attached to a vehicule, from the cart to the PDF invoice.
Insurance needs to be its own line-item. It seems like attribute combinations only provide a way to lump the insurance in with the price of a vehicle, but am I wrong about that?
I'd also appreciate (and I'm sure my client would too) not having to configure what amounts to basically the same price for every insurance level for every product. In the client's business model, it really is more like its own product that just happens to be required.
That said, what is the use-case for virtual columns?
Basically, you have to write a module to persist in a table the relationship between a vehicle product and the related insurance product, and write a loop to display them on the various places it should appear (cart, checkout page, invoice, order notification mail, etc.).