How to force user registration on checkout?

Author Message

Adolfo Barragán

Tuesday 23 September 2003 2:32:05 am

I have a site which allow anonymous visitors, so in /siteaccess/<access>/site.ini.append I have RequireUserLogin = false.

The anonymous user can navigate by site and to buy products (add to basket), but the checkout process is only allowed for registered user.

When user press 'checkout' button the system must check if user is registered. If so, the checkout process can continue, else, the visitor must register or login first.

How can I achieve these task?

Thanks in advance
Adolfo Barragan

Paul Forsyth

Tuesday 23 September 2003 3:01:20 am

Look at shop account handlers. This is where the functionality you need is located. For example, the default shop account handler is at:

kernel/classes/shopaccounthandlers/ezdefaultshopaccounthandler.php

There you can see the function fetchAccountInformation redirecting the user to 'user/login' if the user is not logged in.

You could either change this or create another shop account handler to redirect to 'user/register'.

I think the default account handler redirected to user/register in 3.1 and before but this was changed to user/login for 3.2, which is my preference. If i am a returning user i dont want to goto a register screen each time i forget to login before adding items to the basket.

Paul

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.