Jump to content

Using AJAX to dynamically update stock


cyanoxide

Recommended Posts

I've been tasked with building a stock ticker for one of our more exclusive products. There's going to be 500 of this product ever made and once they're sold out they won't be available again.

 

I've made and styled a section that is designed to lets the user know how many have been sold already using

{500 - $product->quantity} 

but I thought it would be cool if this could update in real time so if someone buys something the number goes down. The problem is that I'm not really too sure on how to go about doing this within a smarty .tpl file so any help would be appreciated.

 

tl;dr I'm looking to use AJAX to display the value of $product->quantity in real time within my product.tpl file

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