ECSHOP商城的邮费要怎么设置?
3个回答
展开全部
1:ecshop如何设置某个商品免除运费。
后台=>商品列表=>其他信息=》选择免运费情况。如果该商品勾选上了。则该商品在购买的时候,不会产生运费。
2:如果计算ecshop的商品免除运费。
includes/lib_order.php的order_fee()函数。
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0";
$shipping_count = $GLOBALS['db']->getOne($sql);
$total['shipping_fee'] = ($shipping_count == 0 AND $weight_price['free_shipping'] == 1) ?0 : shipping_fee($shipping_info['shipping_code'],$shipping_info['configure'], $weight_price['weight'], $total['goods_price'], $weight_price['number']);
在你购买的时候,他首先检测该商品是否免除运费如果该商品免除运费的话,他就直接可以免除运费,但是有个缺点,如果该商品和其他不免除运费的商品一起购买的话,他就产生运费了。结构很简单。shipping_count == 0 AND $weight_price['free_shipping'] == 1,这里已经表示很明确了。
正常的ecshop购买流程应该是这样的。就是如果ecshop的购买流程里面,只要有一个商品是免除运费的,那么所有的商品都应该是免除运费的。
我们可以按照下面函数来处理运费的过程。
function has_free(){
global $db;
global $ecs;
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` = 'package_buy'";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
$sql = 'SELECT goods_id from ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code`= 'package_buy'";
$ids = $db->getCol($sql);
if($ids){
foreach($ids as $k => $v){
$sql2 = "select g.is_shipping from ".$ecs->table('package_goods')." p , ".$ecs->table('goods')." g where g.goods_id = p.goods_id and p.package_id = $v";
$res = $db->getCol($sql2);
if(in_array(1,$res)){
$tsing = 1;
continue;
}
}
if($tsing ==1){
return 1;
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
return 0;
}
}else{
return 0;
}
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
}
return 0;
}
后台=>商品列表=>其他信息=》选择免运费情况。如果该商品勾选上了。则该商品在购买的时候,不会产生运费。
2:如果计算ecshop的商品免除运费。
includes/lib_order.php的order_fee()函数。
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0";
$shipping_count = $GLOBALS['db']->getOne($sql);
$total['shipping_fee'] = ($shipping_count == 0 AND $weight_price['free_shipping'] == 1) ?0 : shipping_fee($shipping_info['shipping_code'],$shipping_info['configure'], $weight_price['weight'], $total['goods_price'], $weight_price['number']);
在你购买的时候,他首先检测该商品是否免除运费如果该商品免除运费的话,他就直接可以免除运费,但是有个缺点,如果该商品和其他不免除运费的商品一起购买的话,他就产生运费了。结构很简单。shipping_count == 0 AND $weight_price['free_shipping'] == 1,这里已经表示很明确了。
正常的ecshop购买流程应该是这样的。就是如果ecshop的购买流程里面,只要有一个商品是免除运费的,那么所有的商品都应该是免除运费的。
我们可以按照下面函数来处理运费的过程。
function has_free(){
global $db;
global $ecs;
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` = 'package_buy'";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
$sql = 'SELECT goods_id from ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code`= 'package_buy'";
$ids = $db->getCol($sql);
if($ids){
foreach($ids as $k => $v){
$sql2 = "select g.is_shipping from ".$ecs->table('package_goods')." p , ".$ecs->table('goods')." g where g.goods_id = p.goods_id and p.package_id = $v";
$res = $db->getCol($sql2);
if(in_array(1,$res)){
$tsing = 1;
continue;
}
}
if($tsing ==1){
return 1;
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
return 0;
}
}else{
return 0;
}
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
}
return 0;
}
展开全部
1:ecshop如何设置某个商品免除运费。
后台=>商品列表=>其他信息=》选择免运费情况。如果该商品勾选上了。则该商品在购买的时候,不会产生运费。
2:如果计算ecshop的商品免除运费。
includes/lib_order.php的order_fee()函数。
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0";
$shipping_count = $GLOBALS['db']->getOne($sql);
$total['shipping_fee'] = ($shipping_count == 0 AND $weight_price['free_shipping'] == 1) ?0 : shipping_fee($shipping_info['shipping_code'],$shipping_info['configure'], $weight_price['weight'], $total['goods_price'], $weight_price['number']);
在你购买的时候,他首先检测该商品是否免除运费如果该商品免除运费的话,他就直接可以免除运费,但是有个缺点,如果该商品和其他不免除运费的商品一起购买的话,他就产生运费了。结构很简单。shipping_count == 0 AND $weight_price['free_shipping'] == 1,这里已经表示很明确了。
正常的ecshop购买流程应该是这样的。就是如果ecshop的购买流程里面,只要有一个商品是免除运费的,那么所有的商品都应该是免除运费的。
我们可以按照下面函数来处理运费的过程。
function has_free(){
global $db;
global $ecs;
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` = 'package_buy'";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
$sql = 'SELECT goods_id from ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code`= 'package_buy'";
$ids = $db->getCol($sql);
if($ids){
foreach($ids as $k => $v){
$sql2 = "select g.is_shipping from ".$ecs->table('package_goods')." p , ".$ecs->table('goods')." g where g.goods_id = p.goods_id and p.package_id = $v";
$res = $db->getCol($sql2);
if(in_array(1,$res)){
$tsing = 1;
continue;
}
}
if($tsing ==1){
return 1;
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
return 0;
}
}else{
return 0;
}
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
}
return 0;
}
后台=>商品列表=>其他信息=》选择免运费情况。如果该商品勾选上了。则该商品在购买的时候,不会产生运费。
2:如果计算ecshop的商品免除运费。
includes/lib_order.php的order_fee()函数。
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 0";
$shipping_count = $GLOBALS['db']->getOne($sql);
$total['shipping_fee'] = ($shipping_count == 0 AND $weight_price['free_shipping'] == 1) ?0 : shipping_fee($shipping_info['shipping_code'],$shipping_info['configure'], $weight_price['weight'], $total['goods_price'], $weight_price['number']);
在你购买的时候,他首先检测该商品是否免除运费如果该商品免除运费的话,他就直接可以免除运费,但是有个缺点,如果该商品和其他不免除运费的商品一起购买的话,他就产生运费了。结构很简单。shipping_count == 0 AND $weight_price['free_shipping'] == 1,这里已经表示很明确了。
正常的ecshop购买流程应该是这样的。就是如果ecshop的购买流程里面,只要有一个商品是免除运费的,那么所有的商品都应该是免除运费的。
我们可以按照下面函数来处理运费的过程。
function has_free(){
global $db;
global $ecs;
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` = 'package_buy'";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
$sql = 'SELECT goods_id from ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code`= 'package_buy'";
$ids = $db->getCol($sql);
if($ids){
foreach($ids as $k => $v){
$sql2 = "select g.is_shipping from ".$ecs->table('package_goods')." p , ".$ecs->table('goods')." g where g.goods_id = p.goods_id and p.package_id = $v";
$res = $db->getCol($sql2);
if(in_array(1,$res)){
$tsing = 1;
continue;
}
}
if($tsing ==1){
return 1;
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
return 0;
}
}else{
return 0;
}
}else{
$sql = 'SELECT count(*) FROM ' . $GLOBALS['ecs']->table('cart') . " WHERE `session_id` = '" . SESS_ID. "' AND `extension_code` != 'package_buy' AND `is_shipping` = 1";
$shipping_count = $GLOBALS['db']->getOne($sql);
if($shipping_count){
return 1;
}
}
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
后台促销活动里面可以设置促销产品,再设置促销活动,免邮费之类的就行。
追问
不好意思想问下具体要怎么设置。因为我在后台的促销管理没有找到适合的。我刚刚看到商品可以设置为免邮费。但是我想设成特价商品首重免邮费,续重就要钱。
参考资料: ecshop模板堂
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询