Google Trusted Stores Implementation

  • Posts: 28
  • Thank you received: 1
8 years 10 months ago #226680

-- HikaShop version -- : 2.6..1
-- Joomla version -- : 3.4.5

I have a customer that is wanting me to integrate Google Trusted Stores the instructions for this as follows:

this part is pretty straight forward and is just put on the site template index.php

<!-- BEGIN: Google Trusted Stores -->
<script type="text/javascript">
  var gts = gts || [];

  gts.push(["id", "70xxxx"]);
  gts.push(["badge_position", "BOTTOM_RIGHT"]);
  gts.push(["locale", "PAGE_LANGUAGE"]);
  gts.push(["google_base_offer_id", "ITEM_GOOGLE_SHOPPING_ID"]);
  gts.push(["google_base_subaccount_id", "ITEM_GOOGLE_SHOPPING_ACCOUNT_ID"]);

  (function() {
    var gts = document.createElement("script");
    gts.type = "text/javascript";
    gts.async = true;
    gts.src = "https://www.googlecommerce.com/trustedstores/api/js";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(gts, s);
  })();
</script>
<!-- END: Google Trusted Stores -->

the second part is where i am having problems sorting out the best way to implement.
  • This code should be placed on your order confirmation page(s). All confirmation pages must be HTTPS.
  • The order confirmation module code enables your customers to opt in for purchase protection from Google Trusted Stores after their order is complete and transmits the necessary transaction information to Google.
  • Fill in the variables in red for your store. Learn more
<!-- START Google Trusted Stores Order -->
<div id="gts-order" style="display:none;" translate="no">

  <!-- start order and merchant information -->
  <span id="gts-o-id">MERCHANT_ORDER_ID</span>
  <span id="gts-o-email">CUSTOMER_EMAIL</span>
  <span id="gts-o-country">CUSTOMER_COUNTRY</span>
  <span id="gts-o-currency">CURRENCY</span>
  <span id="gts-o-total">ORDER_TOTAL</span>
  <span id="gts-o-discounts">ORDER_DISCOUNTS</span>
  <span id="gts-o-shipping-total">ORDER_SHIPPING</span>
  <span id="gts-o-tax-total">ORDER_TAX</span>
  <span id="gts-o-est-ship-date">ORDER_EST_SHIP_DATE</span>
  <span id="gts-o-est-delivery-date">ORDER_EST_DELIVERY_DATE</span>
  <span id="gts-o-has-preorder">HAS_BACKORDER_PREORDER</span>
  <span id="gts-o-has-digital">HAS_DIGITAL_GOODS</span>
  <!-- end order and merchant information -->

  <!-- start repeated item specific information -->
  <!-- item example: this area repeated for each item in the order -->
  <span class="gts-item">
    <span class="gts-i-name">ITEM_NAME</span>
    <span class="gts-i-price">ITEM_PRICE</span>
    <span class="gts-i-quantity">ITEM_QUANTITY</span>
    <span class="gts-i-prodsearch-id">ITEM_GOOGLE_SHOPPING_ID</span>
    <span class="gts-i-prodsearch-store-id">ITEM_GOOGLE_SHOPPING_ACCOUNT_ID</span>
  </span>
  <!-- end item 1 example -->
  <!-- end repeated item specific information -->

</div>
<!-- END Google Trusted Stores Order -->

1. Which hikashop template file should I edit to implement this correctly, and
2. What variables should i use to populate the required variables for google?

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 10 months ago #226681

Hi,

You want to add that in the "after_end" file via the menu Display>Views.
You can find the variables in $this->order.
for example:
<?php echo $this->order->order_id; ?>

Please Log in or Create an account to join the conversation.

  • Posts: 53
  • Thank you received: 0
8 years 6 months ago #238945

Hi both,

I'm trying to achieve the same thing. I don't understand the last step of assigning variables. You put "You can find the variables in $this->order." but I don't understand it.

How can I establish each of these variables? Is there a list of them somewhere? Or could you walk me through it? Thanks

Ky

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 6 months ago #238955

Hi,

You can find more information on the order variable in our developer documentation.
Please note that doing that requires a developer. If you're not one, you won't be able to do it alone.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum