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 a plugin to before Place Order action Magento 2?

You can create a plugin for Before Place order action In Magento 2 using beforePlace() method.

When you required to check or set data before place order in Magento 2, You can use a plugin for OrderManagementInterface interface place() method.

place() method from the Magento\Sales\Api\OrderManagementInterface interface class used to Place order operation in Magento 2 from checkout page.

Continue reading “How to create a plugin to before Place Order action Magento 2?”

Get shipping methods from current active quote Magento 2.

You can fetch a list of all the active shipping methods carrier code, the title, amount from the current quote id using Magento 2.

When you are working with checkout customization or you required to get all the active shipping methods for the current quote, You can get all the active shipping methods from the quote.

You can use Magento\Quote\Api\ShippingMethodManagementInterface interface for getting shipping methods. Continue reading “Get shipping methods from current active quote Magento 2.”