| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
#1
|
|||||||
|
|||||||
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.
__________________
Xcart 4.4.? Xcart Next Litecommerce with Drupal http://www.corbywebworx.com Custom Mods, Hosting and Support for Xcart-Next and LiteCommerce |
|||||||
#2
|
|||||||||
|
|||||||||
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:
This will run \Xlite\Controller\[current-area]\Example::doActionTest(). Please could you explain the desired behavior in details? |
|||||||||
#3
|
|||||||
|
|||||||
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.
__________________
Xcart 4.4.? Xcart Next Litecommerce with Drupal http://www.corbywebworx.com Custom Mods, Hosting and Support for Xcart-Next and LiteCommerce |
|||||||
|
#4
|
|||||||||
|
|||||||||
Re: Ajax Requests
Here is a tutorial on working with AJAX requests:
https://github.com/litecommerce/core/wiki/How-to:-Working-with-AJAX |
|||||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|