Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
v:2.0:snippets:dynamically_require_phone [2018/07/28 07:44] – [Add Javascript] adam | v:2.0:snippets:dynamically_require_phone [2018/07/30 06:02] (current) – adam | ||
---|---|---|---|
Line 7: | Line 7: | ||
Copy and paste the following code into your store' | Copy and paste the following code into your store' | ||
- | <code javascript> | + | <code javascript> |
+ | <script type=" | ||
function requirePhone(params) { | function requirePhone(params) { | ||
var country = params.address.country; | var country = params.address.country; | ||
Line 14: | Line 15: | ||
FC.json.required_fields.push(' | FC.json.required_fields.push(' | ||
FC.json.config.template_config.custom_checkout_field_requirements[' | FC.json.config.template_config.custom_checkout_field_requirements[' | ||
+ | FC.Template(" | ||
FC.checkout.renderCustomerShipping(); | FC.checkout.renderCustomerShipping(); | ||
} else if (country == " | } else if (country == " | ||
Line 20: | Line 22: | ||
FC.util.removeError(params.address.prefix + " | FC.util.removeError(params.address.prefix + " | ||
FC.util.notifyErrors(); | FC.util.notifyErrors(); | ||
+ | FC.Template(" | ||
FC.checkout.renderCustomerShipping(); | FC.checkout.renderCustomerShipping(); | ||
} | } | ||
} | } | ||
+ | |||
FC.client.on(" | FC.client.on(" | ||
FC.client.on(" | FC.client.on(" | ||
Line 37: | Line 40: | ||
} | } | ||
}); | }); | ||
- | </ | + | </ |
+ | {% endif %}</ |