Two questions 1) Is there a way to display the number of active subscriptions for a given subscription? Say for example I would like to display the following Active Subscriptions 5 - Social- Lifetime 3 - Small Business - Lifetime http://screencast.com/t/OVkBgupdTGVq 2) Is there a way to have a custom field, or many custom fields PER subscription. Thanks dave
1. Here is how you can get number of active users who have product subscribed. PHP: Am_Di::getInstance()->getDbService()->selectCell("select count(distinct(user_id)) from ?_access where product_id = ? and begin_date <= now() and expire_date>=now()", 1); Where 1 is product id 2. Possible in php only. What exactly you need to implement?
Hi Alexander, I'm sorry I wasn't clear on the request. I have a situation where I can have a customer purchase more then one quantity of a given subscription. eg: user1 5 of subscription1 2 of subscription2 3 of subscription3 etc... What I would like to do is find out how many of a given subscription a particular users would have. So the question would be How any of subscription2 does user1 have? Thanks Dave
To add Currently this view is not showing all active subscriptions. It is not showing the duplicate subscriptions http://screencast.com/t/pcEh4g1F6Cbv There should be one more GloBox Member subscription like this http://screencast.com/t/2EMuAwimG8m0 Dave
I would like this option too! Is there anything we can modify to do this? I have single users with multiple subscriptions for a single software item. It would be nice if we could display in Active Resources how many of each they have.
Do you mean you want to show qty with Active Subscription widget? You can do the following: With this code snippet within site.php file: https://www.amember.com/docs/Site.php_file/ PHP: Am_Di::getInstance()->blocks->add('member/main/bottom', new Am_Block_Base(null, 'item-qty', null, function(Am_View $v) { $di = Am_Di::getInstance(); $user = $di->user; $_ = $user->getActiveProductIds(); $out = []; foreach ($_ as $pid) { $qty = $di->db->selectCell(<<<CUT SELECT SUM(qty) FROM ?_access WHERE user_id = ? AND product_id = ? AND begin_date<=? AND expire_date>=?CUT , $user->pk(), $pid, sqlDate('now'), sqlDate('now') ); if ($qty > 1) { $out[] = " jQuery('#member-subscriptions #product-item-{$pid} .am-list-subscriptions-title strong').after(' ({$qty})');"; } } if ($out) { $out = implode("\n", $out); return <<<CUT<script>jQuery(function(){{$out}});</script>CUT; }}));