Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    Call Ajax request in X-cart(5.3.x) template(Backend)

    Trying to use Ajax to pass some data to PHP file from x-cart(version5.3 or above) template is causing an error (403 Forbidden Access ). So, let’s learn that how to fix that types of error in x-cart. Please follow the below example:


    Like I just want to perform an ajax request in admin view page section of x-cart on a button click that calls a function of same view page controller class. The Ajax request code is as below:


    So, if I call such ajax request to target controller class then it throws a 403 Forbidden Access. To solve such types of error we must need to write a function name [ defineFreeFormIdActions()] in that controller then write your action function in that controller as below :

    Hope that will help you. Thank You 🙂
    . . .

    Comments (4)

    Add Your Comment

  • Gary Pettigrew
    I’m actually having an issue with Xcart rendering the dashboard instead of just the JSON response.
    • Webkul Support
      Can you please explain in details about your issue, so that I will explain in better way.
      Best Regards: Ajeet Singh Joomla Department Webkul Software Pvt. Ltd.
  • Смолин Павел
    • Webkul Support
      Actually, core.get() are common object/method provided by x-cart core (x-cart_site/classes/XLite/Core) class that allow to used in an Ajax request (or objects in most cases).
      Best Regards: Ajeet Singh Joomla,x-cart Department Webkul Software Pvt. Ltd.
  • Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again