# Migrate Prestashop to Commerce

**URL:** <https://forum.modmore.com/t/migrate-prestashop-to-commerce/2221>\
**Category:** Commerce\
**Created:** [April 18, 2021, 7:52am UTC](https://forum.modmore.com/t/migrate-prestashop-to-commerce/2221 "2021-04-18T07:52:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [April 20, 2021, 9:34pm UTC](https://forum.modmore.com/t/migrate-prestashop-to-commerce/2221/4 "2021-04-20T21:34:13Z")

</div>

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

> [@Example product import script](https://forum.modmore.com/t/example-product-import-script/1886):
>
> There’s no standard import script - but here’s an example to get you going. Note that you will need to customise the code to make it suit your source data and where the things should go. I’ll also update this a little more later. It’s expected to be run from the command line with a config.core.php in the same directory (or one up) pointing to the MODX core. \<?php // Initiate MODX - can skip this if you're using as a snippet if (file\_exists(\_\_DIR\_\_ . '/config.core.php')) { require\_once \_\_…

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

> [@Importing directories or from Gallery](https://forum.modmore.com/t/importing-directories-or-from-gallery/2172):
>
> @pepebe wrote the following code to import a directory of images into MoreGallery. Put it in a snippet, or prepend the boilerplate code to load the modx object externally and run it from the CLI. Shouldn’t be too hard to adapt to loop over different directories to create multiple galleries at once, or to import from Gallery, so figured it would be useful to share: \<?php /\* import images into a moreGallery resource \*/ $resourceId = $modx-\>getOption('resourceId', $scriptProperties, 1582); $d…

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 🙂

---

_[View the full topic](https://forum.modmore.com/t/migrate-prestashop-to-commerce/2221)._
