Migrate Prestashop to Commerce

Hello,

I have decided to migrate from Prestashop + Wordpress to Commerce + MODX for one of my customer after convincing him to switch to MODX.
I’m working to adapt the Wordpress Migrate snippets to import Prestashop products to Commerce.
Any feedback on a such attempt will be welcome !

That sounds like an interesting project!
The base Commerce products are quite simple by design, and it’s been many years since I did anything with Prestashop so I’m not sure what’s involved in their model, but there’s a couple of approaches that spring to mind.

For example if you were to have resources representing the product detail pages, and then use a Products TV for product variations, you would need to firstly look at a product from Prestashop and create a MODX resource representing that product. Then, for each variation create a new Commerce product with it’s own SKU, name, description, qty, price etc. linking them to the TV.
Any extra data attached to the product would need to instead be put into the resource on TVs or into the resource properties field.

Another approach could be to create custom products and extend them in a way that can contain all the Prestashop product data. This is great because then everything is accessible independently of resources, though it really does depend on how you structure your Commerce shop :slight_smile:

https://docs.modmore.com/en/Commerce/v1/Developer/Guides/Making_Custom_Products.html

Hello

Thank you for your reply.

To create products and metadata I intend to use modResource and TVs

I’m writing the import script (https://github.com/hitodev/prestashop-to-modx-commerce) and I’m thinking the way to

– import product images : if I use moreGallery I guess I should use a moreGallery method to create and attach galleries to each product resource. There is no difficulty for me to query the Prestashop database and build each image path to attach to a specific product. But I didn’t find documentation to create programmatically moreGallery specific resource galleries.

– product variations : I guess I should use a Commerce class, but I didn’t find documentation to create variations, programmatically.

There’s an example import script for resources and products here:

For MoreGallery there’s a similar example here, which takes care off adding images in a specific directory to a pre-made gallery resource:

From what you describe, you’ll want to combine the two. First create resources of type mgResource based on the Commerce example, add the product variations into the List TV, and then include the MoreGallery example to also add images to it.

I’ll follow your repository with great interest and if you have specific questions about the Commerce data model or anything like that, just ask :slight_smile: