Page 13 of 69

Magento 2 – How to Get Invoice Details by Order Id?

In this post I am going to explain how to get invoice details by order id in Magento 2. Using below code snippet you can get invoice details by passing order id. 1. Using Dependency Injection Add below code snippet in Block class. protected $_searchCriteriaBuilder; protected $_invoiceRepositoryInterface; protected $_logger; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Api\SearchCriteriaBuilder…

Magento 2 – How to Get Shipment details by Order Id

In this post I am going to explain how to get shipment details by order id in Magento 2. Using below code snippet you can get shipment details by passing order id. 1. Using Dependency Injection Add below code snippet in Block class. protected $_searchCriteriaBuilder; protected $_shipmentRepositoryInterface; protected $_logger; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Api\SearchCriteriaBuilder…

How to get CMS Page Collection in Magento 2

In this post I am going to explain how to get cms page collection in Magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_pageRepository; protected $_searchCriteriaBuilder; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Cms\Api\PageRepositoryInterface $pageRepository, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, array $data = [] ) { $this->_pageRepository = $pageRepository; $this->_searchCriteriaBuilder = $searchCriteriaBuilder; parent::__construct($context, $data);…

Magento 2 – How to Add Validation in System Configuration

In this post I am going to explain how to add validation in system configuration in Magento 2. In order to do validatetion in system configuration field, you just need to add “validate” tag for field in system.xml file and pass validation class in it. See the below example of required field validation and email…

Writing GDPR for Ecommerce: What Store Owners Can Do

Data privacy has become a major point of content in the eyes of eCommerce customers. In the wake of global data privacy incidents such as Cambridge Analytica, people have become warrior of who they trust their data with. The GDPR data regulation act put into effect by the EU has managed to ease the worry,…

How to Get All Regions of Country by Country Code in Magento 2

In this post I am going to explain how to get all regions of country by country code Magento 2. Add below code snippet in Block class. protected $_country; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Directory\Model\Country $country, array $data = [] ) { $this->_country = $country; parent::__construct($context, $data); } // Get All Regions of Country public…

How to get CMS Block Collection in Magento 2

In this post I am going to explain how to get cms block collection in Magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_blockRepository; protected $_searchCriteriaBuilder; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Cms\Api\BlockRepositoryInterface $blockRepository, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, array $data = [] ) { $this->_blockRepository = $blockRepository; $this->_searchCriteriaBuilder = $searchCriteriaBuilder; parent::__construct($context, $data);…

HiddenTechies 4th Anniversary – Our Biggest Anniversary Sale Live Now!

Finally, HiddenTechies is turning 4 on this 17th December 2020! And we are so excited about it, these four year have been an incredible for us. It has been a great pleasure serving you all through these years. We would just like to say thank you for being a part of HiddenTechies family. Let’s get…

How to Make Your Website Ready for this Holidays Season?

As December month reaches, people start planning for their holiday season. This means it could be more profitable for your website as it offers an excellent opportunity to end the year with a strong online presence. Have you Make Your Website Ready for Holidays Season? A research firm Deloitte expects that online holiday sales in…

How to Remove Block From Layout on Specific Condition in Magento 2

In this post I am going to explain how to remove block from layout on specific condition Magento 2. If you have a specific condition to add/remove block then you can achieve it by observer. Here I have given the example to remove search block. First you need to create event.xml file on below path….

« Older posts Newer posts »