Magento: Trigger a call on recurring (checkout) - php

I'm looking for a link or tutorial on how to trigger a http call or function/method/class each time a recurring/sale/checkout is made in Magento..
I need to book all sales in an external accounting service
Have looked at this link, but it doesn't look like it can trigger on events in Magento?! Here you need to make the calls external
http://www.magentocommerce.com/wiki/doc/webservices-api/api
Really hope someone could help me :)

In every event, magento has been add a dispatchEvent.
like sales_order_save_after/sales_order_delete_after/customer_customer_save_after or many more. check the $_eventPrefix on a class. if there is $_eventPrefix on a class then you can call the Mage::DispatchEvent for trigger a call.
MagentoCommerce
Inchoo

Related

Trigger a specific button and run some code with Prestashop

I wanted to run some code via PrestanShop when a specific button is pressed, before/after the designed action is happened.It's not alter the designed action, just is send some notification to an external system (notify the 3-rd party that we have a new sale and maybe with sales detalis: product, prices, etc)
To be more specific the action is finish a sale(or make an order) when click the related button.
I read something related (hooks and module) but maybe someone have the same issue then any help is appreciated.(even with no code, but good hints)
Maybe what hook is to be triggered here or some hints how to alter the code using PS-standards.
(light way and not just adding some php code to alter in the hard way the core)
Note: language on interface is romanian and the action is when a sale is post into the system (became an order, payments is not relevant/order_status).
Thank you,
Traian
You can use actionValidateOrder and make your call to your 3rd party in this function.
This hook is called here :
classes/PaymentModule.php line 716

Create custom notification event Carttrob

If I need to create a custom notification event, that sends an email when the user arrives to the ORDER SUMMARY page (coming from CHECKOUT page, but I don't think that matter) what should I do?
I found this on the documentation: https://www.cartthrob.com/docs/developers/notifications/index.html#registering-an-event
But is necessary to create an extension or a module only for an event?
Can you provide me a very basic example on how can I create an event and how can I call it on the order_summary.html ? Maybe an EE tag?
(I'm with Vector, the people behind CartThrob)
You'll definitely need some kind of custom code to create a custom event. Typically yes, that'd be in the form of an extension or module.
That said, it doesn't need to necessarily be a CartThrob notification in your case. Something like this might work: https://devot-ee.com/add-ons/email-from-template
If you want to use CartThrob notifications, you'd have your custom module or extension add the notification type to CartThrob as shown on the page you linked. Then on the summary page you'd have a tag from your custom module, and that tag's logic would fire the notification.
If you need more help with this it's certainly something we can build for you. Feel free to email us at support#cartthrob.com!

Call same events from different modules in Opencart

I have two different modules and with installing that modules i am creating two events, names are different, event's trigger is same (i.e. admin/model/customer/customer/addCustomer/after) and action are also different in OpenCart 2.3.
My Problem is when i add the customer from admin side it executs only for first module. It does not execute for second module.
if i uninstall the first module and add the customer then event for my second module is working fine,
I want to execute some code from two different modules when customer will be added by administrator,
Can anybody help me with this.
I had similar issue in my event call. Kindly check that in your custom event function you are not returning anything after function call.
If you are returning it anything it will come out from the event logic and will not run your or any other module's event.
So kindly comment any return done in your function and test.
Hope it helps.
Never return values incase you are calling any CURL or third party API.
instead of returning values you can store it in any global variables and go ahead.

how to execute a query in magento when order is successfull

Im new to magento,
I need to execute a query to insert a flag into orders table of magento when an order is successful (i.e returned from payment page), Ive found the front end files, but not sure where to place the code to execute this simple query, Im not comfortable with folder structure of magento.
Im using magento 1.7 currently
Please help me if you know where is the controller file to achieve this, if you can give me the file paths and class names it will be much helpful for me to uderstand this.
You need to get the event for OrderAfterSave, In observer file, you will get the last order id by using that you could insert flag.
Here is the link to tutorial. Hope this will help
http://blog.decryptweb.com/event-observer-magento/
You should use an Observer for this as it is the cleanest method as you do not have to rewrite any core files.
See http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/ for a full list of observers in Magento 1.7
See http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method for more information about using observers.
If you want to observer the order success action I would use checkout_onepage_controller_success_action there are many others regarding orders, something like checkout_type_onepage_save_order_after as it will give you access to the order object which you will not have to reinitialize.

How to capture opencart (1.5.1) order confirm event?

When confirm(...) (in order.php) is called by a payment method module how can I get notification of this event and run my own method to process the data for an accounting module(I need to parse the order and send it to quickbooks)?
I am aware I could place a call in the confirm method. However, because of the license I want to avoid modifying anything in the OpenCart code.
Anyone know how to hook into OpenCart order confirm events? Is there a built-in means of notification?
There is no hooking method in OpenCart that you could do this with. The correct method to achieve this would be to use vQmod and add your code to the confirm() method as you've mentioned. That said, I'm not entirely sure what you are referring to with the license. You are free to modify the source code of OpenCart as you wish

Categories