Setup step:
- copy SR folder inside app/code
- var folder permission should be 777
- run following command 'php bin/magento setup:upgrade'
- var folder permission should be 777
Add custom field to Shipping Address form in Magento 2 Onepage Checkout
Setup step:
Would you mind adding composer.json to be able to install and update the extension via composer, please?
I have tried this module and it is working on front end, but it is not saving the values in to database. and it is not showing the details in the order in admin
Hi, i added my CheckoutAdditionalField
<?php
namespace SR\CheckoutAdditionalField\Plugin\Checkout\Model\Checkout;
class LayoutProcessor
{
/**
* @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
* @param array $jsLayout
* @return array
*/
public function afterProcess(
\Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
array $jsLayout
) {
$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
['shippingAddress']['children']['shipping-address-fieldset']['children']['delivery_date'] = [
'component' => 'Magento_Ui/js/form/element/abstract',
'config' => [
'customScope' => 'shippingAddress',
'template' => 'ui/form/field',
'elementTmpl' => 'ui/form/element/radio',
'options' => [],
'id' => 'delivery-date'
],
'dataScope' => 'shippingAddress.delivery_date',
'label' => __('who receives?'),
'provider' => 'checkoutProvider',
'visible' => true,
'validation' => [],
'sortOrder' => 1,
'id' => 'delivery-date'
];
return $jsLayout;
}
}
and i created a new input radio type call radio.html
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<style>
.plchoice {
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
}
.pllabel {
margin-right: 5px;
}
.plcheckbox {
margin-right: 15px !important;
}
</style>
<div class="choice field plchoice">
<label class="label pllabel">
<span >me</span>
</label>
<input type="radio" class="checkbox plcheckbox" name="plhr" value="si">
<label class="label pllabel" id="plen" >
<span >someone else</span>
</label>
<input type="radio" id="no" class="checkbox plcheckbox" name="plhr" value="no">
<!-- ko if: notice -->
<div class="field-note" data-bind="attr: {id: noticeId}"><span data-bind="text: notice"></span></div>
<!-- /ko -->
</div>
i try to empty all the input form went user select someone else or leave full if the user select "me"
i try to do it with javascript but went i create my script below <div class="choice field plchoice"></div>
nothing happen..
can you help me to make this thinks work ? thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.