justbetter/laravel-magento-products
Composer 安装命令:
composer require justbetter/laravel-magento-products
包简介
Package to store product data in a local DB
README 文档
README
This package tracks if products exist in Magento by storing the status locally in the DB. We developed this to prevent multiple calls when multiple packages need to check product existence in Magento.
Installation
Require this package:
composer require justbetter/laravel-magento-products
Add the following to your schedule to automatically search for products in Magento.
$schedule->command(\JustBetter\MagentoProducts\Commands\CheckKnownProductsExistenceCommand::class)->twiceDaily(); $schedule->command(\JustBetter\MagentoProducts\Commands\DiscoverMagentoProductsCommand::class)->daily();
Important
This package requires Job Batching
Usage
Checking if a product exists in Magento
You can use this package to determine if products exist in Magento. For example:
$exists = app(\JustBetter\MagentoProducts\Contracts\ChecksMagentoExistence::class)->exists('sku')
If it does not exist the sku will still be stored in the database. The \JustBetter\MagentoProducts\Commands\CheckKnownProductsExistenceCommand command will automatically check these known products for existence.
Retrieving product data
You can use this package to retrieve product data. This data will be saved in the database and automatically retrieved when it is older than X hours. You can configure the amount of hours in the config file For example:
$exists = app(\JustBetter\MagentoProducts\Contracts\RetrievesProductData::class)->retrieve('sku')
Deletion safeguard
To prevent accidental deletion of products a safeguard is built in which prevents the deletion event firing if the number of products to be deleted exceeds the configured threshold.
This threshold can be configured in the configuration file and is in percentages. For example, a value of 0.1 (10%) will stop deletions if 11 products are deleted of 100 total.
Events
When your application discovers new products in Magento you should dispatch one of the following events:
\JustBetter\MagentoProducts\Events\ProductDiscoveredEvent containing a single sku.
When a single product or multiple products appear in Magento, an event is dispatched:
\JustBetter\MagentoProducts\Events\ProductCreatedInMagentoEvent containing a single sku.
Quality
To ensure the quality of this package, run the following command:
composer quality
This will execute three tasks:
- Makes sure all tests are passed
- Checks for any issues using static code analysis
- Checks if the code is correctly formatted
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
justbetter/laravel-magento-products 适用场景与选型建议
justbetter/laravel-magento-products 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 55.96k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2022 年 09 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 justbetter/laravel-magento-products 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 justbetter/laravel-magento-products 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 55.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 23
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-20