Free shipping by membership level
For Version 4.4.2
This only determines if a customer gets free shipping or not based on membership level.
It cannot determine what the shipping method is or exactly how much.
/************************************ In this location *********************************/
in "XCart\include\func\func.cart.php" at approximately line 1546
in function "func_calculate_shippings" after;
/************************************ After this code **********************************/
foreach($products as $k => $product) {
if (@$product['deleted']) continue; // for Advanced_Order_Management module
if (
!empty($active_modules['Egoods'])
&& $product['distribution'] != ''
) {
continue;
}
/***************************** Shipping by membership mod ******************************/
global $user_account;
if (!empty($user_account['membership'])
&& ($user_account['membership'] == 'Family' || $user_account['membership'] == 'Friends'))
{
$product['free_shipping'] = 'Y';
}
/************************************ Before this code **********************************/
// Calculate total_cost and total_weight for selection condition
if (
$product['free_shipping'] != 'Y'
|| $config['Shipping']['free_shipping_weight_select'] == 'Y'
) {
$total_cost['valid']['DST'] += $product['subtotal'];
$total_cost['valid']['ST'] += price_format($product['price'] * $product['amount']);
$total_weight['valid'] += $product['weight'] * $product['amount'];
}
/************************************************** *************************************/
__________________
X-Cart 4.4.2, Linux, Apache 2, Nginx/Varnish, PHP 5.2.12
|