X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Separate shipping charge for Wholesale membership (https://forum.x-cart.com/showthread.php?t=74953)

galoadm 02-02-2017 01:34 PM

Separate shipping charge for Wholesale membership
 
I would like to have a regular shipping charge of $6.95 for non-members and a charge of $8.95 for Wholesale members. I only want one charge to display at checkout depending on which membership. I have set up a shipping method for each charge and used the webmaster mode to determine the shippingid's and membershipid's. I edited the One_Page_Checkout/shipping_methods.tpl with the following code:

Code:

{if $userinfo.membershipid eq "2" and $s.shippingid eq 1011}
  <tr>&nbsp;</tr>
{elseif $userinfo.membershipid ne "2" and $s.shippingid eq 1013}
<tr>&nbsp;</tr>
{else}
The Original code
{/if}


Just below:

Code:

{foreach from=$shipping item=s name=sm}

This has removed any shipping options from displaying at checkout that do not apply to the particular Membership. The problem I am running into is when the $8.95 option displays for Wholesale customers it is not updating the shipping charge in the Cart Summary which shows $6.95 or preselect the 8.95 shipping option.

Any ideas on how to change the $cart.shippingid from 1011 to 1013 and preselect the $8.95 option when a Wholesale member is checking out?

X-Cart 4.6.0 using One Page Checkout

cherie 02-02-2017 04:27 PM

Re: Separate shipping charge for Wholesale membership
 
Making this change in the tpl is probably going to be more difficult. We added to the following to func_is_shipping_method_allowable() in include/func/func.shipping.php (after globals):
PHP Code:

if (
    (
$customer_info['membershipid'] == && $shippingid == 1013)
    || (
$customer_info['membershipid'] != && $shippingid == 1011)
)
    return 
false


galoadm 02-03-2017 07:10 AM

Re: Separate shipping charge for Wholesale membership
 
Thank you Cherie! That worked perfectly.


All times are GMT -8. The time now is 09:11 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.