This might be a simple solution, however I am not able to come up with it, therefore any help is welcome.
I have a shopping basket so customers can add different items for it (as normal) On some of these Items there are conditions and when added to the basket I'd like to show them up, however I have it setup so it checks for the value, but it only takes the value from the last added item.
Have the following
public function get_contents() {
$items = array();
foreach($this->items as $tmpItem) {
$item = null;
$item['Condition'] = $this->Conditions[$tmpItem];
$items[] = $item;
}
return $items;
}
foreach($this->items as $item) {
if(strstr($this->Conditions[$item], 'no') ==!false) {
$this->Conditions = 'no';
$item['Condition'] = $this->Conditions;
} else
$this->Conditions = 'yes';
$item['Condition'] = $this->Conditions;
What I would like to do is if any of these items contain the condition 'no'
$this->Conditions = 'no';
$item['Condition'] = $this->Conditions;
However it only takes the value of the last added item Any help welcome