Magento: Display Product Price Including Tax

To display/show product price including tax amount, you need to do some configuration settings. 1. Create Tax Rule You need to create tax rules (Sales -> Tax -> Manage Tax Rules). For this, you can refer to different tutorials available over the internet on creating Tax rules. 2. Assign Tax Rule to Product Then, you … Read more

Recommender System using JAVA & Apache Mahout

Apache Mahout is a project of Apache Software Foundation. Mahout helps building scalable Machine Learning applications. It primarily focuses in the areas of Collaborative Filtering, Classification, and Clustering. Here is a very nice video tutorial on Mahout Item Recommender Tutorial using Java and Eclipse. It thoroughly explains about how to use Movielens dataset and create … Read more

Recommender System using Python & Crab

Crab as known as scikits.recommender is a Python framework for building recommender engines integrated with the world of scientific Python packages (numpy, scipy, matplotlib). Currently, Crab supports two Recommender Algorithms: User-based Collaborative Filtering and Item-based Collaborative Filtering. Here is a tutorial on Introduction to Recommender Systems with Crab. It briefly explains about what Recommendation is, … Read more

Magento 2: Get parent category, children categories & product count

This article shows how we can get parent category, children categories and total number of products in a category in Magento 2. Below is a block class of my custom module (Chapagain_HelloWorld). I have injected object of \Magento\Catalog\Model\CategoryFactory class in the constructor of my module’s block class. Objects of class \Magento\Catalog\Helper\Category and \Magento\Catalog\Model\CategoryRepository as also … Read more

Magento 2: Get all Products of a Category

This article shows how we can get all products of a particular category in Magento 2. Both Dependency Injection and Object Manager way of coding is shown below. Using Dependency Injection (DI) Below is a block class of my custom module (Chapagain_HelloWorld). I have injected object of \Magento\Catalog\Model\CategoryFactory class in the constructor of my module’s … Read more

Magento 2: Get Product Collection

This article shows how we can get product collection in Magento 2. Using Dependency Injection (DI) Below is a block class of my custom module (Chapagain_HelloWorld). I have injected object of \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory class in the constructor of my module’s block class. app/code/Chapagain/HelloWorld/Block/HelloWorld.php <?php namespace Chapagain\HelloWorld\Block; class HelloWorld extends \Magento\Framework\View\Element\Template { protected $_productCollectionFactory; public function __construct( … Read more

Magento 2: Get Related, UpSell & CrossSell Products

This article shows how we can get related products, upsell products, and cross-sell products in Magento 2. Check the product relation tables in MySQL database mysql> SELECT * FROM `catalog_product_link_type`; +————–+————+ | link_type_id | code | +————–+————+ | 1 | relation | | 3 | super | | 4 | up_sell | | 5 | … Read more