1

I am in the process of implementing google certified shops on our magento CE site in the UK.

I have completed most of the testing but am struggling with the order confirmation module. I have sorted the following code from another stack over flow tutorial (really sorry but I cannot remember which otherwise I would link and give credit)

<?php
    $orderId = $this->getOrderId();
    $order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
    $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
    $address = $order->getShippingAddress();
    $backorder = false; // some backorder logic
    $download = false; // some download logic
    $shipDate = new Zend_Date(); // some logic to determine ship date
?>
<!-- START Trusted Stores Order -->
<div id="gts-order" style="display:none;">

<!-- start order and merchant information -->
<span id="gts-o-id"><?php echo $orderId; ?></span>
<span id="gts-o-domain">{www.ourwebaddress.com}</span>
<span id="gts-o-email"><?php echo htmlentities($customer->getEmail()); ?></span>
<span id="gts-o-country"><GB></span>
<span id="gts-o-currency">GBP</span>
<span id="gts-o-total"><?php echo $order->getGrandTotal(); ?></span>
<span id="gts-o-discounts">-<?php echo $order->getDiscountAmount(); ?></span>
<span id="gts-o-shipping-total"><?php echo $order->getShippingAmount(); ?></span>
<span id="gts-o-tax-total"><?php echo $order->getTaxAmount(); ?></span>
<span id="gts-o-est-ship-date"><?php echo $shipDate->toString('yyyy-MM-dd'); ?></span>
<span id="gts-o-has-preorder"><N></span>
<span id="gts-o-has-digital"><N></span>
<!-- end order and merchant information -->

<!-- start repeated item specific information -->
<?php foreach ($order->getAllItems() as $item): ?>
<span class="gts-item">
<span class="gts-i-name"><?php echo htmlentities($item->getName()); ?></span>
<span class="gts-i-price"><?php echo $item->getBasePrice(); ?></span>
<span class="gts-i-quantity"><?php echo (int)$item->getQtyOrdered(); ?></span>
<span class="gts-i-prodsearch-country">US</span>
<span class="gts-i-prodsearch-language">en</span>
</span>
<?php endforeach; ?>
<!-- end repeated item specific information -->

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

And have placed it on the app/design/frontend/{your}/{theme}/template/checkout/success.phtml page.

Could anyone provide any advice as to why it is not working?

Thanks in advance

0

Not sure what is wrong with your code, but you should definitely have a look at the free and open source Google Trusted Stores extension by Develo Design. I use it for a shop, which is now a Google trusted store. I also contributed some code to the extension and my changes were merged nearly instantly. So this extension seems to be nicely supported and maintained.

  • How easy are the modman / git or subversion to use for installing extensions? – Peter May 13 '15 at 8:03
  • If you have an existing shop without modman, it takes quite some time to convert it to use modman (depending on the number of extensions + themes). But you can also simply drop the files at the right place in your shop. In any case, you should use a VCS like git or subversion. – Simon May 13 '15 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.