Could anyone help me why the following code returns empty result when use LIKE operator with addAttributeToFilter option? Thanks!
$productcollection = $this->_objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection')
->addAttributeToSelect(['name', 'price', 'image'])
->addAttributeToFilter('name', array('LIKE' => '%Iphone%'))
->setPageSize(10,1);
Best Answer
Use 'like' instead of 'LIKE'
You can print query following way: