Jump to content

Ajax shopping cart?


poleposters

Recommended Posts

Hi all,

 

I've been learning PHP and a little javascript for a couple of months and am just investigating ajax.

 

I have list of items on my page and what I'd like to do is, when a customer adds one of the items on the list to the shopping cart, for the items to appear on one of the side divs without refreshing the page.

 

Is this something that can be achieved with Ajax?

 

If so, can anyone explain in broad terms how this could be achieved? (I can learn to do the scripting myself)

 

Cheers.

 

 

Link to comment
https://forums.phpfreaks.com/topic/102903-ajax-shopping-cart/
Share on other sites

Yes this is possible.

 

You would create an XMLHttpRequestObject, make each item active an Ajax function to send the data to a php file, therefor inserting the data, then printing it out, then taking the response and displaying in the <div id="shopping_items"></div>

 

Its pretty hard to explain without any coding.

Link to comment
https://forums.phpfreaks.com/topic/102903-ajax-shopping-cart/#findComment-527545
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.