This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » EZ Publish Shop and Login
expandshrink

EZ Publish Shop and Login

EZ Publish Shop and Login

Friday 19 October 2012 12:08:22 pm - 6 replies

I using EZ Publish with shopping cart functionality. When a user hits a page they do not have permission to view I would like to redirect to 

user/register

Instead of 

user/login

I can't see how to achieve this, has anyone got any pointers? I do not really understand what mechanism is used to redirect users when they dont have permissions

Modified on Friday 19 October 2012 12:09:30 pm by Jon Day

Friday 19 October 2012 2:10:58 pm

You should find all the information you need in the settings/error.ini file.

Just create an error.ini.append.php file in your override settings folder or your siteaccess settings folder with the following settings:

[ErrorSettings-kernel]
# 1 - Access denied
ErrorHandler[1]=rerun
RerunURL[1]=/user/register

Hope that helps.

Modified on Friday 19 October 2012 2:13:07 pm by Daniel Schreier

Friday 19 October 2012 3:01:41 pm

Thanks for the advice Daniel, just gave it a try

Adding:

<span>[ErrorSettings-kernel]</span><span># 1 - Access denied</span>ErrorHandler<span>[1]</span><span>=</span><span>rerun</span>RerunURL<span>[1]</span><span>=</span><span>/user/register</span>

does work for the wishlist however the basket still redirects to /user/login so I assume this must use a different mechanism.

Any more advice anyone has is very welcome

Modified on Friday 19 October 2012 3:02:11 pm by Jon Day

Friday 19 October 2012 3:22:12 pm

It seems that the there is a seperate setting block for shop errors in the error.ini. Please try out the following settings:

[ErrorSettings-shop]
# 1 - Access denied
ErrorHandler[1]=rerun
RerunURL[1]=/user/register

Hope that will finally help you out.

Friday 19 October 2012 3:53:41 pm

Thanks again for your help with this but that doesn't seem to work either. May have to rethink how I am going to do this. 

Hopefully your advice has pointed me in the right direction enough that I can get it working. 

Seems as if the Basket button actually does a 302 Found and Redirect which doesnt seem to be how the RerunURL works, as wishlist uses this and the URL remains.

Friday 19 October 2012 6:15:47 pm

I tried it on a Community Project 2012.5 test installation with the following settings in settings/override/error.ini.append.php:

[ErrorSettings-kernel]
# 1 - Access denied
ErrorHandler[1]=rerun
RerunURL[1]=/user/register

And it works as expected. When calling /shop/basket as anonymous user, the registration page is showing up. The same with /shop/add and /shop/wishlist.

Are you using the build-in shopping module? What version of eZ Publish are you using?

Friday 19 October 2012 7:08:44 pm

Interesting, this made me think it had something to do with a permissions policy. So that anonymous users can view the shopping basket I have added the policy:

Shop : Buy : No limitations

Without this policy it work as above, however with it, it does not work. Now We're getting there. 

Thanks again for the excellent info and for the checking it works on a test instance. 

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from