【发布时间】:2014-06-14 16:44:26
【问题描述】:
如何根据我在排序订单输入字段中设置的订单号显示我的运输方式列表?
我已在后台设置了每种送货方式的排序顺序,但没有相应显示。
例如,在我的后台,我有这些运输方式,
Method Name: bestway
Sort Order: 1
Method Name: Free
Sort Order: 2
Method Name: Chronopost
Sort Order: 3
但是它们在frontend\argenties\default\template\checkout/cart/shipping.phtml中并没有按这个顺序显示
<?php
$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
$shipping = array();
foreach($methods as $_ccode => $_carrier):
if($_methods = $_carrier->getAllowedMethods()):
if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
$_title = $_ccode;
foreach($_methods as $_mcode => $_method):
$_code = $_ccode . '_' . $_mcode;
$shipping[$_code] = array('title' => $_method,'carrier' => $_title);
?>
<li><input type="radio" name="estimate_method" value="<?php echo $_code;?>" id="s_method_<?php echo $_code ?>"<?php if($_code === $this->getAddressShippingMethod()) echo ' checked="checked"' ?>> <span class="item-text-shipping-method"><?php echo $_title;?></span></li>
<?php endforeach;?>
<?php endif;?>
<?php endforeach;?>
结果,
Method Name: Free
Method Name: bestway
Method Name: Chronopost
Method Name: bestway 应该在列表的顶部,但它总是被降到第二个。为什么?知道如何解决吗?
【问题讨论】: