jgrasp/sylius-prestashop-migration-plugin
Composer 安装命令:
composer require jgrasp/sylius-prestashop-migration-plugin
包简介
Migrate Prestashop data into Sylius
README 文档
README
This plugin allows you to migrate your Prestashop data to Sylius. It is able to recreate the tree structure of categories, import products and their variations, shops, product images, etc...
The wish is that you can decorate every part of it to use according to your needs.
Please use this plugin only on a developing site, ideally before starting work on the site, as this plugin has the ability to completely remove the database for work.
I am not responsible for the loss of your data. I created this plugin with the aim of making life easier for developers, I will try to keep the documentation as clear as possible.
I hope this plugin helps you as much as it helped me. I will continue to make it grow and evolve with the new projects that I will meet (and your feedback perhaps? 😊).
Requirements
- Sylius 1.10 minimum
- PHP 8.0 minimum
Installation
- Add the plugin to your project
$ composer require jgrasp/sylius-prestashop-migration-plugin
- Add plugin dependency to your
config/bundles.phpfile:
return [ ... Jgrasp\PrestashopMigrationPlugin\PrestashopMigrationPlugin::class => ['all' => true], ]
- Add .env variables
# Enter the correct Prestashop database login details. PRESTASHOP_DATABASE_URL=mysql://root@127.0.0.1/sylius_%kernel.environment% # Custom the valid URL where product images are stored. If this variable is empty, the plugin will try to find images with the Prestashop database. PRESTASHOP_IMG_DIRECTORY_URL=https://www.example.com/img/p/
- Create a new doctrine DBAL connection
doctrine: dbal: connection: prestashop: url: '%env(resolve:PRESTASHOP_DATABASE_URL)%'
- Add package configuration
Create a new configuration file in config/packages like prestashop.yaml and put this configuration :
prestashop_migration: # The directory for product images public_directory: "%env(PRESTASHOP_IMG_DIRECTORY_URL)%" # Doctrine DBAL connection to retrieve data from Prestashop connection: prestashop # Read the documentation to see how custom this field. resources: ~
- Custom Entities
Add the following code
use PrestashopTrait;
in entities :
App\Entity\Addressing\AddressApp\Entity\Addressing\CountryApp\Entity\Addressing\ZoneApp\Entity\Channel\ChannelApp\Entity\Currency\CurrencyApp\Entity\Customer\CustomerApp\Entity\Locale\LocaleApp\Entity\Product\ProductApp\Entity\Product\ProductOptionApp\Entity\Product\ProductOptionValueApp\Entity\Product\ProductVariantApp\Entity\Shipping\ShippingMethodApp\Entity\Taxation\TaxRateApp\Entity\User\AdminUser
This trait is essential & add a link between Sylius & Prestashop entities.
App\Entity\Product\ProductVariant should implements Jgrasp\PrestashopMigrationPlugin\Entity\Product\ProductVariantInterface. So add the following code :
use Jgrasp\PrestashopMigrationPlugin\Entity\Product\ProductVariantInterface; class ProductVariant extends BaseProductVariant implements ProductVariantInterface{ }
- Upgrade your database
$ php bin/console doctrine:migrations:diff $ php bin/console doctrine:migrations:migrate
- Configure the locale parameter
The parameter must be a locale that exists in the list of active languages of the Prestashop you want to migrate. Without this, the migration of the translations will not be able to be done correctly.
parameters: locale: en_EN
Congratulations ! Your project is ready for the migration. Let's start with How to use !
jgrasp/sylius-prestashop-migration-plugin 适用场景与选型建议
jgrasp/sylius-prestashop-migration-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 109 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 02 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jgrasp/sylius-prestashop-migration-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jgrasp/sylius-prestashop-migration-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 109
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-23