Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted August 19, 20213 yr How do I disable guests to be able to purchase in Downloads? They can register via checkout and I need to disallow that. I remember a setting somewhere but can’t find it. Thank you.
August 19, 20213 yr You would need to disable Guests permissions to download the file in the Downloads category. They then would receive a message to sign in rather than the "Buy" button.
August 19, 20213 yr Author 3 minutes ago, Jim M said: You would need to disable Guests permissions to download the file in the Downloads category. They then would receive a message to sign in rather than the "Buy" button. They can’t download: But the BUY button still shows up: And consequently the checkout process:
August 19, 20213 yr 3 minutes ago, Adriano Faria said: They can’t download: But the BUY button still shows up: And consequently the checkout process: Clear cache if you just made the change. Check third party add-ons which may be influencing it 🙂
August 19, 20213 yr Author Disabled all 3rd-party stuff and still the same. I’ll try to reproduce in a fresh install and will submit a ticket if it insists. Thank you, @Jim M.
August 19, 20213 yr Author 1 hour ago, Jim M said: You would need to disable Guests permissions to download the file in the Downloads category. They then would receive a message to sign in rather than the "Buy" button. Jim, that's right except for the group: /* Basic permission check */ if ( !$this->container()->can( 'download', $member ) ) { /* Hold on - if we're a guest and buying means we'll have to register which will put us in a group with permission, we can continue */ if ( $member->member_id or !$this->container()->can( 'download', \IPS\Member\Group::load( \IPS\Settings::i()->member_group ) ) ) { return FALSE; } } It is checking the MEMBER group: \IPS\Member\Group::load( \IPS\Settings::i()->member_group ). While that works and do not display the BUY button to Guests, it also disallow MEMBERS to download/buy! It doesn't has something specific to Guests. Should I report as a bug? Edited August 19, 20213 yr by Adriano Faria
August 19, 20213 yr Solution 28 minutes ago, Adriano Faria said: Jim, that's right except for the group: /* Basic permission check */ if ( !$this->container()->can( 'download', $member ) ) { /* Hold on - if we're a guest and buying means we'll have to register which will put us in a group with permission, we can continue */ if ( $member->member_id or !$this->container()->can( 'download', \IPS\Member\Group::load( \IPS\Settings::i()->member_group ) ) ) { return FALSE; } } It is checking the MEMBER group: \IPS\Member\Group::load( \IPS\Settings::i()->member_group ). While that works and do not display the BUY button to Guests, it also disallow MEMBERS to download/buy! It doesn't has something specific to Guests. Should I report as a bug? Gotcha. Now that I also allow my base member group to download (I had an upper group but not the base member), I see what you mean. In normal operation though, I would imagine users would want to encourage their guests to register to download. If you don't want people to register, I'd advising disabling registration. I don't think this a bug but rather a change in the feature which you'll want to suggest.
August 19, 20213 yr Author Registration was disabled. I'm doing this to enable it again. So I installed the Invite System so no one can purchase, except people that I invite (to avoid piracy). Happens that they can go directly to file and purchase it from there via new account in checkout. That's what I'm trying to avoid. I'll probably hook into canBuy(). Thanks.
August 19, 20213 yr Author 6 minutes ago, Adriano Faria said: I'll probably hook into canBuy(). That did it: Thanks, @Jim M. 👍