thelia/easy-order-manager-module 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

thelia/easy-order-manager-module

Composer 安装命令:

composer require thelia/easy-order-manager-module

包简介

EasyOrderManager module for Thelia

README 文档

README

Add a short description here. You can also add a screenshot if needed.

Installation

Manually

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

Composer

Add it in your main thelia composer.json file

composer require your-vendor/easy-order-manager-module

Usage

Once activated, you will see a new menu link in Thelia's Back Office. This new page allows you to easly manage all orders thanks to filters and search bars. This module uses Datables.

Events

You can use 2 events to add filters to this module :

BeforeFilterEvent::ORDER_MANAGER_BEFORE_FILTER
TemplateFieldEvent::ORDER_MANAGER_TEMPLATE_FIELD

In BeforeFilterEvent you have access to the order query and request.

In TemplateFieldEvent you can use the function addTemplateField(fieldName, templateName) to add a template with your new filter in it. You just need to add js-filter-element class to your filter input.

You can use one event to add or remove column to this module :

TemplateColumnDefinitionEvent::ORDER_MANAGER_TEMPLATE_COLUMN_DEFINITION

In TemplateColumnDefinitionEvent you can use the function addColumnDefinition(template, index) to add a new column to the dataTable.

//Example : 

<?php
 //***
class EasyOrderManagerListener implements EventSubscriberInterface
{

    public function addFieldsToTemplate( TemplateFieldEvent $event)
    {
        $event->addTemplateField('item_to_filter','item_to_filter_template_name.html');
    }

    public function addFilterOnQuery( BeforeFilterEvent $event)
    {
        $filters =$event->getRequest()->get('filter');
        $search = $event->getQuery();
        if ("" !== $filters['item_to_filter']) {
            //update $search to filter with the data in $filters['item_to_filter']
        }
    }

    public function updateColumnDefinition( TemplateColumnDefinitionEvent $event)
    {
       $event->removeColumnDefinition('invoice_date');
       $event->addColumnDefinition([
               'name' => 'id_column',
               'targets' => 6, //index of column
               'title' => 'title_column',
               'orderable' => false, // /!\ orderable is not manageable for the moment always set false
               'className' => "text-center",// class applied to the column
               'render' => "defaultRender", // name of the js function when render data
               'parseOrderData'=>  function(Order $order){
                    //return the data wich will be used in the render function
               }
       ],6);
       // /!\ targets and the index param must be the same.
    }
    public static function getSubscribedEvents()
    {
        return [
            BeforeFilterEvent::ORDER_MANAGER_BEFORE_FILTER => ['addFilterOnQuery'],
            TemplateFieldEvent::ORDER_MANAGER_TEMPLATE_FIELD => ['addFieldsToTemplate'],
            TemplateColumnDefinitionEvent::ORDER_MANAGER_TEMPLATE_COLUMN_DEFINITION => ['updateColumnDefinition'],
        ];
    }
//...
}

You can use this function to render the data in JS :

Name Render Data returned by parseOrderData
defaultRender return the data without parsing a string
checkboxRender create a checkbox [id => 'order.id']
hrefRender create a href link [href =>'urlToGo', label => 'label']
labelRender create a label with a color [color =>'#ccc', label => 'label']

thelia/easy-order-manager-module 适用场景与选型建议

thelia/easy-order-manager-module 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 1.1k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 thelia/easy-order-manager-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 thelia/easy-order-manager-module 我们能提供哪些服务?
定制开发 / 二次开发

基于 thelia/easy-order-manager-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 6
  • Forks: 6
  • 开发语言: HTML

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2021-03-17