Hello,
I'm developing an encapsulated plugin for Zen Cart 2.1 and have run into a persistent AJAX routing issue.
My plugin successfully injects JavaScript onto the page, and that script makes a standard POST request to ajax.php with an action and method (e.g., ajax.php?act=MyAction&method=myMethod). The POST data correctly includes the securityToken.
When the call is made, the server responds with a 400 Bad Request. This indicates the ajax.php router is receiving the request but rejects the action as invalid.
My AJAX handler class (e.g., class zcAjaxMyAction) and its corresponding file (zcAjaxMyAction.php) are located in my plugin's .../catalog/includes/classes/ajax/ directory. The class and file names appear to follow the standard zcAjaxPascalCase convention.
What is the definitive method for an encapsulated plugin to register its AJAX handler classes so they are discoverable by the ajax.php router? The automatic discovery does not seem to be working, and my attempts to manually register the path using an auto_loaders config file have failed.
Any insight into the correct process for ZC 2.1 would be greatly appreciated. Thank you!
Bookmarks