From 3d0ad9f1be1e021d1e565f33bd9d7a169e8cce24 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sun, 16 Jun 2024 20:39:11 -0400 Subject: [PATCH] make sure to add the delivery_address to invoice on successful checkout modified: make_post_sell/views/cart.py --- make_post_sell/views/cart.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/make_post_sell/views/cart.py b/make_post_sell/views/cart.py index 5946390..42a67de 100644 --- a/make_post_sell/views/cart.py +++ b/make_post_sell/views/cart.py @@ -470,6 +470,10 @@ def cart_complete_checkout(request): invoice.handling_option = cart.handling_option invoice.handling_cost_in_cents = cart.handling_cost_in_cents + # Copy the user's active address to the invoice + if cart.physical_products: + invoice.delivery_address = request.user.active_address.data + for product, quantity in product_quantity_tuple: product.unlock_for_user(request.user) request.dbsession.add(product)