Jump to content

Creating a Sync module with a Marketplace


Darknoe

Recommended Posts

Hi!

 

I'm new at this forum, also at developing for Prestashop. Right now I'm working on my first module.

 

My team and I have created a Marketplace (something like Amazon or Rakuten) where we have many stores selling their products, our problem comes when one of this stores at our Marketplace has also a Prestashop store, because we want to sync all his products and categories with our marketplace so stock and prices are always updated.

 

With this I mean that if a store sells a product in my Marketplace, we will update his product available stock at his Prestashop.

We also have a cronjob asking every X minutes to his Prestashop how many stock does he have, prices and if there are new products or categories.

 

We are now doing this with a php file that the user has to install in his website so we can retrieve (in JSON format) all his store data fetching an url like www.OurClientPrestashop.com/OurSyncFile.php

 

The problem we are facing with this is that if we have to make changes on our Sync file and update source code, we have to annoy our clients by sending them the new file and asking them to update this file on their FTP accounts, yes, quite annoying...

 

So I'm researching if there is some how a solution for us implementing a Prestashop Module.

We would need to create a sync method in the module that can be called by our server every X time and we also would need to call an updateProductStock(...) from our server.

 

Is this somehow possible? Can it work as a Controller and creare an URI route to use the module methods from our server via HTTP petition?

 

How does Amazon keeps prestashop stock sync to their marketplace? (Maybe we could use the same approach)

 

Thank you very much and sorry for the weird question :P

 

 

 

 

 

Link to comment
Share on other sites

Hi Neza,

 

Thank you very much for your early reply. I forgot to say that I had already read about Webservice (the first thing I did hehe). But it's my last last last option.

 

When you ask the webservice for a list of products it gives you a bunch of products url's which you have to fetch one by one to get the product data, instead of returning all data in one http request, that would make my server get really slow because we have many Prestashop stores.

 

Also our clients are not very used to computers or managing their sites, so asking them to enable the webservice and creating an api credential would be more complicated than downloading a simple module.

 

I was looking for an approach with modules to simplify usage and server cpu.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...