Collect additional information before payment
Collect info at the checkout
// write a function that adds an extra field
var CheckoutExtraFieldAdd = function () {
window.ec = window.ec || {};
ec.order = ec.order || {};
ec.order.extraFields = ec.order.extraFields || {};
// define extra field name and its settings
ec.order.extraFields.ef_for_payment = { // the “ef_for_payment” part is the Extra Field ID
'title': 'Account ID in bonus payment program', // text displayed above the input field
'textPlaceholder': 'ID00001', // text placeholder displayed inside input box
'type': 'text',
'tip': 'We will add bonuses to your account after the payment', // additional text displayed below the input field
'required': true,
'checkoutDisplaySection': 'cart' // must be `cart` to display extra field at first chectout step
};
window.Ecwid && Ecwid.refreshConfig();
}
// call function on the page load
Ecwid.OnAPILoaded.add(function () {
Ecwid.OnPageLoaded.add(function (page) {
if (page.type == "CART") {
CheckoutExtraFieldAdd(); // must be `cart` to load extra field at first chectout step
}
});
});Receive info in payment request
PreviousShow payment icons near your payment method at the checkoutNextLimit payments by selected shipping method
Last updated
Was this helpful?
