Php 添加谷歌信任商店徽章

Php 添加谷歌信任商店徽章,php,javascript,magento,magento-1.4,magento-1.6,Php,Javascript,Magento,Magento 1.4,Magento 1.6,我已经按照这里的步骤做了 然后在这里: 在所有页面中,第一个javascript部分显示良好。 在checkout success页面中,它不显示代码。(见下文更新) 我知道我正在编辑正确的文件,因为我在success.phtml中键入了静态文本 但是在订购之后,我看不到应该生成的html 我把代码放在文件的末尾 <?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the A

我已经按照这里的步骤做了

然后在这里:

在所有页面中,第一个javascript部分显示良好。 在checkout success页面中,它不显示代码。(见下文更新) 我知道我正在编辑正确的文件,因为我在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 -->

123


  • 这只能在美国ip地址中完成,否则验证工具栏和预览徽章将不会显示。我连接到美国的桌面,然后我可以进行所有验证。

    我还安装了magento扩展,然后删除了上面的代码,代码在html中生成良好,徽章仍然没有显示。请随时使用visa卡4,15乘以1进行测试。如果您想使用cehckI,请先删除此
    样式=“显示:无
    在与徽章无关的
    中,谷歌需要读取的只是订单信息。在这里读了更多的内容后:我没有看到他们说的验证工具栏。意外地找到了这个答案,它避免了头部撞墙,非常感谢。
    <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>