Hi guys,
How would I write a small script in php to count the unique values in the below array :
the below code if part of cubecart 3.20 shopping cart, I need to count the unique number of Seller_ID fields within this array in the basket
to be able to calculate shipping according to the number of sellers. How would I to this ? please any help is appreciated.
if(isset($_GET['act']) && $_GET['act']=="step4"){
// set live vars for order inv and its the last step
$view_cart->assign("QUAN_DISABLED","disabled");
$view_cart->assign("TEXT_BOX_CLASS","textboxDisabled");
$basket = $cart->setVar($productId,"productId","invArray",$i);
$basket = $cart->setVar($product[0]['name'],"name","invArray",$i);
$basket = $cart->setVar($product[0]['productCode'],"productCode","invArray",$i);
$basket = $cart->setVar($plainOpts,"prodOptions","invArray",$i);
$basket = $cart->setVar(sprintf("%.2f",$price*$quantity),"price","invArray",$i);
$basket = $cart->setVar($quantity,"quantity","invArray",$i);
$basket = $cart->setVar($product[0]['digital'],"digital","invArray",$i);
$basket = $cart->setVar($product[0]['Prod_Seller'],"Prod_Seller","invArray",$i);
$basket = $cart->setVar($product[0]['Seller_ID'],"Seller_ID","invArray",$i);
} else {
$basket = $cart->unsetVar("invArray");
}