Jump to content

Commerce: require an account to purchase (checkout)


Go to solution Solved by Jim M,

Recommended Posts

3 minutes ago, Adriano Faria said:

They can’t download:

FF4B7B71-D7C6-4D8D-9310-602522CB2EF9.thumb.jpeg.bb71dc3379e33237ce09d0ba13c3fcaf.jpeg

But the BUY button still shows up:

65141125-E052-4846-B569-E2E23FDB99C5.jpeg.51188279945c1adf99e31080e0a7dce1.jpeg

And consequently the checkout process:

FDC13EB2-8F89-48C9-B9DD-8BA97F07C745.thumb.png.87106440d5858e1bd9813dfbea7eb2ae.png

Clear cache if you just made the change. Check third party add-ons which may be influencing it 🙂 

Link to comment
Share on other sites

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 by Adriano Faria
Link to comment
Share on other sites

  • 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...