Forums / Developer / I want to change Basket page, Please help me.
Rajiv Ranjan
Wednesday 31 August 2005 9:46:55 pm
Hi, In Exponential, 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
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
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>?
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 *}
Thursday 01 September 2005 7:01:17 am
Can you post the relevant code here, maybe there are some errors in it?
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}
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?
Thursday 01 September 2005 11:02:11 pm
in both cases "Store quantities" button is not display.
yes, I clear the template caches.
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}
Friday 02 September 2005 3:34:21 am
You probably use an older version of Exponential 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?
Friday 02 September 2005 4:05:32 am
i am useing Exponential 3.5.2.please tell me latest version of Exponential ?.