Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Not allow registered customer to change membership in account details tab

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-09-2017, 12:53 AM
 
williamteh williamteh is offline
 

Advanced Member
  
Join Date: Jan 2008
Posts: 41
 

Question Not allow registered customer to change membership in account details tab

I do not want registered customer to change their membership level in their customer details tab (where is this template / .tpl located?)

He/she can only VIEW / Read only and cannot edit / change membership level in their account tab.

Can anyone out there helps?!
__________________
X-Cart V5.3.4.5 (Multivendor)
Apache 2.4.18 (Ubuntu)
Mysql 5.7.21
PHP 7.1.5
Reply With Quote
  #2  
Old 03-13-2017, 03:58 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Not allow registered customer to change membership in account details tab

You should disable the "Enable sign-up for membership" setting:
https://help.x-cart.com/index.php?title=X-Cart:User_Memberships
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 03-13-2017, 07:24 PM
 
williamteh williamteh is offline
 

Advanced Member
  
Join Date: Jan 2008
Posts: 41
 

Default Re: Not allow registered customer to change membership in account details tab

Quote:
Originally Posted by qualiteam
You should disable the "Enable sign-up for membership" setting:
https://help.x-cart.com/index.php?title=X-Cart:User_Memberships

I would like them to sign-up membership, but I just do not allow them to edit/change it in their account details tab, they can only "read only".

How to apply this using If statement?
__________________
X-Cart V5.3.4.5 (Multivendor)
Apache 2.4.18 (Ubuntu)
Mysql 5.7.21
PHP 7.1.5
Reply With Quote
  #4  
Old 03-14-2017, 02:07 AM
 
ITVV ITVV is online now
 

X-Wizard
  
Join Date: Nov 2006
Location: UK
Posts: 1,164
 

Default Re: Not allow registered customer to change membership in account details tab

Hi,

In Admin go to TOOLS > PATCH/UPGRADE > APPLY SQL PATCH

Paste the code below into the "SQL query(ies):" box and click APPLY: -

Code:
INSERT INTO `xcart_languages` (`code`, `name`, `value`, `topic`) VALUES ('en', 'lbl_assigned_membership', 'Assigned membership', 'Labels');

Now in SKIN > COMMON_FILES > CUSTOMER > MAIN > MEMBERSHIP_SIGNUP.TPL

FIND THIS BLOCK OF CODE: -

Code:
<tr> <td class="data-name">{$lng.lbl_signup_for_membership}</td> <td></td> <td> <select name="pending_membershipid"> <option value="0">{$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> </td> </tr>

REPLACE THE ABOVE BLOCK OF CODE WITH: -

Code:
{* START Membership Level Change by ITVV *} {* <tr> <td class="data-name">{$lng.lbl_signup_for_membership}</td> <td></td> <td> <select name="pending_membershipid"> <option value="0">{$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> </td> </tr> *} {if $userinfo.membershipid gt "0" and $userinfo.usertype eq "C"} <tr> <td class="data-name">{$lng.lbl_assigned_membership}</td> <td></td> <td> <input type="text" name="membership_level" size="32" maxlength="128" value="{$userinfo.membership}" disabled/> </td> </tr> {else} <tr> <td class="data-name">{$lng.lbl_signup_for_membership}</td> <td></td> <td> <select name="pending_membershipid"> <option value="0">{$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> </td> </tr> {/if} {* END Membership Level Change by ITVV *}

NOW in Admin go to TOOLS > MAINTENANCE > CLEAR TEMPLATES/X-CART CACHE > CLEAR

You *should* now have what you want?

Kind regards

ITVV
__________________
X-Cart Pro 4.7.12 Active and working great with reBOOT-reDUX
X-Cart Pro 4.6.6 Retired after 6 years of first class service
X-Cart Pro 4.1.7 Retired after 9 years of first class service

Apache: 2.4.25
PHP: 7.4.5
MariaDB: 10.1.44
Arch: x86_64
Reply With Quote

The following user thanks ITVV for this useful post:
qualiteam (03-14-2017)
  #5  
Old 03-14-2017, 04:47 AM
 
williamteh williamteh is offline
 

Advanced Member
  
Join Date: Jan 2008
Posts: 41
 

Default Re: Not allow registered customer to change membership in account details tab

It works ! Thank you so much !

Btw, before your replied, I also managed to resolved it (but I still prefer your way)...and this is what I did.

<tr>
<td class="data-name">{$lng.lbl_signup_for_membership}</td>
<td></td>
<td>
{if $login eq ""}
<select name="pending_membershipid">
<option value="0">{$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>
{elseif $login ne "" && $usertype.login eq "C"}
<select name="pending_membershipid">
<option value="0">{$lng.lbl_not_member}</option>
{foreach from=$membership_levels item=v}
<option disabled value="{$v.membershipid}"{if $userinfo.pending_membershipid eq $v.membershipid} selected="selected"{/if}>{$v.membership}</option>
{/foreach}
</select>
{/if}
</td>
</tr>

__________________
X-Cart V5.3.4.5 (Multivendor)
Apache 2.4.18 (Ubuntu)
Mysql 5.7.21
PHP 7.1.5
Reply With Quote

The following 2 users thank williamteh for this useful post:
ITVV (03-14-2017), qualiteam (03-14-2017)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:42 AM.

   

 
X-Cart forums © 2001-2020