Compare commits
No commits in common. "1aa64a7396cf1bcbb0f3fc8f953c5cded4724b86" and "2d66529c9a5bd05722674de160612a413b7c4f53" have entirely different histories.
1aa64a7396
...
2d66529c9a
11 changed files with 44 additions and 181 deletions
|
|
@ -1237,31 +1237,21 @@ body.is-fullscreen {
|
||||||
border-top: var(--border-light);
|
border-top: var(--border-light);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[data-template=thanks] .thanks-page {
|
[data-template=thanks] .p__baseline-big {
|
||||||
min-height: 60vh;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: calc(var(--spacing) * 4) var(--spacing);
|
|
||||||
}
|
|
||||||
[data-template=thanks] .thanks-content {
|
|
||||||
text-align: center;
|
|
||||||
max-width: 600px;
|
|
||||||
}
|
|
||||||
[data-template=thanks] .thanks-content h1 {
|
|
||||||
font-size: var(--fs-x-big);
|
|
||||||
margin-bottom: calc(var(--spacing) * 2);
|
|
||||||
}
|
|
||||||
[data-template=thanks] .thanks-content .thanks-message {
|
|
||||||
font-size: var(--fs-big);
|
|
||||||
margin-bottom: calc(var(--spacing) * 3);
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
[data-template=thanks] .thanks-content .thanks-message p {
|
|
||||||
margin-bottom: var(--spacing);
|
|
||||||
}
|
|
||||||
[data-template=thanks] .thanks-content .thanks-actions {
|
|
||||||
margin-top: calc(var(--spacing) * 3);
|
margin-top: calc(var(--spacing) * 3);
|
||||||
|
margin-bottom: calc(var(--spacing) * 3);
|
||||||
|
}
|
||||||
|
[data-template=thanks] .p__baseline {
|
||||||
|
text-align: left;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: var(--spacing) auto;
|
||||||
|
}
|
||||||
|
[data-template=thanks] .p__baseline a {
|
||||||
|
color: var(--color-accent);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
[data-template=thanks] .p__baseline a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
[data-template=thanks] #site-footer {
|
[data-template=thanks] #site-footer {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,38 +1,29 @@
|
||||||
[data-template="thanks"] {
|
[data-template="thanks"]{
|
||||||
.thanks-page {
|
.p__baseline-big {
|
||||||
min-height: 60vh;
|
margin-top: calc(var(--spacing) * 3);
|
||||||
display: flex;
|
margin-bottom: calc(var(--spacing) * 3);
|
||||||
align-items: center;
|
// font-size: var(--fs-x-big);
|
||||||
justify-content: center;
|
}
|
||||||
padding: calc(var(--spacing) * 4) var(--spacing);
|
|
||||||
}
|
.p__baseline {
|
||||||
|
// font-size: var(--fs-big);
|
||||||
|
text-align: left;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: var(--spacing) auto;
|
||||||
|
|
||||||
.thanks-content {
|
a{
|
||||||
text-align: center;
|
color: var(--color-accent);
|
||||||
max-width: 600px;
|
text-decoration: none;
|
||||||
|
&:hover{
|
||||||
h1 {
|
text-decoration: underline;
|
||||||
font-size: var(--fs-x-big);
|
}
|
||||||
margin-bottom: calc(var(--spacing) * 2);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.thanks-message {
|
#site-footer{
|
||||||
font-size: var(--fs-big);
|
border-top: none;
|
||||||
margin-bottom: calc(var(--spacing) * 3);
|
margin-top: calc(var(--spacing) * 4);
|
||||||
line-height: 1.6;
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin-bottom: var(--spacing);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.thanks-actions {
|
}
|
||||||
margin-top: calc(var(--spacing) * 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#site-footer {
|
|
||||||
border-top: none;
|
|
||||||
margin-top: calc(var(--spacing) * 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,13 +4,6 @@ window.SnipcartSettings = {
|
||||||
loadStrategy: 'on-user-interaction',
|
loadStrategy: 'on-user-interaction',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Redirection après paiement réussi
|
|
||||||
document.addEventListener('snipcart.ready', function() {
|
|
||||||
Snipcart.execute('bind', 'order.completed', function(order) {
|
|
||||||
window.location.href = '/thanks?order=' + order.token;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
var c, d;
|
var c, d;
|
||||||
(d = (c = window.SnipcartSettings).version) != null || (c.version = '3.0');
|
(d = (c = window.SnipcartSettings).version) != null || (c.version = '3.0');
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
Title: Merci pour votre commande
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Text:
|
|
||||||
|
|
||||||
Votre commande a été confirmée ! Vous allez recevoir un email de confirmation sous peu.
|
|
||||||
|
|
||||||
Merci pour votre achat.
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
Title: Thank you for your order
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
Text:
|
|
||||||
|
|
||||||
Your order has been confirmed! You will receive a confirmation email shortly.
|
|
||||||
|
|
||||||
Thank you for your purchase.
|
|
||||||
|
|
@ -33,9 +33,6 @@ tabs:
|
||||||
fr: Partagé entre les versions FR et EN
|
fr: Partagé entre les versions FR et EN
|
||||||
translate: false
|
translate: false
|
||||||
width: 1/4
|
width: 1/4
|
||||||
space:
|
|
||||||
type: gap
|
|
||||||
width: 2/4
|
|
||||||
weight:
|
weight:
|
||||||
label:
|
label:
|
||||||
en: Weight (g)
|
en: Weight (g)
|
||||||
|
|
@ -48,42 +45,6 @@ tabs:
|
||||||
fr: Poids en grammes pour le calcul de la livraison
|
fr: Poids en grammes pour le calcul de la livraison
|
||||||
translate: false
|
translate: false
|
||||||
width: 1/4
|
width: 1/4
|
||||||
length:
|
|
||||||
label:
|
|
||||||
en: Length (cm)
|
|
||||||
fr: Longueur (cm)
|
|
||||||
type: number
|
|
||||||
min: 0
|
|
||||||
default: 0
|
|
||||||
help:
|
|
||||||
en: Package length in centimeters
|
|
||||||
fr: Longueur du colis en centimètres
|
|
||||||
translate: false
|
|
||||||
width: 1/4
|
|
||||||
width:
|
|
||||||
label:
|
|
||||||
en: Width (cm)
|
|
||||||
fr: Largeur (cm)
|
|
||||||
type: number
|
|
||||||
min: 0
|
|
||||||
default: 0
|
|
||||||
help:
|
|
||||||
en: Package width in centimeters
|
|
||||||
fr: Largeur du colis en centimètres
|
|
||||||
translate: false
|
|
||||||
width: 1/4
|
|
||||||
height:
|
|
||||||
label:
|
|
||||||
en: Height (cm)
|
|
||||||
fr: Hauteur (cm)
|
|
||||||
type: number
|
|
||||||
min: 0
|
|
||||||
default: 0
|
|
||||||
help:
|
|
||||||
en: Package height in centimeters
|
|
||||||
fr: Hauteur du colis en centimètres
|
|
||||||
translate: false
|
|
||||||
width: 1/4
|
|
||||||
description:
|
description:
|
||||||
label: Description panier
|
label: Description panier
|
||||||
type: writer
|
type: writer
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
title:
|
|
||||||
en: Thank you
|
|
||||||
fr: Merci
|
|
||||||
icon: check
|
|
||||||
|
|
||||||
tabs:
|
|
||||||
content:
|
|
||||||
label:
|
|
||||||
en: Content
|
|
||||||
fr: Contenu
|
|
||||||
fields:
|
|
||||||
text:
|
|
||||||
label:
|
|
||||||
en: Message
|
|
||||||
fr: Message
|
|
||||||
type: writer
|
|
||||||
|
|
@ -106,15 +106,12 @@ return [
|
||||||
$order = $event['content'] ?? null;
|
$order = $event['content'] ?? null;
|
||||||
|
|
||||||
if ($order && isset($order['items'])) {
|
if ($order && isset($order['items'])) {
|
||||||
// Impersonate pour avoir les permissions d'écriture
|
|
||||||
kirby()->impersonate('kirby');
|
|
||||||
|
|
||||||
foreach ($order['items'] as $item) {
|
foreach ($order['items'] as $item) {
|
||||||
$productId = $item['id'] ?? null;
|
$productId = $item['id'] ?? null;
|
||||||
$quantity = $item['quantity'] ?? 0;
|
$quantity = $item['quantity'] ?? 0;
|
||||||
|
|
||||||
if ($productId && $quantity > 0) {
|
if ($productId && $quantity > 0) {
|
||||||
// Trouver le produit par son slug
|
// Trouver le produit par son snipcartId
|
||||||
$products = site()->index()->filterBy('intendedTemplate', 'product');
|
$products = site()->index()->filterBy('intendedTemplate', 'product');
|
||||||
|
|
||||||
foreach ($products as $product) {
|
foreach ($products as $product) {
|
||||||
|
|
@ -123,16 +120,12 @@ return [
|
||||||
$currentStock = (int) $product->stock()->value();
|
$currentStock = (int) $product->stock()->value();
|
||||||
$newStock = max(0, $currentStock - $quantity);
|
$newStock = max(0, $currentStock - $quantity);
|
||||||
|
|
||||||
// Mettre à jour le stock
|
// Mettre à jour le stock dans toutes les langues
|
||||||
try {
|
$product->update([
|
||||||
$product->update([
|
'stock' => $newStock
|
||||||
'stock' => $newStock
|
]);
|
||||||
]);
|
|
||||||
} catch (Exception $e) {
|
|
||||||
// Log l'erreur mais continue le traitement
|
|
||||||
error_log('Webhook stock update error: ' . $e->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
kirby()->impersonate('kirby');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,6 @@
|
||||||
data-item-name="<?= $page->title()->html() ?>"
|
data-item-name="<?= $page->title()->html() ?>"
|
||||||
data-item-shippable="true"
|
data-item-shippable="true"
|
||||||
data-item-weight="<?= $page->weight()->or(0) ?>"
|
data-item-weight="<?= $page->weight()->or(0) ?>"
|
||||||
data-item-length="<?= $page->length()->or(0) ?>"
|
|
||||||
data-item-width="<?= $page->width()->or(0) ?>"
|
|
||||||
data-item-height="<?= $page->height()->or(0) ?>"
|
|
||||||
<?php
|
<?php
|
||||||
if($page->hasOptions()->toBool() && $page->optionValues()->isNotEmpty()):
|
if($page->hasOptions()->toBool() && $page->optionValues()->isNotEmpty()):
|
||||||
$values = $page->optionValues()->split(',');
|
$values = $page->optionValues()->split(',');
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
<?php snippet('header', ['title' => $page->title()]) ?>
|
|
||||||
|
|
||||||
<main>
|
|
||||||
<section class="thanks-page">
|
|
||||||
<div class="thanks-content">
|
|
||||||
<h1><?= $page->title()->html() ?></h1>
|
|
||||||
|
|
||||||
<?php if($page->text()->isNotEmpty()): ?>
|
|
||||||
<div class="thanks-message">
|
|
||||||
<?= $page->text()->kt() ?>
|
|
||||||
</div>
|
|
||||||
<?php endif ?>
|
|
||||||
|
|
||||||
<div class="thanks-actions">
|
|
||||||
<a href="<?= $site->homePage()->url() ?>" class="btn__default">
|
|
||||||
<span class="icon">
|
|
||||||
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="m9.474 5.209s-4.501 4.505-6.254 6.259c-.147.146-.22.338-.22.53s.073.384.22.53c1.752 1.754 6.252 6.257 6.252 6.257.145.145.336.217.527.217.191 0 .383-.072.53-.221.293-.293.294-.766.004-1.057l-4.976-4.976h14.692c.414 0 .75-.336.75-.75s-.336-.75-.75-.75h-14.692l4.978-4.979c.289-.289.287-.761-.006-1.054-.147-.147-.339-.221-.53-.221-.191 0-.38.071-.525.215z" fill-rule="nonzero" />
|
|
||||||
</svg>
|
|
||||||
</span>
|
|
||||||
<div class="txt"><?= t('backToShop', 'Retour à la boutique') ?></div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<?php snippet('footer') ?>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue