修改ecshop2.6.2发货必须添单号.txt

2009-12-09 21:46 来源:www.chinab4c.com 作者:ecshop专家

      ecshop2.6.2电子商务有个漏洞就是在发货的时候,不填写发货单.也能提交订单.这样就有点不符合逻辑.在任意场合,发货之后,发货单都是追踪物流的一个重要证据.所以,有必要让ecshop在发货的时候,填写发货单.

1:languages/zh_cn/admin/order.php
$_LANG['js_languages']['fahuodan'] = '请您填写发货单号!';
2:admin\templates\order_operate.htm
 {if $show_invoice_no}
  <tr>
    <th>{$lang.label_invoice_no}</th>
    <td><input name="invoice_no" type="text" size="30" />{$lang.require_field}</td>
  </tr>
  {/if}
3:admin\templates\order_operate.htm
js中增加以下变量
 var show_invoice_no = '{$show_invoice_no}'
<script language="JavaScript">
  var require_note = '{$require_note}';
  var show_refund  = '{$show_refund}';
  var show_cancel = '{$show_cancel_note}';
  var show_invoice_no = '{$show_invoice_no}'
 
{literal}
  function check()
  {
    if (require_note && document.forms['theForm'].elements['action_note'].value == '')
    {
      alert(pls_input_note);
      return false;
    }
  if (show_invoice_no && document.forms['theForm'].elements['invoice_no'].value == '')
    {
      alert(fahuodan);
      return false;
    }
 if (show_cancel && document.forms['theForm'].elements['cancel_note'].value == '')
 {
   alert(pls_input_cancel);
   return false;
 }
    if (show_refund)
    {
      var selected = false;
      for (var i = 0; i < document.forms['theForm'].elements.length; i++)
      {
        ele = document.forms['theForm'].elements[i];
        if (ele.tagName == 'INPUT' && ele.name == 'refund' && ele.checked)
        {
          selected = true;
          break;
        }
      }
      if (!selected)
      {
        alert(pls_select_refund);
        return false;
      }
    }
    return true;
  }
{/literal}
</script>

来源:中国B4C电子商务