Hi,
i'm working on Custom Module for Cities Dropdown without filtering by region.
my module filter the Cities by country_id but i'm facing issue, i can't load the default country cities on page load.
but on update the country the cities appear without any issue. i only can't load the cities for the default country.
i need someone to explain how to do it, so i could finish the task.
Thanks
[login to view URL]
/**
* @api
*/
define([
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select'
], function (_, registry, Select) {
'use strict';
return [login to view URL]({
defaults: {
skipValidation: false,
customName: '${ $.parentName }.city',
imports: {
update: '${ $.parentName }.country_id:value'
}
},
initialize: function (){
/* var status = this._super().initialValue;
[login to view URL]("On Load");
return this; */
},
/**
* Creates input from template, renders it via renderer.
*
* @returns {Object} Chainable.
*/
initInput: function () {
return this;
},
/**
* @param {String} value
*/
update: function (value) {
var source = [login to view URL],
field = [login to view URL],
result,
initValue;
result = [login to view URL](source, function (item) {
return item[field] === value;
});
if ([login to view URL] > 0 && value != undefined) {
[login to view URL](true);
[login to view URL](false);
[login to view URL](result);
let currentValue = [login to view URL];
initValue = [login to view URL](result, function (item) {
return [login to view URL] === currentValue;
});
if ([login to view URL] > 0) {
[login to view URL](currentValue);
}
} else {
[login to view URL](false);
[login to view URL]('');
[login to view URL](true);
[login to view URL]([]);
[login to view URL]('');
}
},
/**
* Filters 'initialOptions' property by 'field' and 'value' passed,
* calls 'setOptions' passing the result to it
*
* @param {*} value
* @param {String} field
*/
filter: function (value, field) {
var country = [login to view URL]([login to view URL] + '.' + 'country_id'),
value = (value == undefined) ? '' : value;
if (country){
this._super(value, field);
if(value == '' && [login to view URL] == 'checkoutProvider'){
[login to view URL](false);
[login to view URL]('');
[login to view URL](true);
[login to view URL]([]);
[login to view URL]('');
}
}
},
/**
* Callback that fires when 'value' property is updated.
*/
onUpdate: function () {
this._super();
var value = [login to view URL](),
result;
result = [login to view URL][value];
if(result != undefined){
[login to view URL]([login to view URL]);
} else {
[login to view URL]('');
}
},
/**
* Change value for input.
*/
toggleValue: function (value) {
[login to view URL]([login to view URL], function (input) {
[login to view URL](value);
});
}
});
});
Hi,
Greetings!!
I have read your description carefully as per that you need to fix issue in magento.
We have more than 8 years experience in this field and can perform your work.
So I can start work immediately as soon as we spoke more about your project.
I' ll provide you quality work according to your instructions.
Thanks!
Ambient Infotech
Hello There,
I am very much confident to do this job for you. And I can alive your dream.
I have 8 years of experience in development in Wordpress, Magento, Shopify, php, Laravel (E-commerce, multivendor, blogging and simple wp site). Kindly open a chat window so I will share my suggestion which help you to success for this requirement.
Surely my experience will help you to complete this task successfully.
Looking for a kind revert to start it soon.
Best regards,
Nitin k
Magento Expert
Hello sir,
I notice the details about this project. I think our team is the best option for this project. Because in our team there are many qualityful person to make this successful. And we also inform you that we will complete this at reasonable price with best quality.
For any QUERY feel free to ask us.
Stay home and Stay safe, sir.
regards
Istiak