hashandsalt/kirby-snipcart
Composer 安装命令:
composer require hashandsalt/kirby-snipcart
包简介
Snipcart Panel Plugin
README 文档
README
For Kirby 5 use release 0.7.5+
For Kirby 4 use release 0.5.0
This plugin helps integrate Snipcart into a Kirby site. We have big plans for this one, but right now it just helps add the default cart and provides blueprints & snippets to take the mandatory data that Snipcart needs in order to work.
It is worth noting that this version is built on Vue, and adding the cart to the template also adds Vue. Therefore, if you need other interactivity (lightboxes, image sliders etc) on the site, it's not a good idea to use jQuery. Go with Vue based plugins.
Planned future features:
- Vue template overrides allowing greater customisation of the cart.
- Panel widgets showing high level info like number of sales, revenue etc.
- Full integration with the relevant parts Snipcart API.
- Reports - export stuff like the sales for the year to CSV.
- Anything else useful!
Built against Kirby 3.8.3+ and PHP 8.1+
Install
Download
Download and copy this repository to /site/plugins/kirby3-snipcart.
Composer
composer require hashandsalt/kirby3-snipcart
Commerical Usage
This plugin is free but if you use it in a commercial project please consider to
Usage
Cart Snippet
Add the cart just before your closing body tag:
<?= snippet('cart/init') ?>
Blueprint
Extend the product data blueprint into you product page blueprint:
sections:
productdata:
type: fields
fields:
productinfo: cart/product
Add to Cart Button
Add the "Add to Cart" button to your product template:
<?= snippet('product/add') ?>
Add Checkout Summary
Add the "Checkout" button and items in basket to your product template:
<?= snippet('cart/checkoutsummary') ?>
Options
The cart will not work without a valid API for the cart on the front end, and you also need a secret key for the Kirby Panel to work with. These can be obtained from within the Snipcart Dashboard.
You can also choose wether or not to use the default css theme for the cart:
'hashandsalt.kirby-snipcart.snipcartlive' => false,
'hashandsalt.kirby-snipcart.apikeytest' => 'XXXX',
'hashandsalt.kirby-snipcart.apikeylive' => 'XXXX',
'hashandsalt.kirby-snipcart.apisecrettest' => 'XXXX',
'hashandsalt.kirby-snipcart.apisecretlive' => 'XXXX',
Change Notes
The following config option has been depricated as it is now a an option on the Snipcart JS call. You can set it in <?= snippet('cart/init') ?>
'hashandsalt.kirby-snipcart.defaulttheme' => true,
hashandsalt/kirby-snipcart 适用场景与选型建议
hashandsalt/kirby-snipcart 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 30, 最近一次更新时间为 2025 年 05 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 hashandsalt/kirby-snipcart 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hashandsalt/kirby-snipcart 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 30
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-21