How to call any block function in phtml Magento 2?
Magento2

How to call any block function in phtml file Magento 2?

If you are inside a phtml file, and you need to call an specific function inside another block. You can do the following : Step 1 : Create Block file File Path : app/code/V4U/Helloworld/Block/View.php Step 2 : Create template file File Path : app/code/V4U/Helloworld/view/frontend/templates/view.phtml In another phtml you can call by following way. Step 3: Run the following Magento command…

Continue Reading

Commands, Errors, Magento2

How to solve cluster_block_exception [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block] in Magento 2?

When you running php bin/magento indexer:reindex and found the below error Need to run below commands on magento instance root path. Note : Here I have added default 9200. You can also check in Admin Panel configured Elasticsearch Server Port. Admin Panel -> Catalog -> Catalog -> Catalog Search -> Elasticsearch Server Port. After running above two commands run the…

Continue Reading

How to call template from a Controller in Magento 2_
Magento2

How to call template from a Controller in Magento 2?

Controllers in Magento 2, like on other PHP MVC frameworks, are important part of MVC flow. In Magento 2 controllers have only one method (execute) that will be called by front controller. It functionality is that received request, process and render page. In Magento 2 Controller has one or more files in Controller folder of module, it includes actions of…

Continue Reading

How to Create Controller in Magento 2
Magento2

How to Create Controller in Magento 2?

Controllers in Magento 2, like on other PHP MVC frameworks, are important part of MVC flow. In Magento 2 controllers have only one method (execute) that will be called by front controller. It functionality is that received request, process and render page. In Magento 2 Controller has one or more files in Controller folder of module, it includes actions of…

Continue Reading

How to Print Log in Magento 2_
Magento2

How to Print Log in Magento 2?

Logs in Magento 2 consist the system information for the future analysis. To enable the debug mode go to Stores -> Configuration -> Advanced -> Developer -> Debug -> Set ‘Yes’ to Log to file. Also make sure Magento store is in developer mode. If Magento store is in Production Mode then need run the below command. php bin/magento config:set…

Continue Reading

How to setup Cron Jobs Via SSH In Magento 2?
Commands, Magento2, Magento2 Commands

How to setup Cron Jobs Via SSH In Magento 2?

Magento cron job is an important component for correct performance. Magento uses cron jobs for numerous features to schedule activities. It is widely used for running actions that are performed on schedule, such as indexing and caching, sitemap generation, currency rate updates, and many more as well. Why need Cron Job for Magento 2 ? Cron job use following activities.…

Continue Reading

Commands, Errors, Magento2, Magento2 Commands

Magento 2.4.0 – Getting Error Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

Magento Open Source 2.4.0 support for PHP 7.4, Elasticsearch 7.6.x, and MySQL 8.0. So It’s essential to install Elasticsearch. You must install Elasticsearch before installing Magento Commerce or Magento Open Source 2.4.0. See Elasticsearch for details. Run the below command to Install Elasticsearch In locally. Download and install the public signing key : wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key…

Continue Reading

How to setup existing Magento 2 Project ?
Magento2

How to setup existing Magento 2 Project?

In this tutorial you’ll learn how to setup existing magento 2 project in new domain or locally. Follow below steps to setup existing magento 2 project. Import Database : Import the database by using this command. mysql -u [username] -p newdatabase < [database name].sql; Clone/Extract the Source code. Clone or extract the source code of magento 2. Run Composer Install…

Continue Reading

Magento 2 Modes_ Default, Developer, Production and Maintenance
Commands, Magento2, Magento2 Commands

Magento 2 Modes: Default, Developer, Production and Maintenance

In this tutorial you’ll learn different Magento 2 Modes. Earlier, Magento 1 was operated with a single mode for development as well as production. However, the Magento 2 came with below modes. Magento 2 Modes : Default, Developer Production and Maintenance. Let’s review through each of them in detail. (01) Default : As the name suggests, the default mode is…

Continue Reading