How to use different layouts for different category levels.

Sometimes we need to use different layouts or structures based on category levels. For this, we can able to use different layouts based on different category levels. Solution: To create different layout structures for different categories develop layout files under the Magento_Catalog. One option would be adding a layout handle based on the category depth… Continue reading How to use different layouts for different category levels.

Published
Categorized as Magento

Adding custom classes to Magento shipping page address fields

Create plugin after Attribute merge Plugin to add custom classes to shipping address page In your module create MODULE/NAME/etc/di.xml Then in \MODULE\NAME\Model\Plugin create a php file AttributeMergerPlugin.php Example: <?php namespace JJ\Catalog\Plugin\Checkout\Block; class AttributeMergerPlugina { public function afterMerge(\Magento\Checkout\Block\Checkout\AttributeMerger $subject, $result) { if (array_key_exists(‘checkout-step-shipping’, $result)) { $result[‘checkout-step-shipping’][‘additionalClasses’] = ‘checkout-shipping-address’; } if (array_key_exists(‘telephone’, $result)) { $result[‘telephone’][‘additionalClasses’] = ‘mobile-number-validation’; ]; return… Continue reading Adding custom classes to Magento shipping page address fields

Magento Adding custom validations-(Phone Number)

Magento doesn’t have any validation for a ten digit mobile number validation.For getting this there are some many ways.This method is taking about overriding the inbuilt validation rules. For this we have to Create a custom module for the theme , for reference: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-create.html after that inside the create path Magento Ui >Magento_Ui/web/js/lib/validation/rules.js Here we… Continue reading Magento Adding custom validations-(Phone Number)

How to set multiple currencies in one storefront?

To setup multiple currency on Magento 2 follow this step: Setup currency: Move to menu Stores >> Configuration. Under GENERAL tab you will find sub menu Currency Setup. Setup Currency Options with what you need and click Save Config. 2.Setup currency rates: Move menu to Stores >> Currency Rates. Set value for all parameters and hit Saves Currency Rates

Published
Categorized as Magento

How to get step name on checkout page in magento 2?

You can use the Magento_Checkout/js/view/progress-bar component or Magento_Checkout/js/model/step-navigator componen (used by progress-bar) inside your custom block template/component. Using progress-bar: Using step-navigator: or:

Published
Categorized as Magento

How to add a new step in Checkout page

Step 1: Create the .js file implementing the view model.Create the checkout-login-step.js file under Mageplaza/HelloWorld/view/frontend/web/js/view directory.Basically, we need step_code, step_title, order and the condition that allows to display this step. Here is the code (Read code comment to get more info) define([‘ko’,‘uiComponent’,‘underscore’,‘Magento_Checkout/js/model/step-navigator’,‘Magento_Customer/js/model/customer’],function (ko,Component,_,stepNavigator,customer) {‘use strict’;/*** check-login – is the name of the component’s .html template*/return… Continue reading How to add a new step in Checkout page