I want to change Basket page, Please help me.

Author Message

Rajiv Ranjan

Wednesday 31 August 2005 9:46:55 pm

Hi,
In eZ publish, when user click "Add to basket" button then a page come that contain three buttons.
1. Checkout.
2. Continue shopping
3. store quantities.

I want to change this page like this.
If user is not logged in then it shows only "Checkout" and "Continue shopping" button.
and if user is logged in then it shows all three buttons.

Thanks in advance.

Kristof Coomans

Wednesday 31 August 2005 11:29:51 pm

You can check in your template if the current user is logged in:

{def $currentUser=fetch( 'user', 'current_user' )}
{if $currentUser.is_logged_in}
{* here comes the stuff only for users that have logged in *}
...
{/if}
{undef $currentUser}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Rajiv Ranjan

Thursday 01 September 2005 3:51:15 am

Hi Kristof
I have added your code but it is not working.
Please give me detail.

Thanks

Kristof Coomans

Thursday 01 September 2005 5:08:47 am

Did you put the HTML code for your button "Store quantities" after <i>{* here comes the stuff only for users that have logged in *}</i>?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Rajiv Ranjan

Thursday 01 September 2005 6:07:37 am

yes, i put HTML code after {* here comes the stuff only for users that have logged in *}

Kristof Coomans

Thursday 01 September 2005 7:01:17 am

Can you post the relevant code here, maybe there are some errors in it?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Rajiv Ranjan

Thursday 01 September 2005 9:10:48 pm

here is the code

{def $currentUser=fetch( 'user', 'current_user' )}
{if $currentUser.is_logged_in}

<input class="shopbutton" type="submit" name="StoreChangesButton" value="{'Store quantities'|i18n('design/base')}" />

{/if}
{undef $currentUser}

Kristof Coomans

Thursday 01 September 2005 10:58:11 pm

And what do you see on the screen, when you are logged in, and when you are not logged in?

Did you clear the template caches?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Rajiv Ranjan

Thursday 01 September 2005 11:02:11 pm

in both cases "Store quantities" button is not display.

yes, I clear the template caches.

Rajiv Ranjan

Friday 02 September 2005 3:29:25 am

i got exact code.

{let user=fetch( user, current_user )}
{section show=$user.is_logged_in}
{* here comes the stuff only for users that have logged in *}
{/section}
{/let}

Kristof Coomans

Friday 02 September 2005 3:34:21 am

You probably use an older version of eZ publish then, which does not support <i>def</i> and <i>if</i>.

Didn't you get any template errors in your debug output with my code?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Rajiv Ranjan

Friday 02 September 2005 4:05:32 am

i am useing eZ publish 3.5.2.
please tell me latest version of eZ publish ?.

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