> Zencart中文手册 > zencart模板怎么修改运费及根据不同产品选择配送方式


只需更改这个模板文件,就可以修改zencart 的运费及配送方式。
要修改运费及选择配送方式,只需更改这个模板文件
includestemplates***templatestpl_checkout_shipping_default
$cart = $_session['cart'];
$contents = $cart->contents;
while ($fruit_name = current($contents)) {
$pizza = key($contents);
$pieces = explode(“:”, $pizza);
$categories_id = zen_get_product_path((int)$pieces[0]);
$categories_duan = explode(“_”, $categories_id);
if ($categories_duan[0] == 14){
$the_categories = $categories_duan[0]; //找到这个产品的目录ID
break;
}
$the_categories = $categories_duan[0];
next($contents);
}
$radio_buttons = 0;
for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
if ($the_categories == 14){
//如果等于这个产品ID,直接对配置ID赋值
$i=1;
}
// bof: field set
// allows FedEx to work comment comment out Standard and Uncomment FedEx
// if ($quotes[$i]['id'] != ” || $quotes[$i]['module'] != ”) { // FedEx
if ($quotes[$i]['module'] != ”) { // Standard