Add shipping weight support for Snipcart delivery calculation
All checks were successful
Deploy / Deploy to Production (push) Successful in 16s

- Add weight field to product blueprint (in grams)
- Add data-item-shippable and data-item-weight attributes to product template
- Enable Snipcart to calculate shipping costs based on product weight

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2025-12-19 17:12:51 +01:00
parent ee5eed49e6
commit 2d66529c9a
2 changed files with 14 additions and 0 deletions

View file

@ -33,6 +33,18 @@ tabs:
fr: Partagé entre les versions FR et EN
translate: false
width: 1/4
weight:
label:
en: Weight (g)
fr: Poids (g)
type: number
min: 0
default: 0
help:
en: Weight in grams for shipping calculation
fr: Poids en grammes pour le calcul de la livraison
translate: false
width: 1/4
description:
label: Description panier
type: writer

View file

@ -45,6 +45,8 @@
data-item-description="<?= $page->description()->excerpt(100) ?>"
data-item-image="<?= $page->images()->first() ? $page->images()->first()->url() : '' ?>"
data-item-name="<?= $page->title()->html() ?>"
data-item-shippable="true"
data-item-weight="<?= $page->weight()->or(0) ?>"
<?php
if($page->hasOptions()->toBool() && $page->optionValues()->isNotEmpty()):
$values = $page->optionValues()->split(',');