When adding an item that already exists in the cart, Workarea previously checked the SKU and customizations on the item before deciding whether to actually build a new Order::Item or update the one found in place. This is somewhat limiting for plugins such as Workarea::Subscriptions, which add more data to an order item that is expected to be updated in place (so long as the item is a subscription). To address this, a configuration setting has been added which plugins and apps can append to in order to affect the "uniqueness" of a particular order item. By appending to this config, both host apps and plugins can tell the Order::ItemsExtension#find_existing method to factor in additional fields on the order when determining whether a given item exists in the cart or not.
@mttdffy I'm down for that, the ItemsExtension thing has always bugged me. I remember having to/wanting to decorate that in the past and finding it quite impossible.
When adding an item that already exists in the cart, Workarea previously checked the SKU and customizations on the item before deciding whether to actually build a new
Order::Item
or update the one found in place. This is somewhat limiting for plugins such asWorkarea::Subscriptions
, which add more data to an order item that is expected to be updated in place (so long as the item is a subscription). To address this, a configuration setting has been added which plugins and apps can append to in order to affect the "uniqueness" of a particular order item. By appending to this config, both host apps and plugins can tell theOrder::ItemsExtension#find_existing
method to factor in additional fields on the order when determining whether a given item exists in the cart or not.