Magento 2 Knockout Js Simple Module

Magento 2 is heavily using Knockout Js on frontend. You can find  Knockout in Magento 2 on almost every page. For example in : on minicart vendor\magento\module-checkout\view\frontend\templates\cart\minicart.phtml <div id=”minicart-content-wrapper” data-bind=”scope: ‘minicart_content'”> <!– ko template: getTemplate() –><!– /ko –> </div> To understand how it works, I created a simple module Magento 2 Knockout…

Magento 2 How to create custom query

Magento 2 How to create custom query that is the question sometime is popped up on your head. Here is how I create my own custom queries in Magento 2. Currently, I figured out two ways : 1/ Take advantage of using Magento Resource Connection. $themeId=3; $this->_resources = \Magento\Framework\App\ObjectManager::getInstance() ->get(‘Magento\Framework\App\ResourceConnection’); $connection= $this->_resources->getConnection(); $select…

Magento 2 Learning Resources

Magento 2 Learning Resources are listed as below : Official Magento 2 Developer Docs: http://devdocs.magento.com/ Alan Kent’s Blog: http://alankent.me/ Alan Storm’s Blog, Magento 2 category: http://alanstorm.com/category/magento-2 Karen Baker’s Blog, Magento 2 articles: http://karenbaker.me/category/magento-2/ MageClass, Magento2 tutorials, screencasts and up to date news: http://mageclass.com FireBear Studio blog, collection of tutorials and…

Fix Magento 1.9.2 Notice: Undefined variable: block in …/Template/Filter.php line 187

Recently we have this bug ” Notice: Undefined variable: block in …/Template/Filter.php line 187 ” on a project after updating SUPEE-6788 in Magento 1.9.2.x . After installation of the patch some parts of the front-end home page template stayed blank. Review of the exception.log file shows a number of exceptions that occur from…

Magento – TinyMCE Image Uploader – Image incorrect URL

Recently, I have worked on a project which has this strange bug, the image url in Wysiwyg is not correctly. Only administrator can see this image while guess users can not see it. For example : the image url which is generated by Wysiwyg : <img src=”http://www.mysite.com//index.php/admin/cms_wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvcmd0LXNsaWRlci1pbWcwMS5qcGcifX0/key/ceed8184f5f336aafcc307f8623aff45/” /> In that case, the…

Get addtional attributes product Magento

Follow the below codes to get addtional attributes product Magento $tmpProd = Mage::getModel(‘catalog/product’)->load($product->getId()); $attributes = $tmpProd->getAttributes(); $addtionalAttributes = array(); foreach ($attributes as $attribute) { if ($attribute->getIsVisibleOnFront()) { $addtionalAttributes[“{$attribute->getStoreLabel()}”] = $attribute->getFrontend()->getValue($tmpProd); } }

Please Add Widget