Skip to content

Magento 2 – Event – Observer – Shipping amount is correct on checkout page refresh

I am trying to calculate tax on the total of subtotal+shipping-discount. I have created an event/observer for this. <event name=”sales_quote_save_after”> <observer instance=”SKPOrderGstObserverCheckoutSalesQuoteSaveAfter” name=”skp_ordergst_observer_sales_quote_save_after”/> </event> After entering the shipping address on the checkout page first time the getShippingAmount returns 0, but… Read More »Magento 2 – Event – Observer – Shipping amount is correct on checkout page refresh

How to add image in email template?

I am trying to add image in my custom email template. I want to know how to define image section in email template and how to set image PARAMS of email sending action using TransportBuilder. Images exist of media path.

How to hide and show the payment method based on shipping address country to sort the payment method

This code has worked to hide and show the payment method based on the shipping address country. public function execute(MagentoFrameworkEventObserver $observer) { //shipping company field $shippingCompanyField = $this->cart->getQuote()->getShippingAddress()->getCountryId(); $paymentMethod = $observer->getEvent()->getMethodInstance()->getCode(); if ($shippingCompanyField == ‘IN’) { if ($paymentMethod == “multisafepay_giropay”)… Read More »How to hide and show the payment method based on shipping address country to sort the payment method