Skip to content

Commit

Permalink
simplify require_shipping? check in PaypalOrder with separated step_n…
Browse files Browse the repository at this point in the history
…ames method
  • Loading branch information
retsef authored and elia committed Nov 22, 2022
1 parent 2b9ef4c commit 7f1439a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/solidus_paypal_commerce_platform/paypal_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ def application_context
end

def require_shipping?
step_names = @order ? @order.checkout_steps : ::Spree::Order.checkout_steps.keys
step_names.include? :delivery
end

step_names.include? 'delivery'
def step_names
@order ? @order.checkout_steps.map(&:to_sym) : ::Spree::Order.checkout_steps.keys
end
end
end

0 comments on commit 7f1439a

Please sign in to comment.