How to change a word for an entire project in magento

First of all we need to create a a file named en_Us.csv in the following path. /var/www/html/nb/app/design/frontend/JJ/Theme/i18n/en_US.csv The file we created is a csv file in the csv file we can add appropriate word we want to replace as shown in the below screenshot. The order should be first we should add the world to… Continue reading How to change a word for an entire project in magento

Published
Categorized as Magento

Products is not showing up on Magento2 subcategory

To show the product, check if the product following options: General->Status = Enabled general->Visibility = Catalog,Search Inventory->Qty > 0 Inventory->Stock Availability = In Stock Websites = checking your site Catgories = checking your category. If you want checking product to subcategory, go to Catalog->Manage Categories->Select your category, open tab Display Settings and change option “Is Anchor” to “Yes”. Save… Continue reading Products is not showing up on Magento2 subcategory

Published
Categorized as Magento

Magento 2 set locale programmatically?

If you want to use translation on external php script. You have to initialize translation using following code after $state->setAreaCode(‘frontend’);.

Published
Categorized as Magento

How to create a custom block in Magento 2

1. Add a new PHP class block. Create the file in the following location: and add the following code to it: \Magento\Framework\View\Element\Template — a class from which you inherit your own block that interacts with the template. 2. Add a template file (template .phtml file) Create this file: 3. Combine the PHP class block and the… Continue reading How to create a custom block in Magento 2

Create an invoice in Magento

You must generate an invoice for an order before you can print it. To view or print the PDF, first download Invoice an order On the Admin sidebar, click Sales. In the Operations section, choose Orders. Find the sales order with the status of Processing in the grid. Then, do the following: In the Action column, click View. In the header of the sales order, choose… Continue reading Create an invoice in Magento

Published
Categorized as Magento

Integrate an extra step in the checkout in Magento2

Sometimes we need to integrate or create a new step or tab in the checkout. We can able to achieve it through a custom Magento module. Create a layout file in the extension folderEx: vendor/Extension/view/frontend/layout/checkout_index_index On the layout file, sort order key is meant by the position of the tab in the checkout. Sort order… Continue reading Integrate an extra step in the checkout in Magento2

Published
Categorized as Magento

How to set timer for an disabled button tp be enabled using js.

Here first of all we need to open a <script> tag and add the folllowing code <script type=”text/x-magento-init”> { “#country”: { “regionUpdater”: { “optionalRegionAllowed”: <?= /* @noEscape */ $displayAll ? ‘true’ : ‘false’ ?>, “regionListId”: “#region_id”, “regionInputId”: “#region”, “postcodeId”: “#zip”, “form”: “#form-validate”, “regionJson”: {$regionJson}, “defaultRegion”: “{$regionId}”, “countriesWithOptionalZip”: {$countriesWithOptionalZip} } } } </script> Then you nee… Continue reading How to set timer for an disabled button tp be enabled using js.

Common layout for dynamic url in magento2

If two custom url must show a common layout template and need to show the data on the template file based on the `id` passed on.ex:domain/shop/index/order/id/1/domain/shop/index/order/id/2/ Here shop is the route ID in the route file in the etc folder.index :- Folder inside the controller.order: The controller file. Create a layout file based on this.… Continue reading Common layout for dynamic url in magento2

Published
Categorized as Magento

Magento Adding custom class name and validations using layout processor

For adding custom classes to the fieldset in the shipping adding and billing address page we may use the layout processor plugin to execute this. For installing layoutprocessor plugin we need to create a php file in the following location: app/code/JJ/Catalog/Plugin/Checkout/Block/LayoutProcessor.php Here is a example to change the label of the street address to Address… Continue reading Magento Adding custom class name and validations using layout processor