Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Restore i18n forms function

weronkaf58179a7892a
diff --git a/saleor/static/js/storefront.js b/saleor/static/js/storefront.js
index d3117cb34e..2173e291a0 100644
--- a/saleor/static/js/storefront.js
+++ b/saleor/static/js/storefront.js
@@ -72,6 +72,21 @@ if ($initialValue) {
$addressForm.slideUp(0)
}
+// Smart address form
+
+$(function() {
+ const $i18nAddresses = $('.i18n-address')
+ $i18nAddresses.each(function () {
+ const $form = $(this).closest('form')
+ const $countryField = $form.find('select[name=country]')
+ const $previewField = $form.find('input.preview')
+ $countryField.on('change', () => {
+ $previewField.val('on')
+ $form.submit()
+ })
+ })
+})
+
//Cart dropdown
var summaryLink = "/cart/summary"
@@ -203,3 +218,4 @@ $cartLine.each(function() {
})
})
})
+