定型管 電子鈑金
返回列表 回復 發帖

帖子標題:[求助] 批量購買 插件 有人要研究一下嗎?

由於 網站屬於批發性 希望有一次讓顧客選擇多樣商品
且可以設定數量一次共買 避免一個一個點進去 造成困擾
所以上網找了 批量購買插件 但是只有原代碼
並無多說明 有人知道該怎麼使用嗎?
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="Keywords" content="{$keywords}" />
  6. <meta name="Description" content="{$description}" />
  7. <meta name="Description" content="{$description}" />

  8. <!-- TemplateBeginEditable name="doctitle" -->
  9. <title>{$page_title}</title>
  10. <!-- TemplateEndEditable --><!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
  11. <link rel="shortcut icon" href="favicon.ico" />
  12. <link rel="icon" href="animated_favicon.gif" type="image/gif" />
  13. <link href="{$ecs_css_path}" rel="stylesheet" type="text/css" />
  14. {* 包含腳本文件 *}
  15. {insert_scripts files='common.js'}
  16. <!-- 購物車內容 -->
  17.   {* 包含腳本文件 *}
  18.   <SCRIPT src="js/common.js" type=text/javascript></SCRIPT>
  19. <SCRIPT src="js/shopping_flow.js" type=text/javascript></SCRIPT>
  20. <script type="text/javascript">
  21. var process_request = "{$lang.process_request}";
  22. </script>

  23.   {insert_scripts files='showdiv.js'}
  24.   {insert_scripts files='transport.js'}
  25.        <script type="text/javascript" charset="utf-8">
  26.         function collect_to_flow(goodsId,number)
  27.         {
  28.           var goods        = new Object();
  29.           var spec_arr     = new Array();
  30.           var fittings_arr = new Array();
  31.          // var number       = number;
  32.           goods.spec     = spec_arr;
  33.           goods.goods_id = goodsId;
  34.           goods.number   = number;
  35.           goods.parent   = 0;
  36.           Ajax.call('flow.php?step=add_to_cart', 'goods=' + goods.toJSONString(), collect_to_flow_response, 'POST', 'JSON');
  37.         }
  38.         function collect_to_flow_response(result)
  39.         {
  40.           if (result.error > 0)
  41.   {
  42.     // 如果需要缺貨登記,跳轉
  43.     if (result.error == 2)
  44.     {
  45.       if (confirm(result.message))
  46.       {
  47.         location.href = 'user.php?act=add_booking&id=' + result.goods_id;
  48.       }
  49.     }
  50.     // 沒選規格,彈出屬性選擇框
  51.     else if (result.error == 6)
  52.     {
  53.       openSpeDiv(result.message, result.goods_id, result.parent);
  54.     }
  55.     else
  56.     {
  57.       alert(result.message);
  58.     }
  59.   }
  60.   else
  61.   {
  62.     var cartInfo = document.getElementById('ECS_CARTINFO');
  63.     var cart_url = 'flow.php?step=cart';
  64.     if (cartInfo)
  65.     {
  66.       cartInfo.innerHTML = result.content;
  67.     }
  68.    
  69.   }
  70.         }
  71.       </script>
  72. </head>
  73. <body>
  74. <!-- #BeginLibraryItem "/library/page_header.lbi" --><!-- #EndLibraryItem -->
  75. <div id="main">
  76. <!--當前位置 start-->
  77. <div class="block box">
  78. <div id="ur_here">
  79.   <!-- #BeginLibraryItem "/library/ur_here.lbi" --><!-- #EndLibraryItem -->
  80. </div>
  81. </div>
  82. <!--當前位置 end-->
  83. <div class="blank"></div>
  84. <div class="block">
  85.   <div class="flowBox">
  86.     <h6><span>{$lang.print_quotation}</span></h6>
  87.     <form action="quotation.php" method="post" name="searchForm" target="_blank" class="quotation">
  88.       <!-- 分類 -->
  89.       <select name="cat_id"><option value="0">{$lang.all_category}</option>{$cat_list}</select>
  90.       <!-- 品牌 -->
  91.       <select name="brand_id"><option value="0">{$lang.all_brand}</option>{html_options options=$brand_list}</select>
  92.       <!-- 關鍵字 -->
  93.       {$lang.keywords} <input type="text" name="keyword" class="inputBg"/>
  94.       <!-- 搜索 -->
  95.       <input name="act" type="hidden" value="print_quotation" />
  96.       <input type="submit" name="print_quotation" id="print_quotation" value="{$lang.print_quotation}" style="vertical-align:middle;" class="bnt_blue_1" />
  97.     </form>
  98.   </div>  
  99.   
  100. </div>
  101. <title>{$lang.quotation} - {$shop_name}</title>
  102. {literal}
  103. <style type="text/css" media="all">
  104.    body,td,th {text-align:left;font-size:13px; padding:2px;}
  105.    table{border-top:1px solid #000;border-left:1px solid #000;}
  106.    table td,table th{border-right:1px solid #000;border-bottom:1px solid #000;}
  107. </style>
  108. <style type="text/css" media="print">
  109.     .print_btn{display:none;}
  110. </style>
  111. {/literal}
  112. </head>
  113. <body>
  114. <script type="text/javascript">
  115. //<![CDATA[
  116.     function calc_price(base_price, rank_price)
  117.     {
  118.         document.write((base_price * rank_price / 100).toFixed(2));
  119.     }
  120. //]]>
  121. </script>
  122. <h3 align="center">{$shop_name} - {$lang.quotation}</h3>

  123. <table width="100%" cellspacing="0" cellpadding="0">
  124.     <tr>
  125.         <th>{$lang.goods_name}</th>
  126.         <th>{$lang.goods_category}</th>
  127.         <!--{if $cfg.use_storage and $cfg.show_goodsnumber}-->
  128.         <th>{$lang.goods_inventory}</th>
  129.         <!-- {/if} -->
  130.         <th>{$lang.price}</th>
  131.         <!--{foreach from=$extend_price item=ext_price}-->
  132.         <th>{$ext_price}</th>
  133.         <!--{/foreach}-->
  134.         <th>{$lang.number}</th>
  135.         <th>dianjigoum</th>
  136.     </tr>
  137.    
  138.     <!--{foreach from=$goods_list item=goods}-->
  139.     <tr>
  140.         <td><a href="goods.php?id={$goods.goods_id}" target="_blank">{$goods.goods_name}</a></td>
  141.         <td>{$goods.goods_category}</td>
  142.         <!--{if $cfg.use_storage and $cfg.show_goodsnumber}-->
  143.         <td>{$goods.goods_number}</td>
  144.         <!-- {/if} -->
  145.         <td>{$goods.shop_price}</td>         
  146.         <!--{foreach from=$extend_rank[$goods.goods_id] item=ext_rank}-->
  147.         <td>{$ext_rank.price}</td>      
  148.         <!--{/foreach}-->
  149.         <td><!-- {if $goods.goods_id gt 0 && $goods.is_gift eq 0 && $goods.parent_id eq 0} 普通商品可修改數量 -->
  150.   <input name="number" type="text" value="0" size="4"  id="number" style="vertical-align:middle;border:1px solid #CCC;width:35px;font-size:12px;color:#32424F; text-align:right;"  onblur="collect_to_flow({$goods.goods_id},this.value);"/>
  151.                
  152.                 <!-- {else} -->
  153.                 {$goods.goods_number}
  154.                 <!-- {/if} --></td><td><a href="javascript:addToCart({$goods.goods_id})"> O K</a></td>  
  155. </tr>
  156.     <!--{/foreach}-->
  157. </table>
  158. <center><input type="button" class="print_btn" value="{$lang.print_quotation}" onClick="window.print()" />
  159. <input name="submit" type="submit" class="bnt_blue_1" value="&nbsp;&nbsp; {$lang.update_cart}--Print--" style="color:#000">
  160. <a href="flow.php">批量購買 </a></center>
  161. </div>
  162. <!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->
  163. </body>
  164. </html>
複製代碼
提醒您: 您在"ECSHOP 交流討論區"交流請遵守台灣法律規範,"呆呆a阿狗" 發表的文章《批量購買 插件 有人要研究一下嗎?》版權歸屬作者所有,如是轉貼版權歸屬原作者所有.本論壇不對其真實性做任何考證.
返回列表