how to save custom form fields data in admin in magento 2?How to add additional field to checkout payment...
How would one buy a used TIE Fighter or X-Wing?
Recrystallisation of dibenzylideneacetone
Getting a UK passport renewed when you have dual nationality and a different name in your second country?
Is there a better way to make this?
The vanishing of sum of coefficients: symmetric polynomials
Quenching swords in dragon blood; why?
How did the original light saber work?
What do you call a fact that doesn't match the settings?
Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?
Rear brake cable temporary fix possible?
How to generate a matrix with certain conditions
How to acknowledge an embarrassing job interview, now that I work directly with the interviewer?
Why zero tolerance on nudity in space?
If I delete my router's history can my ISP still provide it to my parents?
Eww, those bytes are gross
Tikzing a circled star
How should I handle players who ignore the session zero agreement?
How can I improve my fireworks photography?
Avoiding morning and evening handshakes
Why do neural networks need so many training examples to perform?
What is this metal M-shaped device for?
Closed form for these polynomials?
Does my logo design convey the right feelings for a University Student's Council?
What to do if authors don't respond to my serious concerns about their paper?
how to save custom form fields data in admin in magento 2?
How to add additional field to checkout payment (Magento 2)Add form fields to Checkout -> Payment&Review stepHow to add custom checkout fields and save them in db?Magento 2 : How to add additional fields to newsletterHow to save the custom field data in payment section magento 2 to payment related table?Custom Checkout Step Fields not in Post DataHow to add a custom form in a custom payment methodCan't save checkout custom fields in databaseCheckout Page Custom Field data is not saved in Magento 2Magento2 checkout page add custom text fieldMagento 2 : How to get Additional Information in payment info for custom payment method?
I have created three custom form fields in checkout payment section.
I have followed this link to create form fields (How to add additional field to checkout payment (Magento 2)).
Now want to know how to save these fields data in the database.
Thanks
magento2 checkout
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have created three custom form fields in checkout payment section.
I have followed this link to create form fields (How to add additional field to checkout payment (Magento 2)).
Now want to know how to save these fields data in the database.
Thanks
magento2 checkout
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have created three custom form fields in checkout payment section.
I have followed this link to create form fields (How to add additional field to checkout payment (Magento 2)).
Now want to know how to save these fields data in the database.
Thanks
magento2 checkout
I have created three custom form fields in checkout payment section.
I have followed this link to create form fields (How to add additional field to checkout payment (Magento 2)).
Now want to know how to save these fields data in the database.
Thanks
magento2 checkout
magento2 checkout
edited Jun 1 '17 at 7:21
diazwatson
1,52011424
1,52011424
asked Sep 23 '16 at 9:58
user3493165user3493165
111
111
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can add getData method in your js file:
getData: function() {
return {
'method': "methodcode",
'additional_data': {
'customfield1': $('#'+this.getCode()+'_customfield1').val(),
'customfield2': $('#'+this.getCode()+'_customfield2').val(),
}
};
},
then you can get these fields in additional data param in your payment model:
namespace NamespaceModuleNameModel;
class Payment extends MagentoPaymentModelMethodCc
{
public function assignData()
{
$post = $data->getData()['additional_data'];
// write your custom code
}
}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f137812%2fhow-to-save-custom-form-fields-data-in-admin-in-magento-2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can add getData method in your js file:
getData: function() {
return {
'method': "methodcode",
'additional_data': {
'customfield1': $('#'+this.getCode()+'_customfield1').val(),
'customfield2': $('#'+this.getCode()+'_customfield2').val(),
}
};
},
then you can get these fields in additional data param in your payment model:
namespace NamespaceModuleNameModel;
class Payment extends MagentoPaymentModelMethodCc
{
public function assignData()
{
$post = $data->getData()['additional_data'];
// write your custom code
}
}
add a comment |
You can add getData method in your js file:
getData: function() {
return {
'method': "methodcode",
'additional_data': {
'customfield1': $('#'+this.getCode()+'_customfield1').val(),
'customfield2': $('#'+this.getCode()+'_customfield2').val(),
}
};
},
then you can get these fields in additional data param in your payment model:
namespace NamespaceModuleNameModel;
class Payment extends MagentoPaymentModelMethodCc
{
public function assignData()
{
$post = $data->getData()['additional_data'];
// write your custom code
}
}
add a comment |
You can add getData method in your js file:
getData: function() {
return {
'method': "methodcode",
'additional_data': {
'customfield1': $('#'+this.getCode()+'_customfield1').val(),
'customfield2': $('#'+this.getCode()+'_customfield2').val(),
}
};
},
then you can get these fields in additional data param in your payment model:
namespace NamespaceModuleNameModel;
class Payment extends MagentoPaymentModelMethodCc
{
public function assignData()
{
$post = $data->getData()['additional_data'];
// write your custom code
}
}
You can add getData method in your js file:
getData: function() {
return {
'method': "methodcode",
'additional_data': {
'customfield1': $('#'+this.getCode()+'_customfield1').val(),
'customfield2': $('#'+this.getCode()+'_customfield2').val(),
}
};
},
then you can get these fields in additional data param in your payment model:
namespace NamespaceModuleNameModel;
class Payment extends MagentoPaymentModelMethodCc
{
public function assignData()
{
$post = $data->getData()['additional_data'];
// write your custom code
}
}
answered Sep 26 '16 at 5:02
Yogesh KarodiyaYogesh Karodiya
1,92321235
1,92321235
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f137812%2fhow-to-save-custom-form-fields-data-in-admin-in-magento-2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown