Jump to content

need help to sync product stock between prestashop and woocommerce (only stock level)


Recommended Posts

Hi Devs & Shop owners

i need help with a small integration/Synchronization

we have Prestashop 1.7.2 shop and Wordpress 5.5.3 woocommerce shop (under construction)

we need 1 thing, when a product is ordered, the stock is being reduced from both shops, not only one 

but, no need to share the order details, same prices or images etc, the only synchronization needed for now is the stock level

just to avoid keeping manual checks on the products

i have searched for plugins, could find non, and almost all are too advanced for my use case and doin extra synchronization which is an overkill

also thought about using Odoo, this will improve our level of managing orders too, but found it also overkill and too expensive while we just need small sync for 1 field

as for prestashop we have the reference code, this should be the same SKU in Woocommerce version (this step should be done first of course and we are on it)

so the way we need is when product ordered, the stock goes down in both databases, when it is canceled the order goes up again.

maybe a way with a middle-man script is holding a 3rd database can be the answer, to allow us to edit the stocks when we have more to offer, so it is been synced in both shops?

i have done many edits to prestashop, bt usually i was messing with registration buggy form trying to simplify it (thanks to God and your help it was done)

and now stuck with this annoying lack of feature

thanks in Advance for help

  • Thanks 1

Share this post


Link to post
Share on other sites

And what do you expect for an answer?
They are completely two different systems and different functions and different databases.
You are here in the Prestashop forum, which is intended for the Prestashop system.
Did you also ask on the Wordpress forum?
In any case, there are two plugins, which means a higher price and it does not matter that you only want to synchronize the stock.

Programming both plugins with an estimated price of 120 €!

  • Thanks 1

Share this post


Link to post
Share on other sites

Hello, SamirGeorge

We are working in Both in WordPress and PrestaShop more than 6 years + from our experience. We suggest you create two different module and plusing.

 

1. You can search WooCommerce product status or stock from their api https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products

Then From Your PrestaShop module you can fetch the stock  and then update the stock via your PrestaShop module. This solution is for If your main store in WooCommece.

 

2. If your main shop in PrestaShop then you need to call PrestaShop api to check the status and then Update in WooCommerce.

 

We do not recommend any database level update because if you update via Rest api or api level , you have the full controll to update all the place where CMS upate their values.

If you created custome script to access database , it may made two problem

1. Security issue arries from that script

2. When datababase password change your script will not work. You need to update your script.

 

In the past we have done this kind of work to immport our WooCommerce product images and other to insert our PrestaShop site, because we have created same WooCommece theme in PrestaShop. This save our tons of times.

Hope my solution help you to understand the things. You can easily created by your self or some one else.

 

Thank you

Regards

Classy Devs Team

  • Thanks 2

Share this post


Link to post
Share on other sites

@ClassyDevs

That's a really great idea 🤣
Do you think it will update all products after placing an order via api?
There are more of those problems.

In WordPress, there are hooks right when completing the order, and in Prestashop as well.
No passwords are needed when everything is communicating via POST methods protected by a hash key and encrypted.

  • Thanks 1

Share this post


Link to post
Share on other sites

WordPress:

function mysite_woocommerce_payment_complete( $order_id ){

$order = wc_get_order( $order_id );

foreach ( $order->get_items() as $item ){ ...... }

}

PrestaShop:

public function hookActionValidateOrder{

...

}

Advise in a way ... I've already done it but I won't write anything or advice, it's easy, program it yourself is nonsense.
When a person comes for advice, he has no experience and do you advise him to program it himself?
Do you only want to advertise on your elementor?

@ClassyDevs, why do you give such bad advice?

Share this post


Link to post
Share on other sites

Hello,D. Tengler

Thank you for your message, it is not good to attack some one who try to  help other. If your option is better than it is appreciable. I am wondering why you told some one direct "Programming both plugins with an estimated price of 120 €!" , when they ask for solution , why didn't you put code at the first and write function , when we give then a solution which seemed better in our end. The function you provide also need the person  code them self or some one else to solve this.

Do you think, the above code block can be used by any person who have no experience in coding. I give the solution which seemed in my mind best. 

Can you please told , how any one apply your code and which file they need to put to resolve the above solution

N.B: Please do not  try to attack any one, we do not come to here to attack any one, respect other, people will respect you.

Thank you

Share this post


Link to post
Share on other sites

Thanks for your answers, but why being in attack mode to others, sometimes i misunderstand the question or get a wrong answer.

but as long as we are trying to help each other it is okay, as long as the community is willing to help.

 

i don't understand also why you say that 

8 hours ago, D. Tengler said:

And what do you expect for an answer?
They are completely two different systems and different functions and different databases.
You are here in the Prestashop forum, which is intended for the Prestashop system.
Did you also ask on the Wordpress forum?
In any case, there are two plugins, which means a higher price and it does not matter that you only want to synchronize the stock.

Programming both plugins with an estimated price of 120 €!

 isn't the forum a place to ask for help? many people code solutions and post it for the community sometimes with full functionality sometimes with fremium way.

 

i don't understand the way you make a joke of me for asking for help.

Share this post


Link to post
Share on other sites

Yes, I also agree with Mr Tengler.
The answer that it's simple is not true.
Creating a plugin for WordPress is approx. hour of work, creating a module for Prestashop is approx. hour of work.
Testing and integration of communication from Prestashop to WordPress and vice versa from Wordpres to Prestashop is approx. three hours of work.

  • Like 1

Share this post


Link to post
Share on other sites

When you go to a WordPress forum and write to give you a solution and a module for another system, do you think they will give you codes or a module for Prestashop?
Realize that giving codes or modules for free is not a matter of course !! There is some work behind it all.

Share this post


Link to post
Share on other sites
4 minutes ago, D. Tengler said:

You are here in the forum for Prestashop !!! There is no forum for Wordpress !!!
Are you going to ask for a competitive solution?

i have never asked for help and got such rude answer on any forum people are always willing to help, how free plugins exists? how is prestashop an opensource? you should change the way you think as even if someone where looking for urgent or big plugin and they are willing to pay, they will not pay for someone like you with such reaction 

7 minutes ago, D. Tengler said:

When you go to a WordPress forum and write to give you a solution and a module for another system, do you think they will give you codes or a module for Prestashop?
Realize that giving codes or modules for free is not a matter of course !! There is some work behind it all.

really no comment, you are just pushing me to pay you and if i am able to pay i would clarify that, but i am not and asking for hints and already asked like 3 questions

 

which will be the good solution 

doing real-time sync or middle man script or a erp system like odoo 

 

you completely skiped all my talk and just spoke about what concerns you, you are not willing to help with anything, so please stay out of my topic and search for people who wants your service somewhere else, and be polite to all the responders even if they give a wrong answer, at least they try to give help 

unlike you

  • Like 1

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

People, people go easy.

 @SamirGeorge   Please  formulate and format question bit. From what I have read first thought was you need a module to sync, so paid work.

You last post does clear that but to me it was not clear on first read.

@D. Tengler and @CedCommerce Team  please try to refrain for offering services outside of Job offers. Especially you CedCommerce Team you do have few warnings about that already.

You all can politely explain that what is needed is good amount of work and that it should be posted in Job offers. Like your last replay D. Tengler, move on to other topic.

And CedCommerce please understand, you may need work and  you look every post as possible one. But forum is primarily place to help each other.  And users, especially new ones 

comes in hope for some guideless.  And if they are bombarded with PM and paid offers then will not come much to forum. And maybe skip chance to get some help and later to help someone else.

Share this post


Link to post
Share on other sites
21 hours ago, D. Tengler said:

thanks for sharing info, i have already studied the case more, i understand that it won't be good to have direct sync and it will be much better to have something in the middle that catches the order and have 1 db with desired info to sync

 

in my case i will care only about SKU/Referrence and Stock (and any required fields to this)

 

this script shall be custom or ready made solution

 

 

current free option i have is http://www.myddleware.com/ to connect Prestashop to ERPNext

and ERPNext has an official module for woocommerce which i already tested

 

a lot of stuff i know but it is all free and adding a lot of functionality out of the box (like using ERP system for managing the work flow which is a big addition)

 

 

so Prestashop > myddleware.com > ERPNext > Woocommerce

 

still working on it and will keep you updated if i finish it soon

 

thanks for sharing your thoughts, any tips on that matter will be appreciated a lot

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More