Last active
February 3, 2017 08:24
-
-
Save rynaldos-zz/ea421f94c3bda771a375af34f90438b9 to your computer and use it in GitHub Desktop.
[WooCommerce] Adds the Google store badge
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
add_action( 'woocommerce_google_badge', 'my_google_badge' ); | |
function my_google_badge() { | |
?> | |
<!-- BEGIN: Google Trusted Store --> | |
<script type="text/javascript"> | |
var gts = gts || []; | |
gts.push(["id", "54785"]); | |
gts.push(["google_base_offer_id", "ITEM_PRODUCT_SEARCH_ID"]); | |
gts.push(["google_base_subaccount_id", "ITEM_PRODUCT_SEARCH_ACCOUNT_ID"]); | |
gts.push(["google_base_country", "ITEM_PRODUCT_SEARCH_COUNTRY"]); | |
gts.push(["google_base_language", "ITEM_PRODUCT_SEARCH_LANGUAGE"]); | |
(function() { | |
var scheme = (("https:" == document.location.protocol) ? "https://" : "http://"); | |
var gts = document.createElement("script"); | |
gts.type = "text/javascript"; | |
gts.async = true; | |
gts.src = scheme + "www.googlecommerce.com/trustedstores/gtmp_compiled.js"; | |
var s = document.getElementsByTagName("script")[0]; | |
s.parentNode.insertBefore(gts, s); | |
})(); | |
</script> | |
<!-- END: Google Trusted Store --> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment