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

@ -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(',');