Jump to content

Loading Modules with JavaScript


PDI247

Recommended Posts

I may just be searching with the wrong keywords, but I can't seem to find anyone wanting to/trying to load modules using JavaScript. Specifically, I'd like to have a module loaded into a third-party site for information purposes. For example, a progress bar displaying how far along the user is in certain ways. And I'd like to do this dynamically, in a way it could automatically update itself on-the-fly on the site.

 

The problem is, I can't seem to figure out how to load modules from normal PHP/JS. When I attempt to use the $.load() on the tpl file, it pretends the file doesn't exist. When I try it on the .php file, it's blank. I'm open to just about any method, as long as it doesn't involve convincing the third-party site to incorporate PS.

 

Is there a way to embed a module without breaking the module down into normal HTML/PHP files?

 

Thanks!

Edited by PDI247 (see edit history)
Link to comment
Share on other sites

The only way to access the module is by a Hook, Instantiating the module (and you need a public method) and finally through a controller (in ps 1.5 and newer).

 

Does that mean it's impossible to load anywhere other than PS, or do multiple files have to be loaded, or the controller has to be loaded? Assuming latest version (1.6.1.1, I think).

 

Thanks!

Link to comment
Share on other sites

I'm not sure if you're talking about a module you have written yourself or a built-in one. You can execute module functions within php (it's actually how the custom Prestashop hook smarty function operates to arbitrarily add hook output in a template) but it would seem to me that you would want to create a module front controller for this - but just make sure that it's "content-only" so you don't fetch an entire page.

 

A little more detail on what specifically you're trying to achieve would help.

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...