在下拉列表中显示付款方式列表

时间:2016-01-20 09:30:16

标签: magento-1.9.2.1

下面的代码是我的methods.phtml文件,我想在下拉列表中显示这些付款方式而不是单选按钮。

<?php $methods=$ this->getMethods(); $oneMethod = count($methods)
<=1 ; ?>
  <?php if (empty($methods)): ?>
  <dt>
        <?php echo $this->__('No Payment Methods') ?>
    </dt>
  <?php else: foreach ($methods as $_method): $_code=$ _method->getCode(); ?>
  <dt id="dt_method_<?php echo $_code ?>">
    <?php if(!$oneMethod): ?>
        <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
    <?php else: ?>
        <span class="no-display"><input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" checked="checked" class="radio" /></span>
        <?php $oneMethod = $_code; ?>
    <?php endif; ?>
        <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?></label>
    </dt>
  <?php if ($html=$ this->getPaymentMethodFormHtml($_method)): ?>
  <dd id="dd_method_<?php echo $_code ?>">
    <?php echo $html; ?>
  </dd>
  <?php endif; ?>
  <?php endforeach; endif; ?>

0 个答案:

没有答案