lightningsdk/checkout

该软件包的最新版本(dev-master)没有提供许可证信息。

添加电子商务系统。

dev-master 2020-06-20 19:17 UTC

This package is auto-updated.

Last update: 2024-09-21 05:53:20 UTC


README

它做什么

多商品购物车 对商品有多种选项和条件选项。不包括支付处理,这通过集成模块完成:Lightning-Stripe 可用订单履行模块:Lightning-GoShippo Lightning-ThePrintful

安装和配置

$conf = [
    'modules' => [
        'checkout' => [
            // The payment handler class.
            // This may be added by the payment handler's own module.
            // In the future, this will be an array or a string that
            // can accept multiple payment handlers.
            'handler' => \Payment\Handler::class,
            
            // Allow an option to enter discount codes in the
            // shopping cart view.
            'enable_discounts' => false,
        ],
    ]
];

添加到页面

您可以通过向span元素添加标记来简单地添加结账按钮。所有元素上必须存在checkout-product类以激活点击监听器。所有其他选项均通过数据属性指定。

<span class="checkout-product" data-checkout-product-id="{product id}" data-checkout="add-to-cart">Buy Now</span>

以下字段可用

  • data-checkout-product-id 必需:要购买的商品的id。这可能是一次性购买或订阅。

  • data-checkout 可选值:buy-now(默认)- 直接将用户带到支付界面 add-to-cart - 将商品添加到显示在模态框中的购物车中,用户可以继续购物。

  • data-create-customer 可选值:false(默认)true - 是否保存用户的卡信息以供未来计费

  • data-redirect

  • data-title

  • data-amount

  • shipping-address