I added a new field called accountnumber, and I added it to the profile page. I only want it to show to users that have an active subscription though, how do I do this?
No way out of the box. Would be good to have an option to allow display if active in X membership- will put the request in the tracker. David
I used to use this in an old version of amember in the profile.html template file that worked perfectly... HTML: {if $smarty.session._amember_products} {$additional_fields_html} {else} <tr> <th>Account Number</th> <td>You must have an active subscription to use this feature!</td> </tr> {/if}
PHP: if ($member_products) This will work but I can't figure out where to put it for additional fields... Any help?
Sweet I figured it out on my own. I edited brick.php around line 1142 doing this PHP: function insertBrick(HTML_QuickForm2_Container $form) { $ifActive = Am_Lite::getInstance()->haveSubscriptions(1); if ($ifActive==false) { } else { $el = $this->field->addToQF2($form); if ($this->getConfig('disabled')) $el->toggleFrozen(true); } }
Hmm how would I modify this if I have 2 custom fields and I want to show field 1 if haveSubscriptions(1) or show both custom fields if haveSubscriptions(4);
Nevermind I finally figured it out using strpos to look for an instace in the field name to decide if I want to display it or not if havesubscription