Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove split checkout toggle and legacy checkout #10913

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,16 @@ Metrics/BlockLength:
- 'spec/factories/user_factory.rb'
- 'spec/factories/variant_factory.rb'
- 'spec/requests/api/orders_spec.rb'
- 'spec/requests/checkout/failed_checkout_spec.rb'
- 'spec/requests/checkout/stripe_sca_spec.rb'
- 'spec/support/cancan_helper.rb'
- 'spec/support/matchers/select2_matchers.rb'
- 'spec/support/matchers/table_matchers.rb'
- 'spec/swagger_helper.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
- 'spec/system/consumer/shopping/checkout_stripe_spec.rb'
- 'spec/system/consumer/shopping/variant_overrides_spec.rb'
- 'spec/system/consumer/split_checkout_tax_not_incl_spec.rb'

# Offense count: 1
# Configuration parameters: CountBlocks, Max.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

187 changes: 0 additions & 187 deletions app/controllers/checkout_controller.rb

This file was deleted.

8 changes: 0 additions & 8 deletions app/controllers/concerns/order_stock_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ def valid_order_line_items?
def handle_insufficient_stock
return if sufficient_stock?

reset_order_to_cart

flash[:error] = Spree.t(:inventory_error_flash_for_insufficient_quantity)
redirect_to main_app.cart_path
end
Expand Down Expand Up @@ -43,10 +41,4 @@ def check_order_cycle_expiry
def sufficient_stock?
@sufficient_stock ||= @order.insufficient_stock_lines.blank?
end

def reset_order_to_cart
return if OpenFoodNetwork::FeatureToggle.enabled? :split_checkout, spree_current_user

OrderCheckoutRestart.new(@order).call
end
end
4 changes: 2 additions & 2 deletions app/controllers/payment_gateways/paypal_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def express
flash[:error] =
Spree.t('flash.generic_error', scope: 'paypal',
reasons: pp_response.errors.map(&:long_message).join(" "))
redirect_to main_app.checkout_state_path(:payment)
redirect_to main_app.checkout_step_path(:payment)
end
rescue SocketError
flash[:error] = Spree.t('flash.connection_failed', scope: 'paypal')
redirect_to main_app.checkout_state_path(:payment)
redirect_to main_app.checkout_step_path(:payment)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/spree/orders_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def update
format.html do
if params.key?(:checkout)
@order.next_transition.run_callbacks if @order.cart?
redirect_to main_app.checkout_state_path(@order.checkout_steps.first)
redirect_to main_app.checkout_step_path(@order.checkout_steps.first)
elsif @order.complete?
redirect_to main_app.order_path(@order)
else
Expand Down
Loading