我正在使用数组来尝试加载特定的下拉列表,但我不确定它为什么不起作用 - 我没有从中获得任何数据shop_shipping_rule_item_multiple
大批:
array(2) {
[0]=> array(3) {
["shop_shipping_rule_name"]=> string(13) "Overnight UPS"
["shop_shipping_rule_item_multiple"]=> string(4) "4.00"
["shop_shipping_rule_type_multi"]=> string(5) "multi"
}
[1]=> array(3) {
["shop_shipping_rule_name"]=> string(13) "NZ Snail Mail"
["shop_shipping_rule_item_multiple"]=> string(5) "35.00"
["shop_shipping_rule_type_multi"]=> string(5) "multi"
}
}
代码:
<?php foreach($shipping_methods as $method): ?>
<?php if(in_array('shop_shipping_rule_type_multi', $method)): ?>
<option onchange="calShipping()" value="<?php echo $method['shop_shipping_rule_item_multiple'];?>"><?php echo $method['shop_shipping_rule_name'];?> | <?php echo $method['shop_shipping_rule_item_multiple']; ?></option>
<?php else: ?>
<option onchange="calShipping()" value="<?php echo $method['shop_shipping_rule_item_single'];?>"><?php echo $method['shop_shipping_rule_name'];?> | <?php echo $method['shop_shipping_rule_item_single']; ?></option>
<?php endif; ?>
<?php endforeach;?>