Aller au contenu

🛒 PanierGratuit · 0 NahnahPar NAHNAH

Récapitulatif du panier en bento

Le résumé du panier en tuiles bento qui apparaissent en cascade : grand total réel, nombre d’articles, vignettes empilées des produits, tes infos livraison et retours (textes réglables), et une tuile bouton vers le paiement.

Aperçu en direct

Données de démonstration (produits, menus, textes d’exemple) : dans ta boutique, ce sont les tiennes.

Photos : Unsplash / Pexels (exemples de l’aperçu, jamais inclus dans le code).

Code à copier

Fichier complet sections/nahnah-panier-recap-bento.liquid (Liquid, CSS et JS inclus).

{%- comment -%} NAHNAH AI · Récapitulatif du panier en bento (bibliothèque Sections & effets) {%- endcomment -%}
<div class="nn-panier-recap-bento" style="--nn-mh: {{ section.settings.marge_haut }}px; --nn-mb: {{ section.settings.marge_bas }}px; --nn-fond: {{ section.settings.couleur_fond }}; --nn-texte: {{ section.settings.couleur_texte }}; --nn-accent: {{ section.settings.couleur_accent }};">
  {%- if cart.item_count > 0 -%}
    <div class="nn-panier-recap-bento__grille">
      <div class="nn-panier-recap-bento__tuile nn-panier-recap-bento__tuile--total" style="--nn-i: 0;"><small>Total</small><strong>{{ cart.total_price | money }}</strong><span>taxes incluses</span></div>
      <div class="nn-panier-recap-bento__tuile nn-panier-recap-bento__tuile--nombre" style="--nn-i: 1;"><strong>{{ cart.item_count }}</strong><small>article{% if cart.item_count > 1 %}s{% endif %}</small></div>
      <div class="nn-panier-recap-bento__tuile nn-panier-recap-bento__tuile--photos" style="--nn-i: 2;">
        {%- for item in cart.items limit: 4 -%}<span class="nn-panier-recap-bento__vignette" style="--nn-k: {{ forloop.index0 }};">{%- if item.image -%}{{ item.image | image_url: width: 160 | image_tag: loading: 'lazy', alt: item.product.title }}{%- endif -%}</span>{%- endfor -%}
      </div>
      {%- if section.settings.livraison != blank -%}<div class="nn-panier-recap-bento__tuile" style="--nn-i: 3;"><span aria-hidden="true">🚚</span>{{ section.settings.livraison | escape }}</div>{%- endif -%}
      {%- if section.settings.retours != blank -%}<div class="nn-panier-recap-bento__tuile" style="--nn-i: 4;"><span aria-hidden="true">↩️</span>{{ section.settings.retours | escape }}</div>{%- endif -%}
      <form action="{{ routes.cart_url }}" method="post" class="nn-panier-recap-bento__tuile nn-panier-recap-bento__tuile--payer" style="--nn-i: 5;"><button type="submit" name="checkout">{{ section.settings.bouton | escape }} <span aria-hidden="true">→</span></button></form>
    </div>
  {%- else -%}
    <p class="nn-panier-recap-bento__vide">{{ section.settings.vide | escape }}</p>
  {%- endif -%}
</div>

{% schema %}
{
  "name": "Récap panier bento",
  "tag": "section",
  "class": "nn-section-panier-recap-bento",
  "settings": [
    {
      "type": "text",
      "id": "livraison",
      "label": "Tuile livraison",
      "default": "Livraison suivie en 48 h"
    },
    {
      "type": "text",
      "id": "retours",
      "label": "Tuile retours",
      "default": "Retours gratuits sous 30 jours"
    },
    {
      "type": "text",
      "id": "bouton",
      "label": "Texte du bouton",
      "default": "Passer au paiement"
    },
    {
      "type": "text",
      "id": "vide",
      "label": "Texte panier vide",
      "default": "Ton panier est vide."
    },
    {
      "type": "header",
      "content": "Couleurs"
    },
    {
      "type": "color",
      "id": "couleur_fond",
      "label": "Fond",
      "default": "#F4F4F5"
    },
    {
      "type": "color",
      "id": "couleur_texte",
      "label": "Texte",
      "default": "#18181B"
    },
    {
      "type": "color",
      "id": "couleur_accent",
      "label": "Accent",
      "default": "#22C55E"
    },
    {
      "type": "header",
      "content": "Espacement"
    },
    {
      "type": "range",
      "id": "marge_haut",
      "label": "Marge haute",
      "min": 0,
      "max": 120,
      "step": 4,
      "unit": "px",
      "default": 40
    },
    {
      "type": "range",
      "id": "marge_bas",
      "label": "Marge basse",
      "min": 0,
      "max": 120,
      "step": 4,
      "unit": "px",
      "default": 40
    }
  ],
  "presets": [
    {
      "name": "Récap panier bento"
    }
  ]
}
{% endschema %}

{% stylesheet %}
.nn-panier-recap-bento { padding: var(--nn-mh) 16px var(--nn-mb); background: var(--nn-fond); color: var(--nn-texte); }
.nn-panier-recap-bento__grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(110px, auto); gap: 10px; max-width: 900px; margin: 0 auto; }
.nn-panier-recap-bento__tuile { display: flex; flex-direction: column; justify-content: center; gap: 6px; margin: 0; padding: 18px; border-radius: 22px; background: #FFFFFF; font-size: 14px; font-weight: 600; animation: nn-panier-recap-bento-entre 0.55s calc(var(--nn-i) * 0.08s) cubic-bezier(0.2, 1.1, 0.3, 1) both; }
.nn-panier-recap-bento__tuile span[aria-hidden] { font-size: 22px; }
.nn-panier-recap-bento__tuile--total { grid-column: span 2; grid-row: span 2; background: var(--nn-texte); color: #FFFFFF; }
.nn-panier-recap-bento__tuile--total small { font-size: 13px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.1em; }
.nn-panier-recap-bento__tuile--total strong { font-size: clamp(34px, 6vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; }
.nn-panier-recap-bento__tuile--total span { font-size: 12px; font-weight: 400; opacity: 0.6; }
.nn-panier-recap-bento__tuile--nombre { align-items: center; text-align: center; }
.nn-panier-recap-bento__tuile--nombre strong { font-size: 40px; line-height: 1; color: var(--nn-accent); }
.nn-panier-recap-bento__tuile--photos { flex-direction: row; align-items: center; justify-content: center; padding: 10px; }
.nn-panier-recap-bento__vignette { display: block; width: 52px; height: 52px; margin-left: -14px; overflow: hidden; border: 3px solid #FFFFFF; border-radius: 50%; background: #E4E4E7; transform: rotate(calc((var(--nn-k) - 1.5) * 6deg)); animation: nn-panier-recap-bento-flotte 3s calc(var(--nn-k) * 0.3s) ease-in-out infinite; }
.nn-panier-recap-bento__vignette:first-child { margin-left: 0; }
.nn-panier-recap-bento__vignette img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nn-panier-recap-bento__tuile--payer { grid-column: span 2; padding: 0; background: var(--nn-accent); }
.nn-panier-recap-bento__tuile--payer button { width: 100%; height: 100%; min-height: 64px; border: 0; border-radius: 22px; background: none; color: #052E16; font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; }
.nn-panier-recap-bento__tuile--payer button span { display: inline-block; transition: transform 0.3s; }
.nn-panier-recap-bento__tuile--payer button:hover span { transform: translateX(6px); }
.nn-panier-recap-bento__tuile--payer button:focus-visible { outline: 2px solid var(--nn-texte); outline-offset: -4px; }
.nn-panier-recap-bento__vide { max-width: 600px; margin: 0 auto; padding: 20px; border-radius: 16px; background: #FFFFFF; text-align: center; }
@keyframes nn-panier-recap-bento-entre { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes nn-panier-recap-bento-flotte { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@media (max-width: 640px) { .nn-panier-recap-bento__grille { grid-template-columns: 1fr 1fr; } .nn-panier-recap-bento__tuile--total, .nn-panier-recap-bento__tuile--payer { grid-column: 1 / -1; grid-row: auto; } }
@media (prefers-reduced-motion: reduce) {
  .nn-panier-recap-bento *, .nn-panier-recap-bento *::before, .nn-panier-recap-bento *::after { animation: none !important; transition: none !important; }
}
{% endstylesheet %}
Télécharger le fichier .liquid

Licence NAHNAH AI : utilisation libre dans tes boutiques (y compris commerciales), modification permise, revente de l’élément seul interdite.

Prompt à copier

À coller dans Claude ou ChatGPT avec le fichier téléchargé (ou le code copié) : l’assistant t’aide à l’installer et à l’adapter à ta marque.

Tu es un expert des thèmes Shopify Online Store 2.0. Aide-moi à installer puis à adapter à ma marque cet élément gratuit de la bibliothèque NAHNAH AI.

Élément : « Récapitulatif du panier en bento » (Panier)
Description : Le résumé du panier en tuiles bento qui apparaissent en cascade : grand total réel, nombre d’articles, vignettes empilées des produits, tes infos livraison et retours (textes réglables), et une tuile bouton vers le paiement.
Page de l’élément (aperçu en direct) : https://ai.nahnah.shop/bibliotheque-shopify/panier-recap-bento
Fichier : nahnah-panier-recap-bento.liquid (bouton « Télécharger » de la page) ou le code copié avec le bouton « Copier » : je te le joins ou je le colle après ce message.
Emplacement dans le thème : sections/nahnah-panier-recap-bento.liquid (Liquid, puis {% stylesheet %} et {% javascript %}, dans ce seul fichier).

Étapes d’installation :
1. Dans Shopify : Boutique en ligne → Thèmes → bouton « … » du thème → Modifier le code.
2. Dossier « sections » → « Ajouter une section » (ou « Nouveau fichier ») → nomme-la « nahnah-panier-recap-bento ».
3. Efface le contenu proposé, colle le code de l’onglet Liquid (fichier complet), puis Enregistrer.
4. Ouvre Personnaliser → Ajouter une section → choisis-la, règle les textes et les couleurs, puis Enregistrer.

Ce que j’attends de toi :
- Guide-moi pas à pas dans Shopify : Boutique en ligne → Thèmes → « … » → Modifier le code → dossier sections → Ajouter une section, puis Personnaliser → Ajouter une section.
- Propose-moi d’adapter les couleurs, les textes et les liens à ma marque : demande d’abord mes couleurs (codes hexadécimaux), mon ton et mes liens.
- Garde le bloc {% schema %} et tous ses réglages (identifiants, types, presets) : je dois pouvoir tout régler ensuite dans l’éditeur de thème.
- Rends-moi le fichier complet modifié, prêt à coller, sans faux avis, fausse urgence ni chiffre inventé.

Si tu as le connecteur NAHNAH AI (MCP), récupère directement le code exact avec l’outil obtenir_code_element (id : panier-recap-bento).

Installer dans ma boutique

En un clic, la section est ajoutée à un thème de ta boutique Shopify connectée (un thème non publié par défaut).

Chargement de tes boutiques…

Installer dans Shopify

  1. Dans Shopify : Boutique en ligne → Thèmes → bouton « … » du thème → Modifier le code.
  2. Dossier « sections » → « Ajouter une section » (ou « Nouveau fichier ») → nomme-la « nahnah-panier-recap-bento ».
  3. Efface le contenu proposé, colle le code de l’onglet Liquid (fichier complet), puis Enregistrer.
  4. Ouvre Personnaliser → Ajouter une section → choisis-la, règle les textes et les couleurs, puis Enregistrer.

Installer via le MCP

Depuis Claude, Claude Code ou ChatGPT connecté à NAHNAH AI, demande : « Donne-moi le code de l’élément panier-recap-bento de la bibliothèque NAHNAH AI et les étapes pour l’installer ». L’assistant récupère le code et les étapes (outil obtenir_code_element), gratuitement.

Boutique connectée à NAHNAH AI : l’assistant peut aussi l’installer directement (outil installer_element).

Connecter le MCP

Dans la même catégorie