hounddd/wn-mallimportexport-plugin
Composer 安装命令:
composer require hounddd/wn-mallimportexport-plugin
包简介
Import or export data to OFFLINE.mall.
关键字:
README 文档
README
This plugin offers the possibility to import or export data into the OFFLINE.Mall plugin.
⚠ Please note that it does NOT allow you to add products but to update existing products.
What you can import or export
- publication status
- stocks
- authorisation for sales out of stock
- weight
- prices, additional prices and group prices, in all currencies.
- and whatever you decide
How it works
The plugin uses the CSV file import/export features of WinterCMS.
With default options, exporting data will give you a CSV file named Products_export_2021-09-23.csv.
Columns naming
The plugin use currencies symbols to append same to the column name.
- The prices columns will be named "Price $", "Price €", ...
- The customers prices columns will be named "Price pricename $", "Price pricename €", ...
ex for a "Vip" customer price : "Price vip $", "Price vip €", ... - The defined price categories use their own names "Price category name $", "Price category name €", ...
ex for a "Old price" price category : "Old price $", "Old price €", ...
You can define your own filename, date or column's names from config.
Add your own columns
You can listen for hounddd.mallimportexport.config.update event to add your own column definition.
Example to add the product's name to export fields, at the second position
/** * Extend products controller export columns definition */ Event::listen('hounddd.mallimportexport.config.update', function ($controller, $config) { $exportColumns = $config->export['list']->columns; $position = 1; $config->export['list']->columns = array_slice($exportColumns, 0, $position, true) + [ 'name' => [ 'label' => 'offline.mall::lang.product.name' ] ] + array_slice($exportColumns, $position, count($exportColumns) - 1, true); });
Integration
If the version of your OFFLINE.Mall plugin includes event hooks for toolbars (>= 1.14.4), you will find the import and export buttons at the top of the product list, otherwise an entry will be added to the side menu of the plugin.
Buttons are available according to the user rights.
Installation
Let assume you're in the root of your wintercms installation
Using composer
Just run this command
composer require hounddd/wn-mallimportexport
Cloning repo
Clone this repo into your winter plugins folder.
cd plugins mkdir hounddd && cd hounddd git clone https://github.com/Hounddd/wn-mallimportexport mallimportexport
Configuring
Import/export behaviors
You can configure plugin behaviors with a file \config\hounddd\mallimportexport\config.php
<?php return [ 'import' => [ ], 'export' => [ 'fileName' => 'Export_produits', // New export filename, default "Products_export" 'appendDate' => true, // Append date to filename, default true 'dateFormat' => '_Y-m-d-z', // How to format appended date, default '_Y-m-d' ], 'useCurrencySymbol' => true, // Use currency symbol (true), code (false), or nothing (null), default true 'removeDiacritics' => false, // Remove diactritcis chars in additional prices column labels, default false ];
- useCurrencySymbol : (default true) Defined if additionnal price columns must use currency symbol ou currency code.
- removeDiacritics : (default false) Defined if diacritics characters must be removed from prices and additionnal prices column labels.
For the other columns use the translations (see below).
This allows you to bypass encoding problems with import or export files.
See PHP date format for dateFormat accepted values.
Remember that this is for the name of a file, respect the conventions to avoid trouble.
Csv file column's names
You can change the column names to match your needs, simply add a \lang\XX\hounddd\mallimportexport\lang.php (where XX is your locale) to your site.
<?php return [ 'columns' => [ 'allow_out_of_stock_purchases' => 'Vente hors stock', 'price' => 'Prix en', 'published' => 'Publié', 'stock' => 'Stock', 'user_defined_id' => 'Référence', 'weight' => 'Poids en g', ], ];
Make awesome sites with WinterCMS!
hounddd/wn-mallimportexport-plugin 适用场景与选型建议
hounddd/wn-mallimportexport-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 105 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 09 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「mall」 「winter」 「winter cms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hounddd/wn-mallimportexport-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hounddd/wn-mallimportexport-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hounddd/wn-mallimportexport-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Frontend User's permissions plugin for WinterCMS
ShopXO domestic leading enterprise-class B2C free open source e-commerce system!
tp framework
This plugin adds global search capabiliies to WinterCMS.
The Winter Sitemap Pretty plugin allows you to to prettify a sitemap.xml file generated by wn-sitemap-plugin for your website to make it human readable
统计信息
- 总下载量: 105
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-24