Is there a suggested method for populating the lin...
# support
e
Is there a suggested method for populating the line items of an order for checkout when they are ad hoc? In my situation, it's not like somebody's checking out with however many widgets, it's more that they are renting something with a rate that can change. One option is keeping the spree Items up to date with the existing things that can be rented. Another option would be to create items only when a checkout process has begun.
k
if you pass
options[:price]
when adding the line item to the cart, you can use a custom price for that line item. see • https://github.com/solidusio/solidus/blob/main/core/app/models/spree/line_item.rb#L116https://github.com/solidusio/solidus/blob/main/core/spec/models/spree/line_item_spec.rb#L128-L152
👍 1