Skip to content

Instantly share code, notes, and snippets.

@blaswan
Last active January 2, 2017 08:31
Show Gist options
  • Save blaswan/20090c83c2936ce6f3d31f1992167715 to your computer and use it in GitHub Desktop.
Save blaswan/20090c83c2936ce6f3d31f1992167715 to your computer and use it in GitHub Desktop.
<!-- Channel Plugin Scripts -->
<div module="Layout_stateLogon" style="display: none;" id="ch-plugin-user">
<div id="ch-plugin-user-id">{$id}</div>
<div id="ch-plugin-user-name">{$name}</div>
<div id="ch-plugin-user-mobile">{$phone}</div>
</div>
<div module="Layout_shoppingInfo" style="display: none;">
<div id="ch-plugin-user-mileage">{$mileage}</div>
<div id="ch-plugin-user-basket-cnt">{$basket_cnt}</div>
<div id="ch-plugin-user-basket-price">{$basket_price}</div>
<div id="ch-plugin-user-interest-prd-cnt">{$interest_prd_cnt}</div>
<div id="ch-plugin-user-coupon-cnt">{$coupon_cnt}</div>
<div id="ch-plugin-user-deposit">{$deposit}</div>
</div>
<script>
window.channelPluginSettings = {
"plugin_id": "YOUR_PLUGIN_ID"
};
(function() {
var node = document.createElement('div');
node.id = 'ch-plugin';
document.body.appendChild(node);
var async_load = function() {
if (document.getElementById('ch-plugin-user')) {
window.channelPluginSettings.user = {
"id": document.getElementById('ch-plugin-user-id').textContent,
"name": document.getElementById('ch-plugin-user-name').textContent,
"mobileNumber": document.getElementById('ch-plugin-user-mobile').textContent,
"meta": {
"적립금": document.getElementById('ch-plugin-user-mileage').textContent,
"장바구니 개수": document.getElementById('ch-plugin-user-basket-cnt').textContent,
"장바구니 금액": document.getElementById('ch-plugin-user-basket-price').textContent,
"관심상품 개수": document.getElementById('ch-plugin-user-interest-prd-cnt').textContent,
"쿠폰 개수": document.getElementById('ch-plugin-user-coupon-cnt').textContent,
"예치금": document.getElementById('ch-plugin-user-deposit').textContent
}
};
}
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//cdn.channel.io/plugin/ch-plugin-web.js';
s.charset = 'UTF-8';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
};
if (window.attachEvent) {
window.attachEvent('onload', async_load);
} else {
window.addEventListener('load', async_load, false);
}
})();
</script>
<!-- End Channel Plugin -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment