添加谷歌信任商店徽章

时间:2012-09-18 21:50:59

标签: php javascript magento magento-1.4 magento-1.6

我已按照此处的步骤操作 Add Google trust badge to Magento

然后在这里: http://www.magentocommerce.com/magento-connect/google-trusted-stores.html

在所有页面中,第一个javascript部分显示正常。 在结帐成功页面中,它没有显示良好的代码。 (见下面的更新) 我知道我正在编辑正确的文件,因为我在success.phtml中输入了静态文本 但在订购之后,我无法看到应该生成的生成的html。

我将该代码放在文件的末尾。

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
123
<div class="page-title">
    <h1><?php echo $this->__('Your order has been received') ?></h1>
</div>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>

<?php if ($this->getOrderId()):?>
<?php if ($this->getCanViewOrder()) :?>
    <p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
<?php  else :?>
    <p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
<?php endif;?>
    <p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) :?>
    <p>
        <?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
        <?php echo $this->getChildHtml() ?>
    </p>
<?php endif;?>
<?php endif;?>

<?php if ($this->getAgreementRefId()): ?>
    <p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
<?php endif;?>

<?php if ($profiles = $this->getRecurringProfiles()):?>
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
<ul class="disc">
<?php foreach($profiles as $profile):?>
<?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?>
    <li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
<?php endforeach;?>
</ul>
<?php endif;?>

<div class="buttons-set">
    <button type="button" class="button" title="<?php echo $this->__('Continue Shopping') ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
</div>

<script type="text/javascript">
<!--
/* NexTag ROI Optimizer Data */
var id = '3551264';
var rev = '<<?php echo Mage::getSingleton('core/session')->getScriptRevenue(); ?>>';
var order = '<<?php echo $this->getOrderId(); ?>>';
var cats = '<?php echo Mage::getSingleton('core/session')->getScriptCats(); ?>';
var prods = '<?php echo Mage::getSingleton('core/session')->getScriptProds(); ?>';
var units = '<?php echo Mage::getSingleton('core/session')->getScriptUnits(); ?>';
//-->
</script>
<script type="text/javascript" src="https://imgsrv.nextag.com/imagefiles/includes/roitrack.js"></script>

<?php 
$order = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId()); 
$amount = number_format($order->getGrandTotal(),2); 
?> 

<?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.theprinterdepo.com}</span>
<span id="gts-o-email"><?php echo htmlentities($customer->getEmail()); ?></span>
<span id="gts-o-country"><?php echo htmlentities($address->getCountryId()); ?></span>
<span id="gts-o-currency">USD</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"><?php echo $backorder ? 'Y' : 'N'; ?></span>
<span id="gts-o-has-digital"><?php echo $download ? 'Y' : '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 -->

更新 我删除了代码,因为它们在第一个链接中显示,我安装了magento扩展,应该在需要的地方自动插入代码。在任何页面和订单成功页面上检查html后,我可以看到代码是真的生成的,我无法看到谷歌所说的验证栏。

(我仍然无法看到徽章)

很奇怪,当我右键单击查看源时,我看不到hte html代码,但是如果用firebug lite检查代码就在那里

<div id="gts-order" style="display: none; ">
<span id="gts-o-id">900001439</span>
<span id="gts-o-domain">{www.theprinterdepo.com}</span>
<span id="gts-o-email">sam.x.x@outlook.com</span>
<span id="gts-o-country">US</span>
<span id="gts-o-currency">USD</span>
<span id="gts-o-total">449.8400</span>
<span id="gts-o-discounts">-0.0000</span>
<span id="gts-o-shipping-total">34.8500</span>
<span id="gts-o-tax-total">0.0000</span>
<span id="gts-o-est-ship-date">2012-09-18</span>
<span id="gts-o-has-preorder">N</span>
<span id="gts-o-has-digital">N</span>
<span class="gts-item">
<span class="gts-i-name">HP LaserJet Pro 100 M175nw MFP Printer</span>
<span class="gts-i-price">414.9900</span>
<span class="gts-i-quantity">1</span>
<span class="gts-i-prodsearch-country">US</span>
<span class="gts-i-prodsearch-language">en</span>
</span>
</div>

1 个答案:

答案 0 :(得分:1)

这只能在美国的IP地址中完成,否则验证工具栏和预览徽章不会出现。我连接到我们的桌面,然后我可以做所有验证。