Trigger a specific button and run some code with Prestashop - php

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

Related

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!

Joomla PHP code

I'm new in using Joomla and i need your help please.
I'm newly working in a company. The company bought a web shop from other company and the web shop is live now.
One button in one of the pages is responsible to place an order and the action for this button is to send an email with all the data about the orders to my company.
Now my task is to develop an API which does the following:
when clicking on that button the information should be handles in certain way and sent to other system which our company have and this system is used by my company to handle the different orders.
My problem is that i can't find the php page that contains the code which is creating these orders email in order to change it.
Is there is any tool or plugin which might help or do you have any idea how to handle this situation?
Hint: I'm not able to get any support from the company who programmed the web shop
It is very hard to tell you what to do when we don't even know which Joomla e-commerce extension you are using. Nevertheless, there are things that you can do to find out which file is doing the actual processing of the order.
However, before even doing that, you will need to define what "order processing" means. Is it when the order is saved to the database? Is it when the order is approved by the payment gateway?
In the first case, you will need to look up for code saving the data to the database (which is likely in the models folder of the extension - it might also be in the controllers), in the latter case, you will need to look up for the code processing the payment (which is likely in the controllers folder or the helpers folder).
Note that some "advanced" e-commerce extensions trigger events when an order is processed that you can use in a plugin in order to do what you want.

Magento: Trigger a call on recurring (checkout)

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

Disable One-Page Checkout in OpenCart

How can I disable OnePage Checkout in OpenCart?
Version 1.5.x comes with it in the default template and I would rather not use it as we want to have step by step pages and not use Ajax (speed/page views and process serves our needs better) for our customers.
It is possible to remove the one-page setup, but you'll have to do a very good work on the template (the checkout folder contains all steps). You will need personalized controllers as well. The built-in checkout page uses jQuery and Ajax to gathering all the information necessary in only one page, to send everything together when the customer clicks "confirm".
Once you don't want to use ajax, you will have to send the information from one page to the next using post requests, putting then in hidden <input>'s and/or in $_SESSION variable. Anyway, you will have some problems with the countries and locations, since OpenCart retrieves then via ajax.
Actually, some time ago I've found some templates on ThemeForest and other sites that implemented what you want, but I don't know if they are available anymore.
I would actually recommend you use something like Uber Checkout which while its still a short checkout process, is better visually as you don't have the panels that are standard in 1.5.X. If you're wanting to completely rewrite it to work like the old checkout system, well in theory it's already there, you just need to rewrite the controllers for the various steps to output full pages rather than JSON and put in validations through each step to make sure previous steps have been completed

How can I do Magento one page checkout (together with the UI) using API calls?

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

Categories