Add package dimensions for shipping calculation

- Add length, width, and height fields to product blueprint (in centimeters)
- Add corresponding data-item attributes for Snipcart shipping calculation
- Enable volume-based shipping cost calculation

🤖 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:29:43 +01:00
parent 2d66529c9a
commit f7a69482fc
2 changed files with 42 additions and 0 deletions

View file

@ -33,6 +33,9 @@ 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)
@ -45,6 +48,42 @@ 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

View file

@ -47,6 +47,9 @@
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(',');