Category: Magento 2 (page 26 of 33)

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;…

Magento 2 – How to Get All Active Payment Methods

In this post I am going to explain how to get all active payment methods in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_paymentConfig; protected $_scopeConfigInterface; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Payment\Model\Config $paymentConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface, array $data = [] ) { $this->_paymentConfig = $paymentConfig; $this->_scopeConfigInterface = $scopeConfigInterface; parent::__construct($context,…

Magento 2 – How to Get All Payment Methods

In this post I am going to explain how to get all payment methods in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_paymentHelper; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Payment\Helper\Data $paymentHelper, array $data = [] ) { $this->_paymentHelper = $paymentHelper; parent::__construct($context, $data); } public function getAllPaymentMethods() { $paymentMethods =…

Magento 2 – How to Get Customer Group Collection

In this post I am going to explain how to get customer group collection. 1. Using Dependency Injection Add below code snippet in Block class. protected $_customerGroupCollection; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Customer\Model\ResourceModel\Group\Collection $customerGroupCollection, array $data = [] ) { $this->_customerGroupCollection = $customerGroupCollection; parent::__construct($context, $data); } public function getCustomerGroupCollection() { $customerGroupsCollection = $this->_customerGroupCollection->toOptionArray(); return $customerGroupsCollection;…

Magento 2 – How to get Product Attribute Id, Name, Options from Attribute Code

In this post I am going to explain how to get the attribute information from attribute code in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_entityAttribute; protected $_attributeOptionCollection; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Eav\Model\Entity\Attribute $entityAttribute, \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection $attributeOptionCollection, array $data = [] ) { $this->_entityAttribute = $entityAttribute; $this->_attributeOptionCollection =…

Boost Your Sales with Product Remaining Stock Magento 2 Extension

Let’s See the Unique Features and how to 📥 Download & Install this Magento Extension. Do you want to increase your sales? Every ecommerce business owner want to increase sales. You can increase sales for your Magento store by displaying low Stock remaining alerts on product page. This increase the SCARCITY about the product. Scarcity…

Top Free Magento 2.3.2 Themes for 2019

Today here we’re introducing some of the best Magento 2.3.2 themes available for FREE. That would be great for start up your online business. Following are the Top Free Magento 2.3.2 Themes. 1. Shopkart Lite – Free Multipurpose Responsive Magento 2 Theme Free Download Now Let’s See How to 📥 Download & Install this Free…

Free Snowfall Effect Magento 2 Extension From HiddenTechies

Christmas is near and it’s time to cheers! Holiday season are always the best for shopping. Surprise your visitor with seasonal decorations. Make your store pleasant place for shop to them. For that… Here we introduce Snowfall Effect extension for your Magento 2 store. Snowfall Effect Snowfall Effect is the extension that makes snow in…

Older posts Newer posts