Payment list template Override using mixins.js in Magento 2.

What is Mixins?

  • Mixin is alternative to inheritance, without override entire base file, You can add new methods or change/modify the current method output in mixins file.
  • Mixins is a class that contains methods for use by other classes without having to be the parent class of those other classes.
  • Class Methods are added to or mixed in with parent class methods.

Continue reading “Payment list template Override using mixins.js in Magento 2.”

Get subtotal, shipping total and Grand total in checkout page using js Magento 2.

You can get total related information in the checkout page with a subtotal, shipping charge, grand total using Javascript.

For getting update grand total with the shipping charge and tax total and other info you need to call ‘Magento_Checkout/js/model/totals’ in the JS file.

You need to call totals Objects with a required field,

You can call above function in template with getGrandTotal(), getShippingAmount() and getSubTotal().

How to create popup modal in magento 2?

How to create Popup Modal using Javascript in Magento 2?

Create a .phtml template file with the given content to make POPUP using Magento 2,

In the above template file, we can show popup based on click on chart link. When click on the chart link defined in our DOM element popup modal will be displayed.

Call Magento_Ui/js/modal/modal object in your require dependency.

There are many default options are available for modal.js file.
Different types of optios you can pass as per your requirement in above options object.

List of default options for a modal popup, if you want to override default value set options value in your custom template in the options object.