View Single Post
  #10  
Old 06-09-2013, 12:03 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Automatic Membership Level

I wanted a similar function for my 4.5.4 store.

-- new registered customers need to be assigned to the points program (membershipid '1') - and doing this manually was not only time consuming, it prevented points from accruing if the customer made a purchase right away...

This simply requires 2 edits:

1. Using the code provided by Alex Solovev from Qualiteam in this post:

http://forum.x-cart.com/showpost.php?p=308148&postcount=6

2. Edit file, /skin/common_files/customer/main/register_account.tpl

FIND:
Code:
{if $userinfo.id eq $logged_userid and $logged_userid gt 0 and $userinfo.usertype ne "C"} <tr style="display: none;"> <td> <input type="hidden" name="membershipid" value="{$userinfo.membershipid}" /> <input type="hidden" name="pending_membershipid" value="{$userinfo.pending_membershipid}" /> </td> </tr> {else} {if $config.General.membership_signup eq "Y" and ($usertype eq "C" or $is_admin_user or $usertype eq "B") and $membership_levels} {include file="customer/main/membership_signup.tpl"} {/if} {/if}

and comment it all out.
INSERT this in its place:
Code:
<input type="hidden" name="membershipid" value="1" /> <input type="hidden" name="pending_membershipid" value="1" />

Obviously, your value may not = "1" -- this was the membershipid for my membership level. Also, having form fields for $membership_levels if $membership_levels is disabled will probably be bad... you can put some ifs on this if you really need to, but if you are always going to have $membership_levels, then no need.

The code that was commented out basically bypasses the general setting ({if $config.General.membership_signup eq "Y") and the new code basically sets membershipid to 1 and also pending_membershipid to 1, and then the php does the rest.

Works great. This should have been an option all along -- (set new memberships to a default membership level")

Thanks to all who contributed to these ideas in the forum.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote