primitivesocial/craft-commerce-deal-maker

检查你是否即将成交并尝试升级你的产品

1.1.4 2019-05-31 18:44 UTC

This package is auto-updated.

Last update: 2024-08-29 04:49:01 UTC


README

检查你是否即将成交并尝试升级你的产品

Screenshot

需求

此插件需要 Craft CMS 3.0.0-beta.23 或更高版本。

安装

要安装插件,请按照以下说明操作。

  1. 打开您的终端并转到您的 Craft 项目目录

     cd /path/to/project
    
  2. 然后告诉 Composer 加载插件

     composer require PrimitiveSocial/craft-commerce-deal-maker
    
  3. 在控制面板中,转到设置 → 插件,并点击 CraftCommerce Deal Maker 的“安装”按钮。

CraftCommerce Deal Maker 概述

{% set f = craft.craftcommercedealmaker.get() %}
{% if f %}
  {% for deal in f %}
    You ordered {{ deal.current_quantity }} of {{ deal.lineitem.getPurchasable().title }}! You can get {{ deal.discount.description }} if you order {{ deal.deal_quantity - deal.current_quantity }} more!
  {% endfor %}
{% endif %}

这显示了一个具有四个参数的标准对象 deal.lineitem:与成交相关的 CraftCommerce LineItem 对象 deal.discount:CraftCommerce 折扣对象 deal.current_quantity:订单对象中的当前项目数量 deal.deal_quantity:获得成交所需的数量 deal.total_quantity:折扣中各种产品的总数量 deal.available:循环中所有产品的数组

贡献

这是本项目的早期开发阶段。欢迎所有 pull request。