jgrasp/sylius-prestashop-migration-plugin 问题修复 & 功能扩展

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

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

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

  1. Add the plugin to your project
$ composer require jgrasp/sylius-prestashop-migration-plugin

  1. Add plugin dependency to your config/bundles.php file:
    return [
        ...
        Jgrasp\PrestashopMigrationPlugin\PrestashopMigrationPlugin::class => ['all' => true], 
    ]

  1. 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/ 

  1. Create a new doctrine DBAL connection
doctrine:
  dbal:
    connection:
      prestashop:
        url: '%env(resolve:PRESTASHOP_DATABASE_URL)%'

  1. 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: ~

  1. Custom Entities

Add the following code

use PrestashopTrait;

in entities :

  • App\Entity\Addressing\Address
  • App\Entity\Addressing\Country
  • App\Entity\Addressing\Zone
  • App\Entity\Channel\Channel
  • App\Entity\Currency\Currency
  • App\Entity\Customer\Customer
  • App\Entity\Locale\Locale
  • App\Entity\Product\Product
  • App\Entity\Product\ProductOption
  • App\Entity\Product\ProductOptionValue
  • App\Entity\Product\ProductVariant
  • App\Entity\Shipping\ShippingMethod
  • App\Entity\Taxation\TaxRate
  • App\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{

}

  1. Upgrade your database
$ php bin/console doctrine:migrations:diff
$ php bin/console doctrine:migrations:migrate

  1. 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 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-23