protected function controlProductsCompare()
    {
        $options = array(
            'status' => 1,
            'store_id' => $this->store_id,
            'product_id' => $this->product_compare->getList()
        );

        if (!empty($options['product_id'])) {
            $existing = array_keys($this->product->getList($options));
            if (array_diff($options['product_id'], $existing)) {
                $this->product_compare->set($existing);
            }
        }
    }
protected function controlProductsCompare()
    {
        $options = array(
            'status' => 1,
            'store_id' => $this->store_id,
            'product_id' => $this->product_compare->getList()
        );

        if (!empty($options['product_id'])) {
            $existing = array_keys($this->product->getList($options));
            if (array_diff($options['product_id'], $existing)) {
                $this->product_compare->set($existing);
            }
        }
    }
protected function controlProductsCompare ( ) { $ options = array ( 'status' => 1 , 'store_id' => $ this -> store_id , 'product_id' => $ this -> product_compare -> getList ( ) ) ; if ( ! empty ( $ options [ 'product_id' ] ) ) { $ existing = array_keys ( $ this -> product -> getList ( $ options ) ) ; if ( array_diff ( $ options [ 'product_id' ] , $ existing ) ) { $ this -> product_compare -> set ( $ existing ) ; } } }
Make sure that products saved in cookie are all valid and available to the user
If some products were removed, disabled or moved to another store they will be removes from cookie
Make sure that products saved in cookie are all valid and available to the user If some products were removed disabled or moved to another store they will be removes from cookie