fix for the cart checkout
This commit is contained in:
@@ -132,6 +132,10 @@ async fn checkout_page(
|
|||||||
"packeta_api_key": settings::get(&ctx, "packeta_api_key").unwrap_or(""),
|
"packeta_api_key": settings::get(&ctx, "packeta_api_key").unwrap_or(""),
|
||||||
"logged_in_admin": is_admin,
|
"logged_in_admin": is_admin,
|
||||||
"logged_in_customer": is_customer,
|
"logged_in_customer": is_customer,
|
||||||
|
// Required by the navbar profile menu (base.html includes it whenever
|
||||||
|
// logged_in_customer is true); None for admins/guests.
|
||||||
|
"customer_name": user.as_ref().filter(|_| is_customer).map(|u| u.name.clone()),
|
||||||
|
"customer_account_type": user.as_ref().filter(|_| is_customer).map(|u| u.account_type.clone()),
|
||||||
"profile_filled": profile_filled,
|
"profile_filled": profile_filled,
|
||||||
// A logged-in customer's account type is fixed; only guests pick it
|
// A logged-in customer's account type is fixed; only guests pick it
|
||||||
// and may opt to create an account from the order.
|
// and may opt to create an account from the order.
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
api_key: lo-95ec80d7-cb60-4b70-9b4b-9ef74cb88758
|
api_key: lo-95ec80d7-cb60-4b70-9b4b-9ef74cb88758
|
||||||
name: user1
|
name: user1
|
||||||
theme: light
|
theme: light
|
||||||
|
account_type: personal
|
||||||
created_at: "2023-11-12T12:34:56.789Z"
|
created_at: "2023-11-12T12:34:56.789Z"
|
||||||
updated_at: "2023-11-12T12:34:56.789Z"
|
updated_at: "2023-11-12T12:34:56.789Z"
|
||||||
- id: 3
|
- id: 3
|
||||||
@@ -15,5 +16,6 @@
|
|||||||
api_key: lo-153561ca-fa84-4e1b-813a-c62526d0a77e
|
api_key: lo-153561ca-fa84-4e1b-813a-c62526d0a77e
|
||||||
name: user2
|
name: user2
|
||||||
theme: light
|
theme: light
|
||||||
|
account_type: personal
|
||||||
created_at: "2023-11-12T12:34:56.789Z"
|
created_at: "2023-11-12T12:34:56.789Z"
|
||||||
updated_at: "2023-11-12T12:34:56.789Z"
|
updated_at: "2023-11-12T12:34:56.789Z"
|
||||||
|
|||||||
Reference in New Issue
Block a user