envexlabs Posted October 25, 2007 Share Posted October 25, 2007 Hey, I have a cart that displays the total of all items in the cart. The items are added/removed from the cart via ajax, and i want to be able to update the total when an item is added/removed from the cart. How would i go about creating a loop or something that is constantly checking to see if $total has been changed? Thanks, envex. Quote Link to comment https://forums.phpfreaks.com/topic/74764-constantly-checking-if-a-variable-has-been-changed/ Share on other sites More sharing options...
premiso Posted October 25, 2007 Share Posted October 25, 2007 Why create a loop? Whenever an item is added or removed, change the total accordingly...Since you know when it needs to happen, no need to loop. Quote Link to comment https://forums.phpfreaks.com/topic/74764-constantly-checking-if-a-variable-has-been-changed/#findComment-377962 Share on other sites More sharing options...
MadTechie Posted October 25, 2007 Share Posted October 25, 2007 echo $premiso; echo "and for Qty use on change!"; Quote Link to comment https://forums.phpfreaks.com/topic/74764-constantly-checking-if-a-variable-has-been-changed/#findComment-377963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.