Tag: Magento (page 12 of 16)

How to Configure the Contact Us Form in Magento 2

In this article we’ll show you, how to configure the Contact us form in Magento 2. Follow this simple guideline… Step 1: Get Started Login into Magento Admin Panel and from sidebar go to, Store > Settings > Configuration Step 2: Configure the Contact Us Form Now from sidebar go to, General > Contacts Expand…

How to Configure the Chart in Magento 2

In this article we’ll show you, how to configure the Chart in Magento 2. Follow this simple guideline… Step 1: Get Started Login into Magento Admin Panel and from sidebar go to, Store > Settings > Configuration Step 2: Configure the Chart Now from sidebar go to, Advanced > Admin Now expand Dashboard Now unchecked…

How to Change the Admin Startup Page in Magento 2

In this article we’ll show you, how to change the Admin startup page in Magento 2. Follow this simple guideline… Step 1: Get Started Login into Magento Admin Panel and from sidebar go to, Store > Settings > Configuration Step 2: Change the Admin Startup Page Now from sidebar go to, Advanced > Admin Now…

Magento 2 – How To Override Registration Page Template

In this post I am going to explain how to override registration page template (register.phtml) in magento 2. Here, I am using my custom module – Ht_Mymodule First create xml file customer_account_create.xml and add below code snippet. File Path: app/code/Ht/Mymodule/view/frontend/layout/customer_account_create.xml <?xml version=”1.0″?> <page xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:View/Layout/etc/page_configuration.xsd”> <body> <referenceBlock name=”customer_form_register”> <action method=”setTemplate”> <argument name=”template” xsi:type=”string”>Ht_Mymodule::form/register.phtml</argument> </action> </referenceBlock>…

Magento 2 – How to Check file Exists in Directory

In this post I am going to explain how to check file exists in directory using isExists method in magento 2. Use below code snippet to check file is exists or not. private $_fileDriver; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Framework\Filesystem\Driver\File $fileDriver, array $data = [] ) { $this->_fileDriver = $fileDriver; parent::__construct($context, $data); } public function…

Magento 2 – How to Write log

Logging is an important part of any development process. Logs assist you to spot an error and the reason for it. Magento 2 contains built-in logging solution based on Monolog Library. To start working with a logger, you must create an instance of \Psr\Log\LoggerInterface. With this interface, you can call the following functions to write…

Magento 2 – How To Validate Custom Form

In this post I am going to explain how to validate custom form in magento 2. The data validation is the important step before the submission. The data needs to be checked for correct input and the validity of data can be checked via default Magento 2 validation rules. Follow the steps to add validation…

Magento 2 – How to Disable Caching for CMS Page from Backend

In this post I am going to explain how to disable caching for CMS page from backend in magento 2. If you need to update the CMS page often hence if you want to disable the cache for that particular page, then add below code snippet in cms page “Layout Update XML”. <referenceContainer name=”content”> <block…

Magento 2 – How to Add Top Link

Any website’s header is the perfect place to display the important links. Top Links block in Magento 2 is used to add links related to customer account like Login, Logout, My Account, My Wishlist etc. So, in this post I am going to explain how to add top link in magento 2. First, Add or…

Magento 2 – How to Get Product Stock Quantity, Min Quantity and Other Stock Information

In this post I am going to explain how to load product stock quantity, min quantity and other stock information in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_stockItemRepository; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Model\Stock\StockItemRepository $stockItemRepository, array $data = [] ) { $this->_stockItemRepository = $stockItemRepository; parent::__construct($context, $data); }…

Older posts Newer posts