⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basket.ihtml

📁 php做的网上商店系统。简单易懂
💻 IHTML
字号:
<?php

  eval(load_class("product", "ps_product"));
  $ps_product = new ps_product;
  eval(load_class("product", "ps_product_category"));
  $ps_product_category = new ps_product_category;
  eval(load_class("ISshipping", "ps_intershipper"));
  $ps_intershipper = new ps_intershipper;


  if ($cart["idx"] == 0) {
     echo $empty_cart;
     $checkout = False;
  }
  else {
     $checkout = True;
?>
<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0 WIDTH="95%" ALIGN="CENTER" BORDERCOLORLIGHT="#D0B890" BORDERCOLORDARK="#D0B890">
<TR ALIGN=left BGCOLOR=#D1B78F CLASS="unnamed11">
<TH HEIGHT="14" width="200"><?php 
      echo $cart_name;
     ?></TH>
<TH HEIGHT="14" WIDTH="60"><?php 
      echo $cart_sku;
     ?></TH>
<TH HEIGHT="14" WIDTH="30"><?php 
      echo $cart_price;
     ?></TH>
<TH HEIGHT="14" WIDTH="30"><?php 
      echo $cart_quantity;
     ?></TH>
<TH HEIGHT="14" WIDTH="40"><?php 
      echo $cart_subtotal;
     ?></TH>
    <TH COLSPAN=2 ALIGN=CENTER> 动作</TH>
</TR>
<?php
  $total = 0;
  for ($i=0;$i<$cart["idx"];$i++) {
    if ($i % 2) $row_color = SEARCH_COLOR_2;
       else $row_color = SEARCH_COLOR_1;
?>
<TR VALIGN=TOP BGCOLOR=<?php echo $row_color ?>>
<FORM ACTION="<?php echo URL ?>" METHOD=POST>
<?php $sess->hidden_session() ?>
<INPUT TYPE=HIDDEN NAME=ship_to_info_id VALUE=<?php echo $ship_to_info_id?> >

<TD><?php
      // Get product parent id if exists
      $product_parent_id=$ps_product->get_field($cart[$i]["product_id"],"product_parent_id");
      // Get flypage for this product
      $flypage = $ps_product->get_flypage($cart[$i]["product_id"]);
      // Build URL based on whether item or product
      if ($product_parent_id)
         $url = $sess->url(URL . "?page=$flypage&product_id=$product_parent_id");
      else
         $url = $sess->url(URL . "?page=$flypage&product_id=" . $cart[$i]["product_id"]);
      echo "<A HREF=$url>";
      // Display product name
      echo "<B>" . $ps_product->get_field($cart[$i]["product_id"], "product_name") . "</B>";
      echo "</A>";
      // Display attribute values if this an item
      if ($product_parent_id) {
        $db_detail=$ps_product->attribute_sql($cart[$i]["product_id"],$product_parent_id);
        while ($db_detail->next_record()) {
           echo "<BR>" . $db_detail->f("attribute_name") . "&nbsp;";
	   echo "(" . $db_detail->f("attribute_value") . ")"; 
        }
      }
     ?></TD>
<TD><?php
      echo $ps_product->get_field($cart[$i]["product_id"], "product_sku");
     ?></TD>
<TD><?php
      $price = $ps_product->get_price($cart[$i]["product_id"]);
      printf("%.2f", $price["product_price"]);
     ?></TD>
<TD>
    <INPUT TYPE=TEXT SIZE=4 MAXLENGTH=4 NAME=quantity 
	VALUE=<?php echo $cart[$i]["quantity"];?>>
    </TD>
<TD><?php
      $subtotal = $price["product_price"] * $cart[$i]["quantity"];
      $total += $subtotal;
      printf("%.2f", $subtotal);
     ?></TD>
<TD>
  <INPUT TYPE=HIDDEN NAME=page VALUE=<?php echo $page ?>>
  <INPUT TYPE=HIDDEN NAME=func VALUE="cartUpdate">
  <INPUT TYPE=HIDDEN NAME=product_id VALUE=<?php echo $cart[$i]["product_id"]?>>
        <INPUT TYPE=Submit NAME=Update VALUE="修改">
</FORM>
</TD>
<TD>
  <FORM ACTION="<?php echo URL ?>" METHOD=POST NAME=Delete>
  <?php $sess->hidden_session() ?>
  <INPUT TYPE=HIDDEN NAME=page VALUE=<?php echo $page?>>
  <INPUT TYPE=HIDDEN NAME=func VALUE="cartDelete">
  <INPUT TYPE=HIDDEN NAME=product_id VALUE=<?php echo $cart[$i]["product_id"]?>>
        <INPUT TYPE=Submit NAME=Delete VALUE="删除">
</FORM>
</TD></TR>
<?php
  } // End for loop
?>
<TR>
    <TD COLSPAN=4 ALIGN=RIGHT>小计: </TD> 
<TD COLSPAN=3><FONT COLOR="#FF0000"><?php
               printf("%.2f", $total);
               ?></FONT>
</TD>
</TR>
<?php if ($auth["user_id"] && $ship_to_info_id) { ?>
<TR>
    <TD COLSPAN=4 ALIGN=RIGHT>税务: </TD> 
<TD COLSPAN=3><FONT COLOR="#FF0000"><?php
               $order_tax = $ps_checkout->calc_order_tax($total, $vars);
            
               printf("%.2f", $order_tax);
               ?></FONT>
</TD>
</TR>
<TR>
    <TD COLSPAN=4 ALIGN=RIGHT>运费: </TD> 
<TD COLSPAN=3><FONT COLOR="#FF0000"><?php
               if (IS_ENABLE) {
               $order_shipping = $ps_intershipper->get_rate($vars);
               }
               else {
               $order_shipping = 0;
               }
               printf("%.2f", $order_shipping);
               ?></FONT>
</TD>
</TR>
<TR>
    <TD COLSPAN=4 ALIGN=RIGHT>总计: </TD>
<TD COLSPAN=3><FONT COLOR="#FF0000"><?php
               $order_total = $order_tax + $order_shipping + $total;

               printf("<B>%.2f</B>", $order_total);
               ?></FONT>
</TD>
</TR>

<?php
     } 
?>
</TABLE>
<?php
 }
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -