Jump to content

AJAX order steps on main page


Recommended Posts

The thing I want to accomplish is making order on the site by loading the order "Order steps" page in modal window or slide down block. I've been reading about AJAX in Prestashop, but still, didn't understand how this should work. Can anyone explain how can I properly call the other page with AJAX in Prestashop? 

Thank you in advance.

Link to comment
Share on other sites

 

if you aren't familiar with php and js it will not be as easy as it seems.

to call ajax query you have to use jquery library

$.post("URL TO POST", variables, function(data) {
//DO SOMETHING
});

I'm familiar with JS and AJAX itself (PHP, I guess, is still my trouble), but, looks like there is something more in Prestashop, that I should know about that to do so. 

First, I am sending $.post to order-opc.php. Then, I am getting response like this:

url: '{$base_dir}modules/order-opc.php',
type: 'get',
data: 'ajax=true',
success: function(data) {
//Append order-steps to current page body
$('body').append(data);

But, as I see, this approach isn't working here.

Link to comment
Share on other sites

Hm, nice idea. What if I will load the page in regular iframe? It's not a crossdomain call, so I can even style it whatever I want. 

As I remember, fancybox with 'iframe: true' opens a modal window. But how can I open this window inside the page itself? In slide down menu or something.

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