承接 patrick-blom/article-limit-per-order 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

patrick-blom/article-limit-per-order

Composer 安装命令:

composer require patrick-blom/article-limit-per-order

包简介

This module extends the article structure with the maximum order amount of a single article. This amount can not be exceeded per order.

README 文档

README

PHP Version Stable Version Package Name License Follow me on twitter

Article Limit Per Order

This module extends the article structure with the maximum order amount of a single article. This amount can not be exceeded per order.

About the module

Hamster buying is not only a problem in retail stores. Many shops have the problem that people buying articles in a huge amount, especially in days of sale. To avoid that, this module adds the functionality to add a limit of maximum amounts per order process. With that functionality you can stop people from buying more items than they should. e.g. Toilette paper. This module was inspired by the COVID-19 problems retailers had, because of people started buying toilette paper like mad.

Image alt="preview of the module"

Compatibility

  • The module is OXID eShop 6.2 and higher only
  • The module was built and will work on the OXID eShop Community Edition
  • The module should work on OXID eShop Professional Edition and OXID eShop Enterprise Edition
  • The module was tested on the OXID eShop Community Edition
  • The module was not tested on OXID eShop Professional Edition and OXID eShop Enterprise Edition

Requirements

  • OXID eShop 6.2 Community Edition (or higher)
  • PHP 7.1 (or higher)

Module installation via composer

Default installation via packagist (recommend)

  • add the module to your shop composer.json
    • cd <shop root>
    • composer require patrick-blom/article-limit-per-order

Alternative installation via GitHub (manual)

  • create a new folder called "thirdparty" with the subfolder "pb" at the shop root level (same level as the composer.json)
    • cd <shop root>
    • mkdir -p thirdparty/pb
  • clone the repository to the new folder
    • git clone git@github.com:patrick-blom/article-limit-per-order.git thirdparty/pb/ArticleLimitPerOrder
  • navigate back to the shop root level and add the repository to composer.json
    • composer config repositories.patrick-blom/article-limit-per-order path thirdparty/pb/ArticleLimitPerOrder
  • add the module to your shop composer.json
    • composer require patrick-blom/article-limit-per-order

OXID eShop module activation (identical for default && alternative installation)

  • prepare the module configuration for eShop 6.2
    • vendor/bin/oe-console oe:module:install-configuration source/modules/pb/ArticleLimitPerOrder/
    • vendor/bin/oe-console oe:module:apply-configuration
  • activate the module
    • vendor/bin/oe-console oe:module:activate articlelimitperorder
  • regenerate the unified namespace and the views, because the module adds new database fields
    • vendor/bin/oe-eshop-unified_namespace_generator
    • vendor/bin/oe-eshop-db_views_regenerate

Usage

  • After the installation and activation you will find a field called Maximum amount per order under:
    • Administer Products -> Procducts -> [select a Product e.g: 1505] -> Stock (tab)
  • Add the Amount of maximum articles per order (e.g. 2 - for max two of these articles per order) and save the article
  • If you want have no limit for the article enter the number 0 to the field and save the article

Testing

!Attention!

The testing process should only be done in a development environment or CI pipeline.

Preparing

  • Install the module as described
  • Prepare the OXID Testing Library likes described in their repository or use the oxvm_eshop / docker-eshop-sdk
  • Add pb/ArticleAlert to the partial module paths in your test_config.yml (e.g: partial_module_paths: 'pb/ArticleLimitPerOrder')
  • Copy the config.inc.TEST.php.dist from the vendor module directory to your shop root and rename it to config.inc.TEST.php
  • Adjust the settings in the config.inc.TEST.php to your needs (test database name, error reporting, etc)
  • Modify your config.inc.php and ensure that the config.inc.TEST.php will be loaded during the tests
    // bottom of config.inc.php
    if (defined('OXID_PHP_UNIT')) {
        include "config.inc.TEST.php";
    }

Run tests

  • Navigate to the shop root
  • Run the test using the following command: php vendor/bin/runtests <absolute path to shop root>/source/modules/pb/ArticleLimitPerOrder/Tests
  • Run the coverage using the following command: php vendor/bin/runtests-coverage <absolute path to shop root>/source/modules/pb/ArticleLimitPerOrder/Tests

Run static analysis

  • Install phpstan using composer require --dev phpstan/phpstan
  • Run the static analysis using the following commands
    • Navigate to the <shop root>
    • Run phpstan with arguments vendor/bin/phpstan analyze -c source/modules/pb/ArticleLimitPerOrder/phpstan.neon

License

The module is released under GPL-3.0. For a full overview check the LICENSE file.

patrick-blom/article-limit-per-order 适用场景与选型建议

patrick-blom/article-limit-per-order 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 06 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「order」 「modules」 「eshop」 「article」 「limit」 「OXID」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 patrick-blom/article-limit-per-order 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2020-06-29