CZK implemented
This commit is contained in:
@@ -4,7 +4,9 @@ use axum_extra::extract::cookie::CookieJar;
|
||||
use loco_rs::prelude::*;
|
||||
use serde_json::json;
|
||||
|
||||
use crate::{controllers::i18n::current_lang, shared::guard, controllers::shop};
|
||||
use crate::{
|
||||
controllers::i18n::current_lang, controllers::shop, shared::currency, shared::guard,
|
||||
};
|
||||
|
||||
#[debug_handler]
|
||||
async fn index(
|
||||
@@ -13,7 +15,8 @@ async fn index(
|
||||
State(ctx): State<AppContext>,
|
||||
) -> Result<Response> {
|
||||
let user = guard::current_user(&ctx, &jar).await;
|
||||
let products = shop::featured_products(&ctx, user.as_ref(), 8).await?;
|
||||
let cur = currency::resolve(&ctx, &jar).await;
|
||||
let products = shop::featured_products(&ctx, user.as_ref(), 8, &cur).await?;
|
||||
let c = guard::chrome_from(&ctx, user.as_ref());
|
||||
|
||||
format::view(
|
||||
@@ -25,6 +28,7 @@ async fn index(
|
||||
"logged_in_customer": c.logged_in_customer,
|
||||
"customer_name": c.customer_name,
|
||||
"customer_account_type": c.customer_account_type,
|
||||
"currency_symbol": cur.symbol,
|
||||
"lang": current_lang(&jar),
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user