定制 thelia/delivery-exclude-date-module 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thelia/delivery-exclude-date-module

最新稳定版本:1.0

Composer 安装命令:

composer require thelia/delivery-exclude-date-module

包简介

README 文档

README

Authors: Thelia info@thelia.net, Gilles Bourgeat gbourgeat@openstudio.fr

  • This module manages excluding delivery dates.
  • It manages a date list and test them by event.
  • The developer competencies is required for use.

Compatibility

Thelia > 2.1

Installation

Manually

  • Copy the module into <thelia_root>/local/modules/ directory and be sure that the name of the module is DeliveryExcludeDate.
  • Activate it in your thelia administration panel

Composer

Add it in your main thelia composer.json file

composer require thelia/delivery-exclude-date-module:~1.0

Usage

  • Once activated, click on the configure button for add or edit dates.

Example in controller for one date

    $event = new DateIsAvailableEvent(new \DateTime('2015-09-09'));

    $this->getDispatcher()->dispatch(
        DeliveryExcludeDateEvents::DATE_IS_AVAILABLE,
        $event
    );

    if ($event->getIsAvailable()) {
        // date is available
    } else {
        // date is not available
    }

Example in controller for multiple dates

    $date1 = new \DateTime('2015-09-09');
    $date2 = new \DateTime('2015-10-09');
    $date3 = new \DateTime('2015-11-09');

    $event = new DatesIsAvailableEvent(array($date1, $date2, $date3));

    $this->getDispatcher()->dispatch(
        DeliveryExcludeDateEvents::DATES_IS_AVAILABLE,
        $event
    );

    if ($event->getIsAvailable($date1)) {
        // date 1 is available
    } else {
        // date 1 is not available
    }

    if ($event->getIsAvailable($date2)) {
        // date 1 is available
    } else {
        // date 1 is not available
    }

    if ($event->getIsAvailable($date3)) {
        // date 1 is available
    } else {
        // date 1 is not available
    }

Loop

delivery_exclude_date

Output arguments

Variable Description
$ID Int Value
TITLE String value
DESCRIPTION String value
ACTIVE Int value
DATE Date value

统计信息

  • 总下载量: 86
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 6
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2015-09-28