Adriano Faria Posted August 19, 2021 Posted August 19, 2021 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.
Jim M Posted August 19, 2021 Posted August 19, 2021 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.
Adriano Faria Posted August 19, 2021 Author Posted August 19, 2021 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:
Jim M Posted August 19, 2021 Posted August 19, 2021 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 🙂
Adriano Faria Posted August 19, 2021 Author Posted August 19, 2021 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. Jim M 1
Adriano Faria Posted August 19, 2021 Author Posted August 19, 2021 (edited) 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, 2021 by Adriano Faria
Solution Jim M Posted August 19, 2021 Solution Posted August 19, 2021 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.
Adriano Faria Posted August 19, 2021 Author Posted August 19, 2021 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.
Adriano Faria Posted August 19, 2021 Author Posted August 19, 2021 6 minutes ago, Adriano Faria said: I'll probably hook into canBuy(). That did it: Thanks, @Jim M. 👍
Recommended Posts