Before I dug into this, wanted to see if anyone had any out of the box tricks to specify more than one price_group to display on the signup and member page? To preselect multiple products it is easy: Code: amember/signup.php?price_group=1&product_id[]=1&product_id[]=2 But the price_group equivalent displays a blank list: Code: amember/signup.php?price_group[]=1&price_group[]=2 Any suggestions / ideas or is this a core code change to accomplish?
Code in signup and member pages should be changed. For example here is how currently aMember check price group: Code: if ($vars['price_group']){ if (!in_array($vars['price_group'], split(',',$v['price_group'])) ) unset($products[$k]); } elseif ($v['price_group'] < 0){ unset($products[$k]); } this is from signup.php
Thanks Alexander. Found that, it is just not very evident where and how the foreach loop should be implemented to append the products list. Any assistance would be appreciated. Also, is there any technical reason this was not implemented as a core option similar to how the multiple product_id capability was? (want to make sure there is not a security, or other, issue that this introduces that is not evident)
I believe this should work: Code: if(is_array($vars['price_group'])){ if(!array_inresect($vars['price_group'], split(',',$v['price_group']))) unset($products[$k]); }elseif ($vars['price_group']){ if (!in_array($vars['price_group'], split(',',$v['price_group'])) ) unset($products[$k]); } elseif ($v['price_group'] < 0){ unset($products[$k]); } to make such urls possible: Code: amember/signup.php?price_group[]=1&price_group[]=2
This worked perfect with one small typo change highlighted below: Can I recommend that this change be added into the core code (for signup.php and member.php) so that it is included in future releases. I suspect this is a feature that a number of aMember admins would appreciate.
this modification doesn't seem to work in 3.2.3 anymore... at least it doesn't on member.php renewal tab page...