// Code to Search Product by $searchstring and get Product IDs
$product_collection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('name', array('like' => '%'.$searchstring.'%'))
->load();
foreach ($product_collection as $product) {
$ids[] = $product->getId();
}
$product_collection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('name', array('like' => '%'.$searchstring.'%'))
->load();
foreach ($product_collection as $product) {
$ids[] = $product->getId();
}
No comments:
Post a Comment