newFindCommand('emart_products'); $findCommand->addFindCriterion('id_product_pk', $pid); $result = $findCommand->execute(); $records = $result->getRecords(); foreach ($records as $record) { return $record->getField('product_name'); } } function get_price($pid){ include 'fm_connect.php'; $findCommand =& $fm->newFindCommand('emart_products'); $findCommand->addFindCriterion('id_product_pk', $pid); $result = $findCommand->execute(); $records = $result->getRecords(); foreach ($records as $record) { if ($record->getField('onsale') == 1){ $discountprice=$record->getField('price_sale'); } elseif ($record->getField('onclearance') == 1){ $discountprice=$record->getField('price_clearance'); } elseif($_SESSION['discount']==="CED"){ $discountprice=$record->getField('price_mart_CED'); } elseif ($_SESSION['discount']==="Wholesale"){ $discountprice=$record->getField('price_mart_wholesale'); } else{ $discountprice=$record->getField('price_mart_retail'); } return $discountprice; } } function remove_product($pid){ $pid=intval($pid); $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid']){ unset($_SESSION['cart'][$i]); break; } } $_SESSION['cart']=array_values($_SESSION['cart']); } function get_order_total(){ $max=count($_SESSION['cart']); $sum=0; for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['productid']; $q=$_SESSION['cart'][$i]['qty']; $price=get_price($pid); $sum+=$price*$q; } return $sum; } function addtocart($pid,$q){ if($pid<1 or $q<1) return; if(is_array($_SESSION['cart'])){ if(product_exists($pid)) return; $max=count($_SESSION['cart']); $_SESSION['cart'][$max]['productid']=$pid; $_SESSION['cart'][$max]['qty']=$q; } else{ $_SESSION['cart']=array(); $_SESSION['cart'][0]['productid']=$pid; $_SESSION['cart'][0]['qty']=$q; } } function product_exists($pid){ $pid=intval($pid); $max=count($_SESSION['cart']); $flag=0; for($i=0;$i<$max;$i++){ if($pid==$_SESSION['cart'][$i]['productid']){ $flag=1; break; } } return $flag; } ?> Event Decor Mart - Wholesale Professional Event Decor & Draping Supplies
Enter your email below to reset password:


   Continue Shopping as Guest