View Single Post
  #4  
Old 10-22-2012, 01:07 PM
 
dtgmap dtgmap is offline
 

Member
  
Join Date: Mar 2012
Posts: 26
 

Default 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:
if ($config['Shipping']['free_shipping_allowed_method'] == $shipping_id && $user_account['membership'] == 'Friends'){ $shipping_cost = 0; }


BEFORE


Code:
$display_shipping_cost = $shipping_cost; if ( $calculate_enable_flag && !( @$customer_info['tax_exempt'] == 'Y' && ( $config['Taxes']['enable_user_tax_exemption'] == 'Y' || defined('XAOM') ) ) ) { // Calculate taxes cost


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
Reply With Quote