Skip to content

Commit

Permalink
Merge pull request Sylius#9772 from pamil/1.1-doubled-province-id
Browse files Browse the repository at this point in the history
Fix doubled province id on checkout addressing page
  • Loading branch information
Zales0123 committed Oct 3, 2018
2 parents 84365ff + 9a78cf0 commit d08c939
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
var provinceSelectFieldName = select.attr('name').replace('country', 'province');
var provinceInputFieldName = select.attr('name').replace('countryCode', 'provinceName');

var provinceSelectFieldId = select.attr('id').replace('country', 'province');
var provinceInputFieldId = select.attr('id').replace('countryCode', 'provinceName');

if ('' === select.val() || undefined == select.val()) {
provinceContainer.fadeOut('slow', function () {
provinceContainer.html('');
Expand Down Expand Up @@ -49,6 +52,10 @@
'name="sylius_address_province"',
'name="' + provinceSelectFieldName + '"' + provinceSelectValue
)
.replace(
'id="sylius_address_province"',
'id="' + provinceSelectFieldId + '"'
)
.replace(
'option value="" selected="selected"',
'option value=""'
Expand All @@ -70,6 +77,10 @@
provinceContainer.html(response.content.replace(
'name="sylius_address_province"',
'name="' + provinceInputFieldName + '"' + provinceInputValue
)
.replace(
'id="sylius_address_province"',
'id="' + provinceInputFieldId + '"'
));

provinceContainer.removeAttr('data-loading');
Expand Down

0 comments on commit d08c939

Please sign in to comment.