whole eshop is now in euro
This commit is contained in:
@@ -16,7 +16,6 @@ pub struct Model {
|
||||
pub customer_name: Option<String>,
|
||||
pub status: String,
|
||||
pub total_cents: i64,
|
||||
pub currency: String,
|
||||
pub address: Option<String>,
|
||||
pub city: Option<String>,
|
||||
pub zip: Option<String>,
|
||||
|
||||
@@ -17,7 +17,6 @@ pub struct Model {
|
||||
pub description: Option<String>,
|
||||
#[sea_orm(column_type = "Text", nullable)]
|
||||
pub short_description: Option<String>,
|
||||
pub currency: String,
|
||||
pub view_count: i32,
|
||||
pub published: bool,
|
||||
pub published_at: Option<DateTimeWithTimeZone>,
|
||||
|
||||
@@ -53,7 +53,6 @@ pub async fn place(
|
||||
let txn = ctx.db.begin().await?;
|
||||
|
||||
let mut subtotal: i64 = 0;
|
||||
let mut currency = "EUR".to_string();
|
||||
let mut snapshots = Vec::new();
|
||||
for (variant_id, qty) in items {
|
||||
let variant = product_variants::Entity::find_by_id(*variant_id)
|
||||
@@ -75,7 +74,6 @@ pub async fn place(
|
||||
)));
|
||||
}
|
||||
}
|
||||
currency = product.currency.clone();
|
||||
// Snapshot the price the buyer actually pays — public sale or, for a
|
||||
// business account, their negotiated/lowest price (same resolver the
|
||||
// cart and storefront use).
|
||||
@@ -98,7 +96,6 @@ pub async fn place(
|
||||
customer_name: Set(details.customer_name),
|
||||
status: Set("pending".to_string()),
|
||||
total_cents: Set(subtotal + details.method.price_cents),
|
||||
currency: Set(currency),
|
||||
user_id: Set(details.user_id),
|
||||
account_type: Set(details.account_type),
|
||||
company_name: Set(details.company_name),
|
||||
|
||||
@@ -57,7 +57,7 @@ impl Entity {
|
||||
let sql = format!(
|
||||
r#"
|
||||
SELECT p.created_at, p.updated_at, p.id, p.name, p.slug, p.description,
|
||||
p.currency, p.view_count, p.published, p.published_at, p.category_id
|
||||
p.short_description, p.view_count, p.published, p.published_at, p.category_id
|
||||
FROM products p
|
||||
WHERE {published_clause} (
|
||||
p.search_vector @@ websearch_to_tsquery('sk_unaccent', $1)
|
||||
|
||||
Reference in New Issue
Block a user