Roaddoctor Posted March 7, 2013 Share Posted March 7, 2013 I was hoping to already see a module for Google Trusted Stores but no luck. There has to be someone here who has added this to their shop already? If anyone has already accomplished the feed creation and code placement on a 2.2rc2a or 2.3 shop, it would be great if you could share! All about Google Trusted Stores If not, would anyone here be able to work on developing this? It should not be too difficult. Creating the feeds seems to be the tricky part beyond my ability. Integrating the final google code should be simpler and I can probably do that part; but without the feed part sorted first I am stuck. Anyone willing or able to knock this out? Thanks! Quote -Dave Link to comment Share on other sites More sharing options...
Christiane N Posted August 17, 2014 Share Posted August 17, 2014 :thought_balloon: Hi Roaddoctor, Have you found a solution for the problem yet? I am most interested in learning about it. Kindest regards, Christiane Quote Link to comment Share on other sites More sharing options...
burt Posted August 18, 2014 Share Posted August 18, 2014 @@Roaddoctor @@Christiane N - a few hours work maximum for any good developer. Share the cost, submit it back to the addons area. http://www.oscommerce.com/forums/forum/79-commercial-support-enquiries/ Quote Link to comment Share on other sites More sharing options...
Roaddoctor Posted January 25, 2015 Author Share Posted January 25, 2015 All - Google has greatly simplified the requirements for Trusted Stores... order feeds and shipment feeds are no longer required! I worked on this to the extent of my abilities. If someone with actual coding skills would like to take it from here please do. Here is what I have so far. Note I was working on this for a 2.2rc2a shop. For 2.3.4+ this would be best as a content module (at least the checkout success portion). I am not a coder so below is just a starting point New Trusted Stores integration details For a 2.2 shop... First the easy part: create new file at /catalog/includes/google_trusted_store.php <?php /* $Id: google_trusted_store.php,v 1.0 2015/01/24 BFD osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2015 osCommerce Released under the GNU General Public License */ ?> <?php if (isset($_GET['products_id']) && (tep_not_null($product_info['products_model'])) ) { $googlepid = $product_info['products_model']; } else { $googlepid = ''; } ?> <!-- BEGIN: Google Trusted Stores --> <script type="text/javascript"> var gts = gts || []; gts.push(["id", "xxxxxx"]); gts.push(["badge_position", "BOTTOM_LEFT"]); gts.push(["locale", "en_US"]); <?php if (isset($_GET['products_id']) ) { ?> gts.push(["google_base_offer_id", "<?php echo $googlepid; ?>"]); <?php } ?> gts.push(["google_base_subaccount_id", "xxxxxxx"]); gts.push(["google_base_country", "US"]); gts.push(["google_base_language", "en"]); (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 --> Then in /catalog/includes/footer.php (and mobile/includes/footer.php if exists), place at end of file <?php include_once('includes/google_trusted_store.php'); ?> That takes care of the code for every page in the shop. Now for checkout_success.php, so far I have this (very rough) starting point... <!--Begin Google Trusted Stores --> <!-- START Google Certified Shops Order --> <div id="gts-order" style="display:none;" translate="no"> <!-- start order and merchant information --> <span id="gts-o-id"><?php echo $order_id; ?></span> <span id="gts-o-domain">www.yourdomain.com</span> <span id="gts-o-email"><?php echo $email; ?></span> <span id="gts-o-country"><?php echo $iso_code_2; ?></span> <span id="gts-o-currency">USD</span> <span id="gts-o-total"><?php echo $order_total; ?></span> <span id="gts-o-discounts"><?php echo $discounts; ?></span> <span id="gts-o-shipping-total"><?php echo $shipping; ?></span> <span id="gts-o-tax-total"><?php echo $tax; ?></span> <span id="gts-o-est-ship-date"><?php echo $order_date+1 //('YYYY-MM-DD'); ?></span> <span id="gts-o-est-delivery-date"><?php echo $order_date+7 //('YYYY-MM-DD'); ?></span> <span id="gts-o-has-preorder"><?php echo $isBackordered; ?></span> <span id="gts-o-has-digital"><?php echo $isDownloadable; ?></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"><?php echo $product_name; ?></span> <span class="gts-i-price"><?php echo $price; ?>]</span> <span class="gts-i-quantity"><?php echo $quantity; ?></span> <span class="gts-i-prodsearch-id"><?php echo $model; ?></span> <span class="gts-i-prodsearch-store-id">xxxxxxx</span> <span class="gts-i-prodsearch-country">US</span> <span class="gts-i-prodsearch-language">en</span> </span> <!-- end item 1 example --> <!-- end repeated item specific information --> </div> <!-- END Google Certified Shops Order --> <!--End Google Trusted Stores--> What is needed from here, and beyond my ability, is the remaining code necessary for the checkout_success code above to work, including the looping thru the item specifics for each item. that's all I got so far. Good luck - Dave Quote -Dave Link to comment Share on other sites More sharing options...
DriWashSolutions Posted May 24, 2015 Share Posted May 24, 2015 Thanks - that little bit of coding helped out tremendously! Quote John Skurka Link to comment Share on other sites More sharing options...
DriWashSolutions Posted May 25, 2015 Share Posted May 25, 2015 Except for the checkout portion - which doesn't work. Quote John Skurka Link to comment Share on other sites More sharing options...
cubifil Posted October 26, 2015 Share Posted October 26, 2015 (edited) <span id="gts-o-email"><?php echo $order->customer['email_address']; ?></span> <span id="gts-o-currency"><?php echo $order->info['currency']; ?></span> <span id="gts-o-total"><?php echo $order->info['subtotal']; ?></span> <span id="gts-o-shipping-total"><?php echo $order->info['shipping_cost']; ?></span> Edited October 26, 2015 by cubifil Quote Link to comment Share on other sites More sharing options...
cubifil Posted October 26, 2015 Share Posted October 26, 2015 (edited) <span id="gts-o-email"><?php echo $order->customer['email_address']; ?></span><span id="gts-o-country"><?php echo $order->customer['country']['iso_code_2']; ?></span> <span id="gts-o-currency"><?php echo $order->info['currency']; ?></span> <span id="gts-o-total"><?php echo $order->info['subtotal']; ?></span> <span id="gts-o-shipping-total"><?php echo $order->info['shipping_cost']; ?></span> <span id="gts-o-tax-total"><?php echo $order->info['tax'] ?></span> Edited October 26, 2015 by cubifil Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.