Jump to content

Prestashop AJAX


KenFranklin

Recommended Posts

Hello!

This is article.

-----------

http://opencart.hostjars.com/blog/68

-----------

    public function getContent() {
        $ajax_url = $this->context->link->getAdminLink('AdminModules').'&configure='.$this->name;
        $res .= '<script>
                $.ajax({
                    url: \'' . $ajax_url . '\',
                    data: {
                        ajax: true,
                        action: \'MyAjaxMethod\',
                        my_name: "name_name"
                    }
            });
        </script>';
        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...