Skip to content

Instantly share code, notes, and snippets.

@tangar76
Last active October 5, 2018 08:21
Show Gist options
  • Save tangar76/f3a7067057c34033866430a58218d0a1 to your computer and use it in GitHub Desktop.
Save tangar76/f3a7067057c34033866430a58218d0a1 to your computer and use it in GitHub Desktop.
Firecheckout M2 - customization examples
// create CMS block with content below and output it on FireCheckout:
/*
<div id="california_warning" style="padding: 5px; display: block;">
<div style="float: left; padding: 0 5px 0 0;"><img alt="Warning" src="{{media url="wysiwyg/prop-65-triangle.jpg"}}" width="64" /></div>
<div><strong>WARNING:</strong> This product can expose you to lead, a chemical which is to the State of California to cause cancer and/or birth defects or other reproductive harm. For more information, visit www.P65Warnings.ca.gov.</div>
</div>
*/
define([
'jquery',
'Swissup_Firecheckout/js/utils/form-field/watcher'
], function ($, watcher) {
'use strict';
watcher({
scope: '.checkout-shipping-address',
watch: {
'[name="region_id"]': '12', // State is California
'[name="country_id"]': ['US'] // Country is US
},
match: function () {
$('#california_warning').show('fast');
},
unmatch: function () {
$('#california_warning').hide('fast');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment