I am in the final stages of an e-commerce project, and I want to check the cart objects. I know that I must be doing some really silly things here but I cant work out what. Here is the array of information I am given:
Array ( [0] => stdClass Object ( [cart_item_id] => 171 [cart_id] => 1 [nid] => 4058 [qty] => 1 [changed] => 1281174017 [data] => Array ( [attributes] => Array ( ) [shippable] => 1 [module] => uc_product ) [title] => PRODUCT TITLE [vid] => 4058 [cost] => 0 [price] => 62.2 [weight] => 1694 [module] => uc_product [model] => 227 ) [1] => stdClass Object ( [cart_item_id] => 172 [cart_id] => 1 [nid] => 4054 [qty] => 1 [changed] => 1281174029 [data] => Array ( [attributes] => Array ( ) [shippable] => 1 [module] => uc_product ) [title] => PRODUCT TITLE [vid] => 4054 [cost] => 0 [price] => 9.9 [weight] => 145 [module] => uc_product [model] => 223 ) [2] => stdClass Object ( [cart_item_id] => 173 [cart_id] => 1 [nid] => 3903 [qty] => 1 [changed] => 1281174064 [data] => Array ( [attributes] => Array ( ) [shippable] => 1 [module] => uc_product ) [title] => PRODUCT TITLE [vid] => 3903 [cost] => 0 [price] => 9.2 [weight] => 145 [module] => uc_product [model] => 44 ) )
Here is the array I want to perform my check on:
Code: Select all
$array = array(9, 7, 44, 17, 3);What I want to do is the following
For each item in Products array
If uc_product[model] is not in $array
Running Total = Running total + [price]
I know this is a very bespoke question, but help would be very much appreciated.
Regards