ecshop版本:v2.7.3 怎么去掉“配送方式” 15
在flow.phpflow.dwt和shopping_flow.js里面都做了些相应的修改,最好的结果的就是不显示“选择配送方式”,但是提交订单的时候,提示错误,“请选择...
在flow.php flow.dwt 和 shopping_flow.js里面都做了些相应的修改,最好的结果的就是不显示“选择配送方式”,但是提交订单的时候,提示错误,“请选择一个配送方式”!求指点下最简单的方法!分不多,求大神指点
是手机版的网页 展开
是手机版的网页 展开
1个回答
展开全部
我这有一个删除配送方式和支付方式的,针对的是默认模板,不同的模板可能会有些不同,你可以参考一下,把下面我方的代码都删掉即可
打开flow.dwt
<div class="flowBox">
<h6><span>{$lang.consignee_info}</span><a
href="flow.php?step=consignee"
class="f6">{$lang.modify}</a></h6>
<table width="99%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
<tr>
<td bgcolor="#ffffff">{$lang.consignee_name}:</td>
<td bgcolor="#ffffff">{$consignee.consignee|escape}</td>
<td bgcolor="#ffffff">{$lang.email_address}:</td>
<td bgcolor="#ffffff">{$consignee.email|escape}</td>
</tr>
<!-- {if $total.real_goods_count gt 0} -->
<tr>
<td bgcolor="#ffffff">{$lang.detailed_address}:</td>
<td bgcolor="#ffffff">{$consignee.address|escape} </td>
<td bgcolor="#ffffff">{$lang.postalcode}:</td>
<td bgcolor="#ffffff">{$consignee.zipcode|escape}</td>
</tr>
<!-- {/if} -->
<tr>
<td bgcolor="#ffffff">{$lang.phone}:</td>
<td bgcolor="#ffffff">{$consignee.tel} </td>
<td bgcolor="#ffffff">{$lang.backup_phone}:</td>
<td bgcolor="#ffffff">{$consignee.mobile|escape}</td>
</tr>
<!-- {if $total.real_goods_count gt 0} -->
<tr>
<td bgcolor="#ffffff">{$lang.sign_building}:</td>
<td bgcolor="#ffffff">{$consignee.sign_building|escape} </td>
<td bgcolor="#ffffff">{$lang.deliver_goods_time}:</td>
<td bgcolor="#ffffff">{$consignee.best_time|escape}</td>
</tr>
<!-- {/if} -->
</table>
</div>
<div class="blank"></div>
<!--{if $total.real_goods_count neq 0}-->
<div class="flowBox">
<h6><span>{$lang.shipping_method}</span></h6>
<table width="99%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" id="shippingTable">
<tr>
<th bgcolor="#ffffff" width="5%"> </th>
<th bgcolor="#ffffff" width="25%">{$lang.name}</th>
<th bgcolor="#ffffff">{$lang.describe}</th>
<th bgcolor="#ffffff" width="15%">{$lang.fee}</th>
<th bgcolor="#ffffff" width="15%">{$lang.free_money}</th>
<th bgcolor="#ffffff" width="15%">{$lang.insure_fee}</th>
</tr>
<!-- {foreach from=$shipping_list item=shipping} 循环配送方式 -->
<tr>
<td bgcolor="#ffffff" valign="top"><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)" />
</td>
<td bgcolor="#ffffff" valign="top"><strong>{$shipping.shipping_name}</strong></td>
<td bgcolor="#ffffff" valign="top">{$shipping.shipping_desc}</td>
<td bgcolor="#ffffff" align="right" valign="top">{$shipping.format_shipping_fee}</td>
<td bgcolor="#ffffff" align="right" valign="top">{$shipping.free_money}</td>
<td bgcolor="#ffffff" align="right"
valign="top">{if $shipping.insure neq
0}{$shipping.insure_formated}{else}{$lang.not_support_insure}{/if}</td>
</tr>
<!-- {/foreach} 循环配送方式 -->
<tr>
<td colspan="6" bgcolor="#ffffff" align="right"><label for="ECS_NEEDINSURE">
<input name="need_insure" id="ECS_NEEDINSURE"
type="checkbox" onclick="selectInsure(this.checked)" value="1" {if
$order.need_insure}checked="true"{/if} {if
$insure_disabled}disabled="true"{/if} />
{$lang.need_insure} </label></td>
</tr>
</table>
</div>
<div class="blank"></div>
<!--{else}-->
<input name = "shipping" type="radio" value = "-1" checked="checked" style="display:none"/>
<!--{/if}-->
<!--{if $is_exchange_goods neq 1 || $total.real_goods_count neq 0}-->
<div class="flowBox">
<h6><span>{$lang.payment_method}</span></h6>
<table width="99%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" id="paymentTable">
<tr>
<th width="5%" bgcolor="#ffffff"> </th>
<th width="20%" bgcolor="#ffffff">{$lang.name}</th>
<th bgcolor="#ffffff">{$lang.describe}</th>
<th bgcolor="#ffffff" width="15%">{$lang.pay_fee}</th>
</tr>
<!-- {foreach from=$payment_list item=payment} -->
<!-- 循环支付方式 -->
<tr>
<td valign="top" bgcolor="#ffffff"><input
type="radio" name="payment" value="{$payment.pay_id}" {if $order.pay_id
eq $payment.pay_id}checked{/if} isCod="{$payment.is_cod}"
onclick="selectPayment(this)" {if $cod_disabled and $payment.is_cod eq
"1"}disabled="true"{/if}/></td>
<td valign="top" bgcolor="#ffffff"><strong>{$payment.pay_name}</strong></td>
<td valign="top" bgcolor="#ffffff">{$payment.pay_desc}</td>
<td align="right" bgcolor="#ffffff" valign="top">{$payment.format_pay_fee}</td>
</tr>
<!-- {/foreach} 循环支付方式 -->
</table>
</div>
<!--{else}-->
<input name = "payment" type="radio" value = "-1" checked="checked" style="display:none"/>
<!--{/if}-->
---------------------------------------------------------------------------
2、然后删除 JS 文件里的相关函数
打开 /js/shopping_flow.js 文件,将下面代码删除
---------------------------------------------------------------------------
var paymentSelected = false;
var shippingSelected = false;
// 检查是否选择了支付配送方式
for (i = 0; i < frm.elements.length; i ++ )
{
if (frm.elements[i].name == 'shipping' && frm.elements[i].checked)
{
shippingSelected = true;
}
if (frm.elements[i].name == 'payment' && frm.elements[i].checked)
{
paymentSelected = true;
}
}
if ( ! shippingSelected)
{
alert(flow_no_shipping);
return false;
}
if ( ! paymentSelected)
{
alert(flow_no_payment);
return false;
}
---------------------------------------------------------------------------
3、最后一步要删除 ECSHOP程序文件里的相关代码
打开 /flow.php 文件,找到下面代码,将之删除或者注释掉
--------------------------------------------------------------------------
/* 取得支付信息,生成支付代码 */
if ($order['order_amount'] > 0)
{
$payment = payment_info($order['pay_id']);
include_once('includes/modules/payment/' . $payment['pay_code'] . '.php');
$pay_obj = new $payment['pay_code'];
$pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));
$order['pay_desc'] = $payment['pay_desc'];
$smarty->assign('pay_online', $pay_online);
}
打开flow.dwt
<div class="flowBox">
<h6><span>{$lang.consignee_info}</span><a
href="flow.php?step=consignee"
class="f6">{$lang.modify}</a></h6>
<table width="99%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
<tr>
<td bgcolor="#ffffff">{$lang.consignee_name}:</td>
<td bgcolor="#ffffff">{$consignee.consignee|escape}</td>
<td bgcolor="#ffffff">{$lang.email_address}:</td>
<td bgcolor="#ffffff">{$consignee.email|escape}</td>
</tr>
<!-- {if $total.real_goods_count gt 0} -->
<tr>
<td bgcolor="#ffffff">{$lang.detailed_address}:</td>
<td bgcolor="#ffffff">{$consignee.address|escape} </td>
<td bgcolor="#ffffff">{$lang.postalcode}:</td>
<td bgcolor="#ffffff">{$consignee.zipcode|escape}</td>
</tr>
<!-- {/if} -->
<tr>
<td bgcolor="#ffffff">{$lang.phone}:</td>
<td bgcolor="#ffffff">{$consignee.tel} </td>
<td bgcolor="#ffffff">{$lang.backup_phone}:</td>
<td bgcolor="#ffffff">{$consignee.mobile|escape}</td>
</tr>
<!-- {if $total.real_goods_count gt 0} -->
<tr>
<td bgcolor="#ffffff">{$lang.sign_building}:</td>
<td bgcolor="#ffffff">{$consignee.sign_building|escape} </td>
<td bgcolor="#ffffff">{$lang.deliver_goods_time}:</td>
<td bgcolor="#ffffff">{$consignee.best_time|escape}</td>
</tr>
<!-- {/if} -->
</table>
</div>
<div class="blank"></div>
<!--{if $total.real_goods_count neq 0}-->
<div class="flowBox">
<h6><span>{$lang.shipping_method}</span></h6>
<table width="99%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" id="shippingTable">
<tr>
<th bgcolor="#ffffff" width="5%"> </th>
<th bgcolor="#ffffff" width="25%">{$lang.name}</th>
<th bgcolor="#ffffff">{$lang.describe}</th>
<th bgcolor="#ffffff" width="15%">{$lang.fee}</th>
<th bgcolor="#ffffff" width="15%">{$lang.free_money}</th>
<th bgcolor="#ffffff" width="15%">{$lang.insure_fee}</th>
</tr>
<!-- {foreach from=$shipping_list item=shipping} 循环配送方式 -->
<tr>
<td bgcolor="#ffffff" valign="top"><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)" />
</td>
<td bgcolor="#ffffff" valign="top"><strong>{$shipping.shipping_name}</strong></td>
<td bgcolor="#ffffff" valign="top">{$shipping.shipping_desc}</td>
<td bgcolor="#ffffff" align="right" valign="top">{$shipping.format_shipping_fee}</td>
<td bgcolor="#ffffff" align="right" valign="top">{$shipping.free_money}</td>
<td bgcolor="#ffffff" align="right"
valign="top">{if $shipping.insure neq
0}{$shipping.insure_formated}{else}{$lang.not_support_insure}{/if}</td>
</tr>
<!-- {/foreach} 循环配送方式 -->
<tr>
<td colspan="6" bgcolor="#ffffff" align="right"><label for="ECS_NEEDINSURE">
<input name="need_insure" id="ECS_NEEDINSURE"
type="checkbox" onclick="selectInsure(this.checked)" value="1" {if
$order.need_insure}checked="true"{/if} {if
$insure_disabled}disabled="true"{/if} />
{$lang.need_insure} </label></td>
</tr>
</table>
</div>
<div class="blank"></div>
<!--{else}-->
<input name = "shipping" type="radio" value = "-1" checked="checked" style="display:none"/>
<!--{/if}-->
<!--{if $is_exchange_goods neq 1 || $total.real_goods_count neq 0}-->
<div class="flowBox">
<h6><span>{$lang.payment_method}</span></h6>
<table width="99%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" id="paymentTable">
<tr>
<th width="5%" bgcolor="#ffffff"> </th>
<th width="20%" bgcolor="#ffffff">{$lang.name}</th>
<th bgcolor="#ffffff">{$lang.describe}</th>
<th bgcolor="#ffffff" width="15%">{$lang.pay_fee}</th>
</tr>
<!-- {foreach from=$payment_list item=payment} -->
<!-- 循环支付方式 -->
<tr>
<td valign="top" bgcolor="#ffffff"><input
type="radio" name="payment" value="{$payment.pay_id}" {if $order.pay_id
eq $payment.pay_id}checked{/if} isCod="{$payment.is_cod}"
onclick="selectPayment(this)" {if $cod_disabled and $payment.is_cod eq
"1"}disabled="true"{/if}/></td>
<td valign="top" bgcolor="#ffffff"><strong>{$payment.pay_name}</strong></td>
<td valign="top" bgcolor="#ffffff">{$payment.pay_desc}</td>
<td align="right" bgcolor="#ffffff" valign="top">{$payment.format_pay_fee}</td>
</tr>
<!-- {/foreach} 循环支付方式 -->
</table>
</div>
<!--{else}-->
<input name = "payment" type="radio" value = "-1" checked="checked" style="display:none"/>
<!--{/if}-->
---------------------------------------------------------------------------
2、然后删除 JS 文件里的相关函数
打开 /js/shopping_flow.js 文件,将下面代码删除
---------------------------------------------------------------------------
var paymentSelected = false;
var shippingSelected = false;
// 检查是否选择了支付配送方式
for (i = 0; i < frm.elements.length; i ++ )
{
if (frm.elements[i].name == 'shipping' && frm.elements[i].checked)
{
shippingSelected = true;
}
if (frm.elements[i].name == 'payment' && frm.elements[i].checked)
{
paymentSelected = true;
}
}
if ( ! shippingSelected)
{
alert(flow_no_shipping);
return false;
}
if ( ! paymentSelected)
{
alert(flow_no_payment);
return false;
}
---------------------------------------------------------------------------
3、最后一步要删除 ECSHOP程序文件里的相关代码
打开 /flow.php 文件,找到下面代码,将之删除或者注释掉
--------------------------------------------------------------------------
/* 取得支付信息,生成支付代码 */
if ($order['order_amount'] > 0)
{
$payment = payment_info($order['pay_id']);
include_once('includes/modules/payment/' . $payment['pay_code'] . '.php');
$pay_obj = new $payment['pay_code'];
$pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));
$order['pay_desc'] = $payment['pay_desc'];
$smarty->assign('pay_online', $pay_online);
}
更多追问追答
追问
大哥,这个方法我试过了,不好使。 再更改代码的时候, 有没有需要注意的几点?
追答
手机版的网页模板是在mobile目录下,地方找对了吗
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询