php - Shopping cart quantity count to show up after form is submitted -


i have code configured count quantity of items have in shopping cart display in area on site customer can see how many items have in cart. problem having if click add cart, when form redirects quantity not show right away @ redirect. starts showing when leave go next page. wanting show right when click add cart.

the way have structured have file required load @ top of file in of pages. quantity count stored.

//shopping cart quantity count  if(isset($_session['shopping_cart']) && is_array($_session['shopping_cart'])) {     $totalquantity = 0;     foreach($_session['shopping_cart'] $product) {         $totalquantity = $totalquantity + $product['quantity'];     } }  else {    $totalquantity = 0; } 

i'm not sure if can done ajax or if can done through existing php code. not know hardly ajax, if way go will.

i'm looking hear ideas , maybe step in right direction of how execute this. first hand look, site working on buyfarbest.com


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -