mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-07 07:36:58 +00:00
Do not error when checking out with a pre-loaded shipping/billing address
This commit is contained in:
@@ -32,6 +32,10 @@ Darkswarm.factory 'Checkout', (CurrentOrder, ShippingMethods, PaymentMethods, $h
|
||||
|
||||
if @ship_address_same_as_billing
|
||||
munged_order.ship_address_attributes = munged_order.bill_address_attributes
|
||||
# If the order already has a ship and bill address (as with logged in users with
|
||||
# past orders), and we don't remove id here, then this will set the wrong id for
|
||||
# ship address, and Rails will error with a 404 for that address.
|
||||
delete munged_order.ship_address_attributes.id
|
||||
|
||||
if @paymentMethod()?.method_type == 'gateway'
|
||||
angular.extend munged_order.payments_attributes[0], {
|
||||
|
||||
Reference in New Issue
Block a user