npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pankajpatel/medusa-source-prestashop

v0.0.20

Published

Source plugins that allows users to import data from a Prestashop store to Medusa

Downloads

9

Readme

Description

This plugin imports Prestashop categories and products into Medusa. It creates categories and products that don't exist and updates those that have been imported previously.

Limitations

Prerequisites

Medusa Setup

You must have a Medusa server installed before installing this plugin.

Furthermore, the Medusa server should have PostgreSQL, Redis and File Service installed and configured on your Medusa server.

Prestashop Setup

Go to the PrestaShop back office, open the “Web service” page under the “Advanced Parameters” menu, and then choose “Yes” for the “Enable PrestaShop Webservice” option.

Generate a key and copy it as you'll need them for the plugin's options.

You need to give at least the integration access to the following resources:

  • products
  • product_options
  • product_option_values
  • combinations
  • categories
  • stock_availables
  • images

We recommend enabling all the resources.

Installing Plugin

To install the plugin run the following command on your Medusa server:

npm install medusa-source-prestashop

Plugin Configurations

Add the plugin and its options into the plugins array in medusa-config.js:

const plugins = [
  //...
  {
    resolve: `medusa-source-prestashop`,
    //if your plugin has configurations
    options: {
      prestashop_url: '<YOUR_PRESTASHOP_URL>', // example 'https://prestashopstore.com/api',
      consumer_key: '<YOUR_CONSUMER_KEY>' // example 'FDSFJKLJFASDKLFJAJLKJFDS'
      additionalParams: {}
      generateNewHandles: boolean
    },
  },
];

Options

| Name | Description | Required | Default Value | | -------------------- | ---------------------------------------------------------------------------------- | -------- | ------------- | | prestashop_url | The URL of your Medusa server. It should end with a /api. | true | | | consumer_key | The Consumer Key of the integration. | true | | | generateNewHandles | Should the importer generate new handles or use link_rewrite in prestashop product | false | false | | additionalParams | Additional parameters to send when making Prestashop webservice request | false | undefined |

Use the Plugin

Server Startup

To use the plugin, just start the Medusa server:

npm start

The import process will run in the background of the server. Based on how many products you have, it can take some time the first time running it.

As a Batch Job

You can trigger the import by creating a new batch job using the Create Batch Job API endpoint. You can pass the following in the payload:

{
  "type": "import-prestashop",
  "context": {},
  "dry_run": false
}

This will trigger the import process.