Monday 10 July 2017

Magento get All search terms using programatically

<?php
//echo "hiii";die("here");
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once(__DIR__ . '/app/Mage.php');
Mage::app();
umask(0);
$searchCollection=Mage::getModel('catalogsearch/query')->getCollection();
//echo "<pre>";print_r($searchCollection->getData());die("here");
$searchData = $searchCollection->getData();
foreach($searchData as $terms){
echo $terms['query_text'];
echo "<br />";
}
die("here");
?>

2 comments:

Product Collection with out of stock and In Stock in Magento 2

Product collection with out of stock and In stock. use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; $collection = $th...