$this->data['logged'] = $this->customer->isLogged(); 'in_myproducts' => in_array($result['product_id'], $my_products), $my_products = array(); if($this->customer->isLogged()) { $sql = "SELECT product_id FROM " . DB_PREFIX . "my_products WHERE customer_id ='".(int)$this->customer->isLogged()."'"; $query = $this->db->query($sql); foreach($query->rows as $p) { $my_products[] = $p['product_id']; } } 'in_cart' => in_array($result['product_id'], $products_in_cart), $products_in_cart = $this->cart->getProductsInCart();