Back to PhocacartCompare class

Method getItemsIdString

public
getItemsIdString
(mixed $items)

Method getItemsIdString - Source code

public function getItemsIdString($items)
{
    $itemsR = '';
    if (!empty($items)) {
        $itemsA = array();
        foreach ($items as $k => $v) {
            if (isset($v['id']) && (int) $v['id'] > 0) {
                $itemsA[] = $v['id'];
            }
        }
        $itemsR = implode(',', $itemsA);
    }
    if ($itemsR == '') {
        return false;
    }
    return $itemsR;
}