A-A+

ecshop 去除前台页面的配送方式

2015年07月01日 PHP开源系统 暂无评论 阅读 11 views 次

ecshop 默认的配送方式有多种,我们也可以在后台添加我们自己的配送方式,但有些客户是想把配送的方式全部给删除掉,下面夏日博客就把总结的方法分享一下,还是以 ecshop 2.7.3 为例,实例如下.

1.在flow.dwt中删除这一段:

  1. <!--{if $total.real_goods_count neq 0}-->  
  2.         <div class="colbox colpd">  
  3.           <h3>配送方式</h3>  
  4.           <div class="colboxcontent">  
  5.             <table border="0" cellspacing="0" class="styletable">  
  6.               <tr>  
  7.                 <th width="5"> </th>  
  8.                 <th width="100">{$lang.name}</th>  
  9.                 <th width="400">{$lang.describe}</th>  
  10.                 <th width="100">{$lang.fee}</th>  
  11.                 <th width="80">{$lang.free_money}</th>  
  12.                 <th width="80">{$lang.insure_fee}</th>  
  13.               </tr>  
  14.               <!-- {foreach from=$shipping_list item=shipping key=key} 循环配送方式 -->  
  15.               <tr>  
  16.                 <td>  
  17.                   <input name="shipping" type="radio" value="{$shipping.shipping_id}" {if $order.shipping_id eq $shipping.shipping_id}checked="true"{/if} supportCod="{$shipping.support_cod}" insure="{$shipping.insure}" onclick="selectShipping(this)" id="shipping{$key}" />  
  18.                 </td>  
  19.                 <td><label for="shipping{$key}">{$shipping.shipping_name}</label></td>  
  20.                 <td>{$shipping.shipping_desc}</td>  
  21.                 <td>{$shipping.format_shipping_fee}</td>  
  22.                 <td>{$shipping.free_money}</td>  
  23.                 <td>  
  24.                   <!-- {if $shipping.insure neq 0} -->  
  25.                   {$shipping.insure_formated}  
  26.                   <!-- {else} -->  
  27.                   {$lang.not_support_insure}  
  28.                   <!-- {/if} -->  
  29.                 </td>  
  30.               </tr>  
  31.               <!-- {/foreach} 循环配送方式 -->  
  32.               <tr>  
  33.                 <td colspan="6" align="right">  
  34.                   <label for="ECS_NEEDINSURE" class="textStrong">  
  35.                   <input name="need_insure" type="checkbox"  onclick="selectInsure(this.checked)" value="1"{if $order.need_insure} checked="checked"{/if}{if $insure_disabled} disabled="disabled"{/if} id="ECS_NEEDINSURE"  />  
  36.                   {$lang.need_insure}  
  37.                   </label>  
  38.                 </td>  
  39.               </tr>  
  40.             </table>  
  41.           </div>  
  42.         </div><!-- /colbox -->  
  43.         <!-- {else} -->  
  44.         <input name = "shipping" type="radio" value = "-1" checked="checked" style="display:none" />  
  45.         <!-- {/if} -->  

2.在js/shopping_flow.js中的checkOrderForm(frm)改为:

  1. function checkOrderForm(frm)  
  2. {  
  3.   
  4.   // 检查用户输入的余额  
  5.   if (document.getElementById("ECS_SURPLUS"))  
  6.   {  
  7.     var surplus = document.getElementById("ECS_SURPLUS").value;  
  8.     var error   = Utils.trim(Ajax.call('flow.php?step=check_surplus', 'surplus=' + surplus, null, 'GET', 'TEXT', false));  
  9.   
  10.     if (error)  
  11.     {  
  12.       try  
  13.       {  
  14.         document.getElementById("ECS_SURPLUS_NOTICE").innerHTML = error;  
  15.       }  
  16.       catch (ex)  
  17.       {  
  18.       }  
  19.       return false;  
  20.     }  
  21.   }  
  22.   
  23.   // 检查用户输入的积分  
  24.   if (document.getElementById("ECS_INTEGRAL"))  
  25.   {  
  26.     var integral = document.getElementById("ECS_INTEGRAL").value;  
  27.     var error    = Utils.trim(Ajax.call('flow.php?step=check_integral', 'integral=' + integral, null, 'GET', 'TEXT', false));  
  28.   
  29.     if (error)  
  30.     {  
  31.       return false;  
  32.       try  
  33.       {  
  34.         document.getElementById("ECS_INTEGRAL_NOTICE").innerHTML = error;  
  35.       }  
  36.       catch (ex)  
  37.       {  
  38.       }  
  39.     }  
  40.   }  
  41.   frm.action = frm.action + '?step=done';  
  42.   return true;  
  43. }  

3.在flow.php中 if ($_REQUEST['step'] == 'done'中注释掉:

  1. if ($order['order_amount'] > 0)  
  2.     {  
  3.         $payment = payment_info($order['pay_id']);  
  4.   
  5.         include_once('includes/modules/payment/' . $payment['pay_code'] . '.php');  
  6.   
  7.         $pay_obj    = new $payment['pay_code'];  
  8.   
  9.         $pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));  
  10.   
  11.         $order['pay_desc'] = $payment['pay_desc'];  
  12.   
  13.         $smarty->assign('pay_online', $pay_online);  
  14.     }  
  15. //和:  
  16. if(isset($is_real_good))  
  17.     {  
  18.         $sql="SELECT shipping_id FROM " . $ecs->table('shipping') . " WHERE shipping_id=".$order['shipping_id'] ." AND enabled =1";   
  19.         if(!$db->getOne($sql))  
  20.         {  
  21.            show_message($_LANG['flow_no_shipping']);  
  22.         }  
  23.     }  
标签:

给我留言