Page 52 of 68

Increase Your Sales with Sticky Add to Cart Magento 2 Extension

Let’s take one simple case : A customer is shopping on the product page and scrolling through a product’s awesome description. The customer is getting excited to buy the product, but as they scroll further, they don’t see a buy button. They soon realize they have to scroll all the way back to the top…

How to Start an Online Auto Parts Store | 7 Steps to Success

Starting an online Auto Parts store? Well… it’s perfect because now it’s the right time to do it! To help, here we are presenting the 7 easy steps to start your online store. In this articles we explore simple way to start your online business. Here’s they are! Table of Content 1. Select Best eCommerce…

How to install Magento 2 extensions using FTP

Extension helps you to make your business much easier and provide smooth shoppable experience to your customer. So here we will learn how to install Magento 2 extension to your store using FTP. Install Magento 2 extension using FTP First of all download your selected Magento 2 extensions and unzip it. Now connect your store…

Magento 2 – How to Call Template Block in phtml File

In this post I am going to explain how to to call template block in phtml file or how to use phtml file in another phtml file. Sometimes you want to get content from another phtml file without defining in layout. In this case, we can use a method called toHtml of a block. Suppose…

Magento 2 – How to get Current Store ID, Code, Name, URL and Website ID

In this post I am going to explain how to get current store information like store id, code, name, url and website id in Magento 2. 1. Using Dependency Injection protected $_storeManager; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, array $data = [] ) { $this->_storeManager = $storeManager; parent::__construct($context, $data); } public function getStore() {…

Magento 2 – How to Check Current URL is Homepage

In this post I am going to explain How to check IsHomePage in Magento 2. Add below code snippet in Block class. protected $_logo; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Theme\Block\Html\Header\Logo $logo, array $data = [] ) { $this->_logo = $logo; parent::__construct($context, $data); } public function isHomePage() { return $this->_logo->isHomePage(); }   Add below code snippet…

Magento 2 – How to Get Module, Controller, Action and Route Name

In this post I am going to explain how to get module, controller, action and route name in Magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_request; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Request\Http $request, array $data = [] ) { $this->_request = $request; parent::__construct($context, $data); } public function getModuleName()…

Magento 2 – How to get Logo Height, Width, Image URL and Alt Text

In this post I am going to explain how to get logo height, width, image url and alt text in Magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_logo; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Theme\Block\Html\Header\Logo $logo, array $data = [] ) { $this->_logo = $logo; parent::__construct($context, $data); } //…

Magento 2 – How to Get List of Current Store Categories

In this post I am going to explain how to get list of store categories in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_storeManager; protected $_categoryCollection; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollection, array $data = [] ) { $this->_storeManager = $storeManager; $this->_categoryCollection = $categoryCollection; parent::__construct($context,…

Magento 2 – How to Get All Categories of Specific Product

In this post I am going to explain how to get all categories of specific product in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_categoryCollectionFactory; protected $_productRepository; public function __construct( \Magento\Catalog\Block\Product\Context $context, \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollectionFactory, \Magento\Catalog\Model\ProductRepository $productRepository, array $data = [] ) { $this->_categoryCollectionFactory = $categoryCollectionFactory; $this->_productRepository = $productRepository;…

« Older posts Newer posts »