View Single Post
  #2  
Old 06-25-2019, 04:55 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: List of X-Cart hooks

Hi @dotancohen,

Welcome to X-Cart forums!

X-Cart does not use hooks that allow you to insert your code only into particular parts of the business logic.
Instead, we use the decorator pattern that allows you to change every piece of the software:
https://devs.x-cart.com/getting_started/applying-logic-changes.html

In your particular case, you need to create a module that would decorate \XLite\Model\Order::processSucceed() method and insert your code there.

This processSucceed() method is called when the order is accepted in the system.

Let me know if it makes sense to you.

Tony

Quote:
Originally Posted by dotancohen
I am considering using X-Cart for a project. A critical step would be to make an HTTP request to a remote server on order completion. I have tried to search for a list of hooks, but found only the upgrade hooks:
https://devs.x-cart.com/misc/upgrade_hooks.html



Are there any other hooks available in X-Cart, or would one have to modify the core X-Cart files? Where is there a list of X-Cart hooks?


Thank you.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote