I'm now working on a feature that allows users to ...
# general
d
I'm now working on a feature that allows users to add some custom text input to specific product variants while ordering. My initial idea was to add a
settings:jsonb
column or an additional associated table to
spree_line_items
to store that custom user input. My question is if there is already a best practice for something like that or what would you guys do?
k
it is a bit undocumented but there’s this `options=` setter on line items that allows users to add arbitrary things to a line item. I think you can easily add this settings to the db, allow to set settings, and pass its value from the frontend in the options attributes.
🙌 1
Ah, this also recalulate the price of the line item, in case you have to adds some extra charge based on the settings.
d
Perfect. That helps, thank you 👍