Ajax Requests
Is it possible to use the XCN Ajax handlers from our own code without extending what is there already?
I see when you drag an item to the cart it passes two specific paramaters, "cart" and "add" which I guess gets converted to doActionAdd() in CartAbstract.php So if I wanted to call myFunction() in myControllerClass.php what parameters do I need to pass using the existing handlers? Unless of course I'm barking up the wrong tree. |
Re: Ajax Requests
Yes, it is possible, but it depends on what you do.
You can't directly call a PHP method from JavaScript, but you can run an action in a controller class as follows: Code:
core.post( This will run \Xlite\Controller\[current-area]\Example::doActionTest(). Please could you explain the desired behavior in details? |
Re: Ajax Requests
That gave me enough info to do what I wanted.
It was for a button to attach an image to an order. |
Re: Ajax Requests
Here is a tutorial on working with AJAX requests:
https://github.com/litecommerce/core/wiki/How-to:-Working-with-AJAX |
All times are GMT -8. The time now is 06:30 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.