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.

eZ debug

Timing: Jan 18 2025 22:27:14
Script start
Timing: Jan 18 2025 22:27:14
Module start 'layout'
Timing: Jan 18 2025 22:27:14
Module start 'content'
Timing: Jan 18 2025 22:27:15
Module end 'content'
Timing: Jan 18 2025 22:27:15
Script end

Main resources:

Total runtime0.8614 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 589.1641152.6406
Module start 'layout' 0.00440.0023 741.804739.4766
Module start 'content' 0.00670.8534 781.2813458.8672
Module end 'content' 0.86010.0013 1,240.14848.1250
Script end 0.8614  1,248.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.3416160.0002
Check MTime0.00120.1423160.0001
Mysql Total
Database connection0.00050.055410.0005
Mysqli_queries0.823695.6037540.0153
Looping result0.00040.0464520.0000
Template Total0.837397.220.4186
Template load0.00170.202120.0009
Template processing0.835596.988020.4177
Template load and register function0.00020.026210.0002
states
state_id_array0.00090.103910.0009
state_identifier_array0.00060.075020.0003
Override
Cache load0.00140.1639160.0001
Sytem overhead
Fetch class attribute can translate value0.00060.075020.0003
Fetch class attribute name0.00090.101320.0004
XML
Image XML parsing0.00020.026720.0001
class_abstraction
Instantiating content class attribute0.00000.000620.0000
General
dbfile0.00050.0634100.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs