mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Add per-channel promotion rule checkers and actions for customer groups, nth orders, shipping countries, and products
This commit is contained in:
parent
0d65def47e
commit
37311393b3
1 changed files with 36 additions and 36 deletions
|
|
@ -94,23 +94,47 @@ return static function (ContainerConfigurator $container) {
|
|||
->tag('sylius.promotion_rule_checker', ['type' => 'customer_group', 'label' => 'sylius.form.promotion_rule.customer_group', 'form_type' => CustomerGroupConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.customer_group_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.customer_group')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'customer_group_per_channel', 'label' => 'sylius.form.promotion_rule.customer_group_per_channel', 'form_type' => ChannelBasedCustomerGroupConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.nth_order', NthOrderRuleChecker::class)
|
||||
->args([service('sylius.repository.order')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'nth_order', 'label' => 'sylius.form.promotion_rule.nth_order', 'form_type' => NthOrderConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.nth_order_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.nth_order')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'nth_order_per_channel', 'label' => 'sylius.form.promotion_rule.nth_order_per_channel', 'form_type' => ChannelBasedNthOrderConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.shipping_country', ShippingCountryRuleChecker::class)
|
||||
->args([service('sylius.repository.country')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'shipping_country', 'label' => 'sylius.form.promotion_rule.shipping_country', 'form_type' => ShippingCountryConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.shipping_country_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.shipping_country')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'shipping_country_per_channel', 'label' => 'sylius.form.promotion_rule.shipping_country_per_channel', 'form_type' => ChannelBasedShippingCountryConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.has_taxon', HasTaxonRuleChecker::class)
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'has_taxon', 'label' => 'sylius.form.promotion_rule.has_at_least_one_from_taxons', 'form_type' => HasTaxonConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.has_taxon_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.has_taxon')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'has_taxon_per_channel', 'label' => 'sylius.form.promotion_rule.has_at_least_one_from_taxons_per_channel', 'form_type' => ChannelBasedHasTaxonConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.total_of_items_from_taxon', TotalOfItemsFromTaxonRuleChecker::class)
|
||||
->args([service('sylius.repository.taxon')])
|
||||
|
|
@ -122,6 +146,12 @@ return static function (ContainerConfigurator $container) {
|
|||
->tag('sylius.promotion_rule_checker', ['type' => 'contains_product', 'label' => 'sylius.form.promotion_rule.contains_product', 'form_type' => ContainsProductConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.contains_product_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.contains_product')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'contains_product_per_channel', 'label' => 'sylius.form.promotion_rule.contains_product_per_channel', 'form_type' => ChannelBasedContainsProductConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.item_total', ItemTotalRuleChecker::class)
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'item_total', 'label' => 'sylius.form.promotion_rule.item_total', 'form_type' => ChannelBasedItemTotalConfigurationType::class])
|
||||
|
|
@ -132,36 +162,6 @@ return static function (ContainerConfigurator $container) {
|
|||
->tag('sylius.promotion_rule_checker', ['type' => 'cart_quantity', 'label' => 'sylius.form.promotion_rule.cart_quantity', 'form_type' => CartQuantityConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.customer_group_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.customer_group')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'customer_group_per_channel', 'label' => 'sylius.form.promotion_rule.customer_group_per_channel', 'form_type' => ChannelBasedCustomerGroupConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.nth_order_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.nth_order')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'nth_order_per_channel', 'label' => 'sylius.form.promotion_rule.nth_order_per_channel', 'form_type' => ChannelBasedNthOrderConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.shipping_country_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.shipping_country')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'shipping_country_per_channel', 'label' => 'sylius.form.promotion_rule.shipping_country_per_channel', 'form_type' => ChannelBasedShippingCountryConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.has_taxon_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.has_taxon')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'has_taxon_per_channel', 'label' => 'sylius.form.promotion_rule.has_at_least_one_from_taxons_per_channel', 'form_type' => ChannelBasedHasTaxonConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.contains_product_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.contains_product')])
|
||||
->tag('sylius.promotion_rule_checker', ['type' => 'contains_product_per_channel', 'label' => 'sylius.form.promotion_rule.contains_product_per_channel', 'form_type' => ChannelBasedContainsProductConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.checker.promotion_rule.cart_quantity_per_channel', PerChannelRuleChecker::class)
|
||||
->args([service('sylius.checker.promotion_rule.cart_quantity')])
|
||||
|
|
@ -201,6 +201,12 @@ return static function (ContainerConfigurator $container) {
|
|||
->tag('sylius.promotion_action', ['type' => 'order_percentage_discount', 'label' => 'sylius.form.promotion_action.order_percentage_discount', 'form_type' => PercentageDiscountConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.command.promotion_action.percentage_discount_per_channel', PerChannelPromotionActionCommand::class)
|
||||
->args([service('sylius.command.promotion_action.percentage_discount')])
|
||||
->tag('sylius.promotion_action', ['type' => 'order_percentage_discount_per_channel', 'label' => 'sylius.form.promotion_action.order_percentage_discount_per_channel', 'form_type' => ChannelBasedPercentageDiscountConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.command.promotion_action.unit_percentage_discount', UnitPercentageDiscountPromotionActionCommand::class)
|
||||
->args([
|
||||
|
|
@ -218,12 +224,6 @@ return static function (ContainerConfigurator $container) {
|
|||
->tag('sylius.promotion_action', ['type' => 'shipping_percentage_discount', 'label' => 'sylius.form.promotion_action.shipping_percentage_discount', 'form_type' => PercentageDiscountConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.command.promotion_action.percentage_discount_per_channel', PerChannelPromotionActionCommand::class)
|
||||
->args([service('sylius.command.promotion_action.percentage_discount')])
|
||||
->tag('sylius.promotion_action', ['type' => 'order_percentage_discount_per_channel', 'label' => 'sylius.form.promotion_action.order_percentage_discount_per_channel', 'form_type' => ChannelBasedPercentageDiscountConfigurationType::class])
|
||||
;
|
||||
|
||||
$services
|
||||
->set('sylius.command.promotion_action.shipping_percentage_discount_per_channel', PerChannelPromotionActionCommand::class)
|
||||
->args([service('sylius.command.promotion_action.shipping_percentage_discount')])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue