15

You have to just override getConfig() function of checkout module. app/code/Packagename/Checkout/etc/frontend/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <!-- pass custom variable to checkout page --> &...


14

To change phone number into optional follow the below configuration setup Go to Admin Login -> Stores -> (Settings) Configuration -> Customers(Tab) -> Customer Configuration -> Name and Address Options. In their change Show Telephone is Required into Optional. Now the checkout page is not asking the Phone number is required.


12

I'll show you how to do this on the example of validating a company name. Create the file : NameSpace/Module/view/frontend/layout/checkout_index_index.xml In it, I will insert rules for validation name = 'company'. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="...


8

You are using the wrong handler <checkout_cart_index> Will add css to cart page not in check out page replace with <checkout_onepage_index> this will add content to checkout page


6

1) For customer account: /V1/carts/mine/coupons/:couponCode I just explain how sale rules work for customer logged a) Set coupon: vendor/magento/module-quote/etc/webapi.xml <route url="/V1/carts/mine/coupons/:couponCode" method="PUT"> <service class="Magento\Quote\Api\CouponManagementInterface" method="set"/> <resources> ...


6

We create our phtml: app/design/frontend/{Vendor}/{theme}/Magento_Checkout/templates/html/my-custom.phtml <?= /* @escapeNotVerified */ __('My html is loaded') ?> <h3>successfully !</h3> We instantiate our custom phtml: app/design/frontend/{Vendor}/{theme}/Magento_Checkout/templates/onepage.phtml /* The Magento onepage code first, ...


6

For this first you have to override core functionality in your custom module Go to Namespace/ModuleName/view/frontend/requirejs-config.js var config = { map: { '*': { 'Magento_Checkout/js/model/shipping-service' : 'NameSpace_ModuleName/js/model/shipping-service' } } }; and Go to Namespace/ModuleName/...


4

app/code/Ktpl/Ordercomment/etc/frontned/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Block\Checkout\LayoutProcessor"> <plugin name="sr_add_custom_field" ...


4

File path should be below vendor/magento/module-tax/view/frontend/web/template/checkout/summary/shipping.‌​html file Add your custom <span class="title">Custom Text</span> text like below example <!-- ko if: isExcludingDisplayed() --> <tr class="totals shipping excl"> <th class="mark" scope="row"> &...


4

Create below path in your custom theme: app/design/frontend/{{your package}}/{{your theme}}/Magento_Checkout/ Copy the required template, layout or web files to be modified from vendor/magento/module-checkout/view/frontend Update the files and flush cache to get the changes reflected. If you are modifying web files then don't forget to redeploy the ...


4

You can make the region field optional from admin, follow below steps. Step 1 Login to the back end of Magento 2. On the Admin sidebar, navigate to Stores > Settings > Configuration. Under the panel of General, select General. Scroll down to explore the State Option section. Step 2 In the State Option list: Choose the country where the State/ Region is ...


3

You can remove Company from the Magento dashboard. Go to Stores > Configuration > Customers > Customer Configuration > Name and Address Options But if you want to remove them from the layout file just put: <item name="company" xsi:type="array"> <item name="visible" xsi:type="boolean">false</item> </item> <item name="...


3

Override /vendor/magento/module-checkout/view/frontend/web/template/shipping.html in your custom theme app/design/frontend/Test/test/Magento_Checkout/web/template/shipping.html OR If you have custom module Override shipping.html at app/code/Vendor/Module/view/frontend/web/template/shipping.html Now add custom link before <div class="actions-...


3

Override /vendor/magento/module-checkout/view/frontend/web/template/shipping.html and add a link before the button. <div class="actions-toolbar" id="shipping-method-buttons-container"> <!-- add link here --> <div class="primary"> <button data-role="opc-continue" type="submit" class="button action continue ...


3

You can add text before shipping method from this file: vendor/magento/module-checkout/view/frontend/web/template/shipping.html Override this core file to your custom theme at app/design/frontend/Vendor/theme/Magento_Checkout/web/template/shipping.html Add your text before <li id="opc-shipping_method"> or where you want to show. After ...


3

magento\vendor\magento\module-customer\view\frontend\templates\widget\name.phtml Paste above file in-to your theme. And You will find a class named field-name-lastname remove this complete div for last name. (form theme folder, which you just copied form vendor) Now run below query in your database to set lastname as optional for customer, because we just ...


3

Run below query into phpMyAdmin UPDATE eav_attribute SET is_required = 0 WHERE attribute_code = 'lastname' and `entity_type_id` = 1 Please overwrite theme below theme file. magento\vendor\magento\module-customer\view\frontend\templates\widget\name.phtml Please remove field-name-lastname from above overwrite theme file. Clear the cache: php bin/magento ...


3

Compare your code with given below code. IF in theme already have a checkout_index_index.xml file then add below code. <referenceBlock name="breadcrumbs"> <action method="addCrumb"> <argument name="crumbName" xsi:type="string">Home</argument> <argument name="crumbInfo" xsi:type="array"> <item name="title" xsi:type="string"&...


3

You can try this way. protected $_checkoutSession; public function __construct ( \Magento\Checkout\Model\Session $_checkoutSession ) { $this->_checkoutSession = $_checkoutSession; } public function execute(\Magento\Framework\Event\Observer $observer) { $postCode = $this->_checkoutSession->getQuote()-getShippingAddress()->...


3

You can call coupon code at checkout by following code: <div class="custom-coupan"> <?php echo $this->getLayout()->createBlock('checkout/cart_coupon') ->setTemplate('checkout/cart/coupon.phtml')->toHtml(); ?> </div> You need to add code at: mag1Root/app/design/frontend/{package}/{theme}/template/checkout/onepage/...


3

For Login with the customer, First you need to make mobile number required field in customer Registration form. Whenever customer register, At that time you need to add a field like mobile no. and save that field to Customer registration page. Now when customer login at that time they enter email id or mobile number. For this you need to override this ...


3

Add your block in default.xml and in checkout_index_index.xml write below code: <referenceBlock name="form.subscribe.home" remove="true" /> Hope it solve your issue.


2

You need to override vendor/magento/module-checkout/view/frontend/web/template/summary/cart-items.html and change (line number 8) <div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active'}}"> to <div class="block items-in-cart active" data-bind="mageInit: {'collapsible':{'openedState': 'active', 'active': true}...


2

You Need to override the shipping.js. Here the the path:- Copy this file- Magento\Checkout\view\frontend\web\js\view\shipping.js In theme folder as below- app\design\frontend\Vendor\theme\Magento_Checkout\web\js\view Now the file you copied (shipping.js) some where line no 123-124 (inside initialize function) put your condition to display this step. ...


2

Create a module Override the configurable model in VENDOR/MODULENAME/Model/Product/Type/Configurable.php namespace VENDOR\MODULENAME\Model\Product\Type; use Magento\ConfigurableProduct\Model\Product\Type\Configurable as ConfigurableProduct; class Configurable extends \Magento\ConfigurableProduct\Model\Product\Type\Configurable { public function ...


2

This is most probably the issue related to checkout Javascript code. Open skin/frontend/<package>/<theme>/js/opcheckout.js Find the line: if (elements[i].name=='payment[method]') { Change it to: if (elements[i].name=='payment[method]' || elements[i].name == 'form_key') { Save the file. Clear Cache from Magento Admin (System -> Cache ...


2

So I have not found the problem but I have found a solution in checkout_index_index.xml in your theme, you can't copy all the content from the default theme but if you want to add stuff to the content section you can use <referenceBlock name="checkout.root"> When using <referenceContainer name="content"> The shipping table stops working ...


2

If the cart contains only virtual or downloadable items, you will not have to select any shipping method at checkout but it will also skip the shipping address during checkout and the associated shipping cost. Removing the shipping address step for normal simple products (without affecting the shipping method or cost) would be much, much more complicated ...


2

First of all, I would not recommend to use ObjectManager as it is considered bad practice. Regarding your question, and instead of using the success.phtml to get the billing address, you could use and observer or a plugin to get the info you need. Observer Approach Create an observer to observe event checkout_submit_all_after. By observing this event ...


2

Here is the way you can insert new states to your Magento 2 via the setup file just follow the below steps Create a new module at Magento_root/app/code/{Vendor}/{Module} create below files into it as per the locations Magento_root/app/code/{Vendor}/{Module}/etc/module.xml Magento_root/app/code/{Vendor}/{Module}/registration.php Magento_root/app/code/{...


Only top voted, non community-wiki answers of a minimum length are eligible