PHP expert eye badly needed to look over some code

Permalink
Hello World!

I manage a site selling courses on which we have a course calendar page which lists all our courses in one place. Could any of you lovely PHP experts out there let me know why only one course is displayed when two (or more) courses start on the same date?

I would be extremely grateful for any help you can offer.

Thank you!

public function lists() {
        $productss = array();
        //$order = new CoreCommerceProduct();
        $db = Loader::db();
        $sql = $this->getAllProductFromSearch(); //'select * from corecommerceproducts';
        $rows = $db->GetAll($sql);
        foreach ($rows as $row) {
            $products = CoreCommerceProduct::getByID($row['productID']);
            if (!is_object($products) OR $products->isSoldOut()) { /* OR !$products->isProductEnabled() - before last ')' */
                continue;
            }
            array_push($productss, $products);
        }
        $this->set('products', $this->filterProducts($productss));
    }