| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Free shipping by membership level | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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 |
|||||||
|
#2
|
|||||||||
|
|||||||||
Re: Free shipping by membership level
Is there a way to offer certain shipping methods based on membership level? We need one of our wholesale customers to be able to choose UPS Ground or Next Day Air but both of them being zero cost to them. We will be shipping using their UPS account so we don't charge them for shipping. I made 2 new shipping methods for them called:
Company Name UPS Ground Company Name UPS Next Day Air The problem is, I don't want other customers to be able to use those shipping methods because as I mentioned earlier, they are free. Do you know of a way for us to accomplish this?
__________________
version 4.4.2 |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Free shipping by membership level
Actually... since their shipping would always be free would the above method work for what I'm trying to do? Could they still select UPS Ground or Next Day Air and just not be charged for it but regular customers would be charged the normal amount?
__________________
version 4.4.2 |
|||||||||
#4
|
|||||||
|
|||||||
Re: Free shipping by membership level
I finally figured this out after combining info from these 2 posts:
http://forum.x-cart.com/showthread.php?t=9081&highlight=shippingid http://forum.x-cart.com/showthread.php?t=60983 1) Create an entry in xcart_config that has the following values: name: free_shipping_allowed_method comment: FREE SHIPPING ALLOWED METHOD Give free shipping on a certain shipping method (Example: FedEx Ground is 43) value: 0 category: Shipping orderby: 4 type: text defvalue: 0 2) In include/func/func.cart.php, insert this code: Code:
BEFORE Code:
3) Go into the x-cart admin, under Shipping Options, and set your shipping method (This number will be the shippingid in the xcart_shipping table) If you have any questions, there is valuable info in the 2 posts I referenced, such as applying to multiple shipping methods. Note: This code change may affect your coupons. I don't currently have any set up, so I haven't tested it yet, but one of the posts addresses this scenario.
__________________
X-Cart v4.4.5 ********* Power Filter BCSE Refer-A-Friend BCSE Auth.Net DPM/CIM |
|||||||
|
|||
X-Cart forums © 2001-2020
|