I have create a file upload field on check out page with shipping address.But file is not going to upload.
I want to upload a file in specific folder and save the file path in data base.Please see the below code and where am i doing wrong?.
$customAttributeCode = 'custom_field';
$customField = [
'component' => 'Magento_Ui/js/form/element/abstract',
'config' => [
// customScope is used to group elements within a single form (e.g. they can be validated separately)
'customScope' => 'shippingAddress.custom_attributes',
'customEntry' => null,
'template' => 'ui/form/field',
'elementTmpl' => 'ui/form/element/media',
'tooltip' => [
'description' => 'this is what the field is for',
],
],
'dataScope' => 'shippingAddress.custom_attributes' . '.' . $customAttributeCode,
'label' => "Client's ID",
'provider' => 'checkoutProvider',
'sortOrder' => 255,
/* 'validation' => [
'required-entry' => true
], */
'options' => [],
'filterBy' => null,
'customEntry' => null,
'visible' => true,
'formId'=>'client',
];
$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children'][$customAttributeCode] = $customField;
return $jsLayout;
Can any one help me on this problem ? Any references or suggestions are highly appreciated.