Jump to content

Prestashop AJAX


Recommended Posts


This is article.




    public function getContent() {
        $ajax_url = $this->context->link->getAdminLink('AdminModules').'&configure='.$this->name;
        $res .= '<script>
                    url: \'' . $ajax_url . '\',
                    data: {
                        ajax: true,
                        action: \'MyAjaxMethod\',
                        my_name: "name_name"
        return $res;
public function ajaxProcessMyAjaxMethod() {
        $name = Tools::getValue('my_name');
        $a = "Hello " . $name . "!";
        return $a;
This code can and should work?
Edited by workstyling (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...