1

I am building an online store with craft commerce, but I have a problem, I need to update a remote stock on every purchase, this stock is located in a remote server, do you know if exist a plugin that makes this task easier for me?

Maybe a plugin that sends a POST API on every purchase or something.

2

There is a first party web hooks plugin available here:

https://plugins.craftcms.com/webhooks https://github.com/craftcms/webhooks

That may well do what you need, but I have no personal experience of it, and of course any pre-built plugin will have some limitations.

Alternatively, you can write your own module to do this of course (https://craftcms.com/docs/3.x/extend/module-guide.html)

In essence, in that, you would listen to Commerce events (see https://craftcms.com/docs/commerce/3.x/extend/events.html for information on those) - and take whatever action you like when the event is triggered. Of course you have the full power/scope of PHP to do anything you like at that point.

It's highly likely you'll end up needing at least some custom module code in a typical Commerce project, so this might be a good place to get started!

1
  • it's just what I was looking for. Thank you!
    – juanjosezg
    Feb 9 at 4:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.