var head = document.getElementsByTagName('HEAD')[0]; var stylesheet = document.createElement('link'); stylesheet.rel = 'stylesheet'; stylesheet.type = 'text/css'; stylesheet.href = 'https://trust-badges.crucialcommerceapps.com/css/cc-trust-styles.css'; head.appendChild(stylesheet); var preview_style = document.createElement('style'); preview_style.id = 'preview_css'; head.appendChild(preview_style); var heading_align = 'center'; var icon_align = 'center'; var icon_style = 'original'; if (icon_style == "card") { var icon_style_class = "cc-payment-methods-o"; } else if (icon_style == "fill") { var icon_style_class = "cc-payment-methods-i"; } else if (icon_style == "original") { var icon_style_class = ""; } var preview = ""+ "

Secure Checkout With

"+ "
"; generateLiveStyle(); jQueryCode = function(){ $('form[action*="/cart/add"]').first().after(preview); } if(window.jQuery) jQueryCode(); else{ var script = document.createElement('script'); document.head.appendChild(script); script.type = 'text/javascript'; script.src = "//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"; script.onload = jQueryCode; } function generateLiveStyle() { const icon_color = '#555555'; const icon_size = '32'; const icon_align = 'center'; const heading_color = '#555555'; const heading_size = '24'; const heading_align = 'center'; let css = ".cc-trust-wrapper>h2 {"+ "color: "+heading_color+";"+ "font-size: "+heading_size+"px;"+ "text-align: "+heading_align+";"+ "letter-spacing: normal;"+ "line-height: 1;"+ "text-transform: none;"+ "margin-bottom: 8px;"+ "padding-left: 5px;"+ "padding-right: 5px;"+ "font-family: sans-serif;"+ "}"+ ".cc-trust-wrapper .cc-payment-methods {"+ "color: "+icon_color+";"+ "text-align: "+icon_align+";"+ "}"+ ".cc-trust-wrapper .cc-payment-methods.cc-payment-methods-i>li>i, .cc-trust-wrapper .cc-payment-methods.cc-payment-methods-inverse>li>i {"+ "color: #fff;"+ "background: "+icon_color+";"+ "border-color: "+icon_color+";"+ "}"+ ".cc-trust-wrapper .cc-payment-methods.cc-payment-methods-o>li>i, .cc-trust-wrapper .cc-payment-methods.cc-payment-methods-outline>li>i {"+ "color: "+icon_color+";"+ "border-color: "+icon_color+";"+ "}"+ ".cc-trust-wrapper .cc-payment-methods>li>i {"+ "font-size: "+icon_size+"px;"+ "}"+ ".cc-trust-wrapper .cc-payment-methods>li>img {"+ "height: "+(parseInt(icon_size)+10)+"px;"+ "}"; document.getElementById("preview_css").innerHTML = css; }