tapukatata Posted February 19, 2019 Share Posted February 19, 2019 (edited) I need help with my code. I have a prestashop shipping module where I have a list with cities and shipping carrier offices. In some cities there are more than one shipping carrier offices and when anyone select the city after that must chose a shipping carrier office. BUT for some cities there is just one shipping carrier office and I want to auto select it after choosing the city. Here is what I have added: if($('#office_name_select option').length == 2){ $('#office_name_select option:last-child').attr('selected','selected'); $('#office_name_select').trigger('chosen:updated'); $('#office_name_select').trigger('change'); } also: } if(data.length == 1){ $('#office_name_select option:last-child').attr('selected','selected'); The code is working for Fron Office but after that the selected city and auto selected (if it is only one) shipping carrier office they are not saved in Back Office. Any ideas how Can I resolve the problem? Here is Diff Checker: https://www.diffchecker.com/hicaG2EE Edited February 19, 2019 by diyan1234 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now