We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
Blog
-
How to get Currency data: Code, Rate, Symbol in Magento 2
There are the steps to get the currency data like code, rate, and symbol in Magento 2 create the block class Get the output of the currency data in phtml file Create the block class Directory app/code/VendorName/ModuleName/Block/Demo.php Content of Demo.php <?phpnamespace VendorName\ModuleName\Block;class Demo extends \ -
How to get Logo url, Image Url, Alt text, Logo size in Magento 2 Programmatically
There are the steps to get logo url, image url, Alt text and logo size in magento 2 create the block class Declare function in template (.phtml) file Create the block class Directory app/code/VendorName/ModuleName/Block/Demo.php Content of Demo.php <?phpnamespace VendorName\ModuleName\Block;class Demo extends \Magento\Framework\View\ -
How to Add Command line in to Console CLI in Magento 2
Follow these steps add the command line in to console CLI in magento 2. create the di.xml create command class Create di.xml file In di.xml file you will define the command. Directory app/code/VendorName/ModuleName/etc/di.xml Content of di.xml <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema- -
How to get store information in Magento 2 Programmatically
There are the following steps to get the store information in Magento 2: Create the block class Get store information in phtml file Create the block class Directory app/code/VendorName/ModuleName/Block/Demo.php Content of Demo.php <?phpnamespace VendorName\ModuleName\Block;class Demo extends \Magento\Framework\View\Element\Template{ -
How to Create and Assign Customer Group in Magento 2
To create the customer group follow these steps: Go to Admin Panel, click on the CUSTOMERS > Customer groups. Click on the Add New Customer Group button. In the field of Group Name, set the group name. Select the Tax Class. In the field of Excluded Website, Select websites you want to exclude from this customer group. Click on the Save -
How to Create/Save Admin Grid in Magento 2
Follow the following steps to create the admin grid in Magento 2: Create database schema Create routes admin Create admin menu Create Controller Create Admin Grid using Component Create Admin Grid using Layout Create database schema Create the database file in the setup directory. Directory app/code/VendorName/ModuelName/Setup/ -
How to Create a Catalog Price Rule in Magento 2
There are the following steps to create the cart price rule in Magento 2 Create a New Catalog Price Rule Set the Catalog Price Conditions Set the Catalog Price Actions Apply the Rule Create a new Catalog rule Go to Admin Panel, click on the Marketing > Promotions >Catalog Price Rule. To add a new rule, click on the Add New Rule -
How to Setup Promotions / Cart Price Rules in Magento 2
There are the following steps to create the cart price rule in Magento 2 Create a New Cart Price Rule Set the Cart Price Conditions Set the Cart Price Actions Set the Cart Price Labels Apply the Rule Create a new cart rule Go to Admin Panel, click on the Marketing > Promotions > Cart Price Rule. To add a new rule, click on the -
How to Set Production Mode in Magento 2
<h2 id="show-current-magento-2-mode">Show current Magento 2 Mode</h2> <p>Run the following command to show the current mode:</p> <pre class="highlight"><code>php bin/magento deploy:mode:show</code></pre> <p>Currently, we are in default mode. We can set to <strong>Production -
How to Add Custom Discount in Magento 2
<h3>Enter a total in the sale.xml file</h3> <p><strong>Directory</strong></p> <p>app/code/VendorName/ModuleName/etc/sales.xml</p> <p><strong>Content for this file</strong></p> <pre class="highlight"><code><config xmlns:xsi="http://www.w3