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 in magento 2?

In Magento 2 We can simply call modal popup using default modal.js library.
Create phtml(template) file,

In above Template file we can show popup based on click on chart link. When click on 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 modal popup, if you want to override default value set options value in your custom template in options object.