Skip to content

checkout

Auto Added by WPeMatico

magento2 how to get custom block value on shipping knockout template

How to get the value of a custom block in Knockout Shipping’s template. My code is: Vendor/Extension/view/frontend/layout/checkout_index_index.xml <?xml version=”1.0″?> <page xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:View/Layout/etc/page_configuration.xsd”> <body> <referenceBlock name=”checkout.root”> <block class=”VendorExtensionBlockGooglePayButton” name=”adyen.googlepay.mini-cart”> <action method=”setTemplate” ifconfig=”amasty_checkout/general/enabled”> <argument name=”setTemplate” xsi:type=”string”>Vendor_Extension::googlepay/shortcutcustom.phtml</argument> </action> </block> </referenceBlock> <referenceBlock name=”page.main.title” remove=”true”/>… Read More »magento2 how to get custom block value on shipping knockout template

‘Magento_Customer/js/customer-data’ javascript does not get cart items of customer

I have this code as below in a custom module define([ ‘rjsResolver’, ‘Magento_Customer/js/customer-data’, ‘jquery’ ], function (resolver, customerData, $) { ‘use strict’; return function (checkoutLoader) { var mixin = { gtmEventTrigger: function() { console.log(“Init Checkout Loader”); console.log(customerData); // console.log(customerData.get(‘cart’)); //… Read More »‘Magento_Customer/js/customer-data’ javascript does not get cart items of customer