php链接中的请求

时间:2014-05-13 16:15:21

标签: php magento hyperlink request magento-1.7

这是发货邮件中的/跟踪号码表的* .phtml模板

 <?php $_shipment=$this->getShipment() ?>
<?php $_order=$this->getOrder() ?>
<?php if ($_shipment && $_order && $_shipment->getAllTracks()): ?>
<table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
    <thead>
        <tr>
            <th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Shipped By') ?></th>
            <th align="center" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Tracking Number') ?></th>
        </tr>
    </thead>
    <tbody>
    <?php $i=0; foreach ($_shipment->getAllTracks() as $_item): $i++ ?>
        <tr <?php echo $i%2?'bgcolor="#F6F6F6"':'' ?>>
            <td align="left" valign="top" style="padding:3px 9px"><?php echo $_item->getTitle() ?></td>
            <td align="center" valign="top" style="padding:3px 9px"><?php echo $_item->getNumber() ?></td>
        </tr>
    <?php endforeach ?>
    </tbody>
</table>
<?php endif; ?>

我想更改它,以便跟踪号成为跟踪地块的链接,我找到了一个跟踪包裹的链接

http://www.parcelforce.com/portal/pw/track?trackNumber=[TRACKING NUMBER]

并尝试让它像这样工作

<a alt="Track package" href='http://www.parcelforce.com/portal/pw/track?trackNumber=<?php echo $_item->getNumber() ?>'><?php echo $_item->getNumber() ?></a>

它不起作用。我该如何做对?

0 个答案:

没有答案