-
Magento2 Checkout shipping address autofill
Magento2 Checkout shipping address autofill. If you want to Magento2 Checkout shipping address autofill during checkout then you have to use Magento 2 plugin. I have used plugin over on Class below classes for autofill checkout Shipping address: Magento\Checkout\Block\Checkout\AttributeMerger is main classis the main class where i able to auto fill firstname,lastname,street,city,postcode,country_id,region,region_id,telephone,companyabove fields value using after Create after Plugin (Devbera\AutofillCheckoutAddress\Plugin\Magento\Checkout::afterMerge ) on Magento\Checkout\Block\Checkout\AttributeMerger::merge for shipping address fields autofill up. Step1:Define Plugin classes: First Create di.xml at app/code/{VendorName}/{ModuleName}/etc/frontent where we are define the plugin classes. Code Step2: Declare plugin class Create First plugin class AttributeMergerPlugin.php at app/code/{VendorName}/{ModuleName}/Plugin/Magento/Checkout/ Code Second plugin class which will auto fill email id for NON _login customer Create seocnf…
-
Magento2 get cart and checkout link in block or phtml
Magento2 get cart and checkout link in block or phtml In Magento2 get cart and checkout link in block or phtml then you need to call getUrl() method.It is every easy to get those url at Phtml or block class. Also, there is no need to write layout xml code for getting cart and checkout page url at magento 2. If want to get cart & checkout link at PHTML file then try below code: Checkout Url <?php echo $block->getUrl('checkout', ['_secure' => true]);?> Cart Url <?php echo $block->getUrl('checkout/cart', ['_secure' => true]);?> If you want to call at block class try with Checkout link: $this->getUrl('checkout', ['_secure' => true]); and…