query($sql); $row = $d->fetch_array(); return $row; } function remove_product($pid,$size,$mau){ $pid=intval($pid); $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid'] && $size==$_SESSION['cart'][$i]['size'] && $mau==$_SESSION['cart'][$i]['mau']){ unset($_SESSION['cart'][$i]); break; } } $_SESSION['cart']=array_values($_SESSION['cart']); if(count($_SESSION['cart'])==0) { $redirect=true; } else { $redirect=false; } } function get_order_total(){ global $d; $max=count($_SESSION['cart']); $sum=0; for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['productid']; $q=$_SESSION['cart'][$i]['qty']; $price=get_product($pid); $sum+=$price['gia']*$q; } return $sum; } function get_total(){ $max=count($_SESSION['cart']); $sum=0; for($i=0;$i<$max;$i++){ $q=$_SESSION['cart'][$i]['qty']; $sum+=$q; } return $sum; } function addtocart($pid,$q,$size,$mau){ if($pid<1 or $q<1) return; if(is_array($_SESSION['cart'])){ $ck=product_exists($pid,$size,$mau); if($ck==-1) { ## Sản phẩm chưa có => thêm vào giỏ hàng $max=count($_SESSION['cart']); $_SESSION['cart'][$max]['productid']=$pid; $_SESSION['cart'][$max]['qty']=$q; $_SESSION['cart'][$max]['size']=$size; $_SESSION['cart'][$max]['mau']=$mau; } else { ## Sản phẩm đã có => cộng dồn số lượng $_SESSION['cart'][$ck]['qty']=$q+$_SESSION['cart'][$ck]['qty']; } } else{ $_SESSION['cart']=array(); $_SESSION['cart'][0]['productid']=$pid; $_SESSION['cart'][0]['qty']=$q; $_SESSION['cart'][0]['size']=$size; $_SESSION['cart'][0]['mau']=$mau; } } function product_exists($pid,$size,$mau){ $pid=intval($pid); $max=count($_SESSION['cart']); $flag=-1; for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid'] && $size==$_SESSION['cart'][$i]['size'] && $mau==$_SESSION['cart'][$i]['mau']){ $flag=$i; break; } } return $flag; } ?> News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM

News - LOGI VIETNAM
News - LOGI VIETNAM
Menu

News

Tide® Launches New Eco-friendly Detergent, Tide purclean

Tide® has been committed to developing detergents that provide environmental benefits like energy and water savings without compromising on the clean consumers demand. Today, hitting shelves across the country is the latest innovation in Tide’s ongoing commitment to sustainability: Tide...

Fines fail to stem tide of imitation goods

Weak penalties for distributing imitation goods and overlapping authority by various agencies assigned to control the market have made enforcement of intellectual property and consumer protection laws difficult, according to the deputy head of the Ha Noi’s market watch department

Detergent market suddenly gets fierce

With the total estimated revenue of $600-650 million a year and the average growth rate of 10 percent, the Vietnamese detergent market is believed to have great potentials

Procter & Gamble Branded Is The Best Workplaces

Through its more than 300 health and beauty brands, The Procter & Gamble Company estimates that it touches consumers three billion times a day (yes, that’s billion with a “b”), all over the planet. But unless they read the 6-point...

History & Development

Candlemaker William Procter and soapmaker James Gamble, both born in the United Kingdom of Great Britain and Ireland, emigrated from England and Ireland, respectively. They settled in Cincinnati initially and met when they married sisters, Olivia and Elizabeth Norris.[6] Alexander...

P&G Presents at the Barclays Back-to-School Consumer Conference

Earlier today, P&G’s Chief Financial Officer Jon Moeller was a featured speaker at the Barclays Back-to-School Consumer Conference in Boston.

Online Upstarts Pose a Threat to Procter & Gamble

Shave Club syndrome could hamper Procter & Gamble’s makeover.

P&G To Build $100M Gillette Factory In Vietnam In The Sign Of Strong Confidence In Asian Market

Procter and Gamble Co (NYSE:PG) has broken ground on the construction last week of a $100 million Gillette factory in the South-Asian nation of Vietnam. The factory will be built in the province of Binh Duong, where P&G has an...
Close
Sản phẩm
Đơn giá
Số lượng
Thành tiền
Thành tiền: