samnabi / shopkit

Comprehensive commerce solution for Kirby CMS v2
https://shopkit.samnabi.com
Other
99 stars 15 forks source link

Allow only logged users. #171

Closed guidoferreyra closed 7 years ago

guidoferreyra commented 7 years ago

Sorry for this silly question, but I can’t find where to set that only logged users can buy products. Best.

samnabi commented 7 years ago

This isn't possible currently. If you restrict purchases to only those who are logged-in, you will also have to introduce a approval process when they register.

What kind of approval process do you need?

guidoferreyra commented 7 years ago

Approval process? I don't understand.

I think I achieved what I want adding the following in the cart template <?php if ($site->user()): ?> So if the user is logged it displays the gateways, but if not it displays a login for. So far all works fine Now I I'm in the process of adding a register form.

I’m in the right path?

samnabi commented 7 years ago

There is already a registration form in Shopkit. (domain.com/account/register)

Anyone can register. So if you restrict pages to logged-in users, you're really not restricting anything – anyone can make an account and log in.

guidoferreyra commented 7 years ago

Yes im reusing the register form. Yes, I only want to restrict anonymous purchases, I want to lead users to create an account.

samnabi commented 7 years ago

Name and email is always required by the confirm.php page – this is the step after payment gateway, and is usually pre-populated by the customer's payment information.

The reason I developed it this way is to make the checkout as seamless as possible.

If you need more information beyond name and email, you can also require a mailing address under Site Options > Shipping & tax in the panel.