Last active
October 5, 2018 08:21
-
-
Save tangar76/f3a7067057c34033866430a58218d0a1 to your computer and use it in GitHub Desktop.
Firecheckout M2 - customization examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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