📄 isship_select_template.ihtml
字号:
<?php $db = new ps_DB; $q = "SELECT * FROM ISshipping "; $q .= "WHERE ship_publish='Y' "; $q .= "AND vendor_id='$ps_vendor_id' "; $q .= "ORDER BY ship_carrier_name ASC"; $db->query($q); if ($db->nf() > 0) { if ($db->nf() == 1) { $db->next_record(); ?> <INPUT TYPE="hidden" NAME="ship_method_id" VALUE="<?php $db->sp("ship_method_id"); ?>"><?php } else { ?> <TABLE BORDER=0 WIDTH=100% CELLPADDING=2 CELLSPACING=0> <TR BGCOLOR="#FFCC33"> <TD> <B>Select Shipping Method</B> </TD> </TR> <TR> <TD> <SELECT NAME="ship_method_id"><?php /* Pass previous forms results to fetch_quote() function. * If previous form identified a ship to address, the function * will return a quote. Otherwise, it will not. */ if (!$prices = $ps_ISship->fetch_quote($vars)) { /* If we're unable to get a quote, display * a ship method select list without shipping costs. */ while ($db->next_record()) { echo " <OPTION VALUE=" . $db->f("ship_method_id"); if ($ship_method_id) echo " SELECTED>" . $db->f("ship_carrier_name") . " " . $db->f("ship_method_name") . "</OPTION>\r\n"; else echo ">" . $db->f("ship_carrier_name") . " " . $db->f("ship_method_name") . "</OPTION>\r\n"; } } else { /* We were able to get a quote. So, display a ship * method select list with ship prices. */ while ($db->next_record()) { reset($prices); while (list($key,$val)=each($prices)) { if (strcmp($key,$db->f("ship_method_id")) == 0) { echo " <OPTION VALUE=$key"; if ($ship_method_id && (strcmp($ship_method_id,$db->f("ship_method_id")) == 0)) echo " SELECTED>" . $db->f("ship_carrier_name") . " " . $db->f("ship_method_name") . " - ". $prices[$key]["rate"] . "</OPTION>\r\n"; else echo ">" . $db->f("ship_carrier_name") . " " . $db->f("ship_method_name") . " - ". $prices[$key]["rate"] . "</OPTION>\r\n"; } } } ?> </SELECT> </TD> </TR> </TABLE><?php } } }?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -