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
Related
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
I am trying to develop a Prestashop module for reading the sending address postal code of the user and, depending on the code do some actions. I am beginning with the modules developing and I am a bit lost. I suppose that I have to use a certain hook, but cant find the right, could be authentication, but I am not sure.
Which is the correct hook?
When ever a new object is saved or updated following hooks are called:
actionObjectAddBefore
actionObjectAddBefore
actionObjectAddAfter
actionObjectAddAfter
actionObjectUpdateBefore
actionObjectUpdateBefore
actionObjectUpdateAfter
actionObjectUpdateAfter
So in your case you should be able to use actionObjectAddressAddAfter.
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.
I want to know if there is any way to allow customers to add comments during checkout process when using Paypal checkout?.
EDIT: this comment will show up in the sales email and order.
I found some comments modules but seems to work only with the regular checkout process!.
Thanks in advance.
Adding that functionality with PayPal isn't an option, but you can add a comment after the order is placed on the thanks page.
You'll want to add a form with a text area to success.phtml, then follow the steps on the controller that it submits to. You'll probably want to submit to a custom module.
First, get the customer's last order:
$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
Next, take that order and update its comment.
$order->setCustomerNote($this->getRequest()->getParam('YOUR_COMMENT_FIELD_NAME'));
$order->save();
If you use AJAX you can return JSON stating the note has been saved (or a validation error occurred) directly from the controller and avoid the need for a view.
If you're unsure of how to go about creating a custom module I'd recommend starting here:
http://blog.baobaz.com/en/blog/developing-module-for-magento-tutorial-where-to-begin-part-1
The only change I'd recommend is not echoing your output (even if it is JSON directly from the controller), but instead using something like this:
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('status'=>'success')));
I want to implement one page checkout part of Magento from the outside of Magento structure (i.e. using API calls). If it is possible, I want to start using the existing code to reduce the implementation effort. So, how can I modify the existing checkout implementation in order to make it run from outside? Or, is there any other implementation which provides Magento checkout functionality together with the UI?
I'm not entirely sure what it is your after but if you're thinking of using Magento checkout say in Wordpress then you could simply include app/Mage.php and use pretty much all the functionality provided by Magento.
Say create a product (you would need one to check out) on the fly if it isn't already in Magento or render any templates - checkout in your case.
Not a problem to insert "add to cart" buttons to any website and use AJAX to request cart contents to the same page.
Also I just needed to code pretty much the same thing for OneStepCheckout which opens up in lightbox and allows you to check out from pretty much anywhere. HTML onepager for example or from Facebook:P