mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Ensure feature toggle works for non-logged-in users
This commit is contained in:
@@ -21,7 +21,7 @@ module Spree
|
||||
order.payment_required?
|
||||
}
|
||||
go_to_state :confirmation, if: ->(order) {
|
||||
Flipper.enabled? :split_checkout, order.user
|
||||
Flipper.enabled? :split_checkout
|
||||
}
|
||||
go_to_state :complete
|
||||
end
|
||||
|
||||
@@ -141,7 +141,7 @@ module Spree
|
||||
private
|
||||
|
||||
def validate_shipping_method!
|
||||
return unless user && Flipper.enabled?(:split_checkout, user)
|
||||
return unless Flipper.enabled?(:split_checkout)
|
||||
return if shipping_method.present?
|
||||
|
||||
errors.add :shipping_method, I18n.t('split_checkout.errors.select_a_shipping_method')
|
||||
@@ -149,7 +149,7 @@ module Spree
|
||||
end
|
||||
|
||||
def validate_payment_method!
|
||||
return unless user && Flipper.enabled?(:split_checkout, user)
|
||||
return unless Flipper.enabled?(:split_checkout)
|
||||
return if payments.any?
|
||||
|
||||
errors.add :payment_method, I18n.t('split_checkout.errors.select_a_payment_method')
|
||||
|
||||
Reference in New Issue
Block a user