X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   4.4.5 Default Membership Level (https://forum.x-cart.com/showthread.php?t=63385)

Duramax 6.6L 04-23-2012 05:52 PM

4.4.5 Default Membership Level
 
I would like to assign a default membership level that is assigned when a customer creates an account. Below is the code that needs to be modified I beleive, but if I change anything in the code to make it hidden with the membership level I would like to use it breaks the page.

{if $config.General.membership_signup eq "Y" and $membership_levels}
<li class="single-field">
{capture name=regfield}
<select name="pending_membershipid" id="pending_membershipid">
{*<option value="">{$lng.lbl_not_member}</option>*}
{foreach from=$membership_levels item=v}
<option value="{$v.membershipid}"{if $userinfo.pending_membershipid eq $v.membershipid} selected="selected"{/if}>{$v.membership}</option>
{/foreach}
</select>
{/capture}
{include file="modules/One_Page_Checkout/opc_form_field.tpl" content=$smarty.capture.regfield name=$lng.lbl_signup_for_membership field='pending_membershipid'}
</li>
{/if}

I tried to use this peice of code and comment out the whole block, but it breaks the page.

<input type="hidden" name="pending_membership" value="Premium" />

Could some one please post the exact code to make this work.

Thank you for your help in advance.

Frank

cflsystems 04-23-2012 09:23 PM

Re: 4.4.5 Default Membership Level
 
First of all you have to use the membershipid in the hidden field not the memberhsip name.
Second you can't have smarty comments inside smarty comments; when you comment out the code you have inside it the non-member option commented out as well

Duramax 6.6L 04-24-2012 06:21 PM

Re: 4.4.5 Default Membership Level
 
Thank you Steve for your help!

By commenting out the entire block and using the following code I was able to get the membership level saved as pending.

<input type="hidden" name="pending_membershipid" value="1" />

I have been trying to change the code to save the membership level as the actual membership level with out having to approve it.

Any ideas on how to code that in. I tried adding the following code with no luck.

<input type="hidden" name="membershipid" value="1" />


All times are GMT -8. The time now is 11:28 PM.

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