We currently have an offer intended to only match specific products.
We took a shortcut here and made it have a Product autocomplete for selecting the products in question.
This can't scale because people will want to use all kinds of conditions to select products (select by category, field, etc).
We need to remove the product setting, and make offers have an entity_type defined in their annotation.
If the entity type is order item, the Promotion should pass only the order items that matched the product conditions to the offer (invoking it once per matching order item).
We'll want to share an update hook with #2885398: Remove the commerce_promotion_ prefix from condition and offer plugin IDs that will resave promotions so that the offer setting is removed, but a product condition is added in its place.
Comments
Comment #2
bojanz commentedMerging #2885398: Remove the commerce_promotion_ prefix from condition and offer plugin IDs into this issue. And preparing a patch.
Comment #3
bojanz commentedBetter title. We want to remove context, pass the entity directly.
Comment #4
bojanz commentedGreen on Travis: https://github.com/drupalcommerce/commerce/tree/offers
Needs an update function.
Comment #5
finneCode looks good, and yes, needs update
Comment #6
finneComment #8
bojanz commentedDone. Thanks for reviewing, finne!