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.

eZ debug

Timing: Jan 18 2025 19:17:44
Script start
Timing: Jan 18 2025 19:17:44
Module start 'layout'
Timing: Jan 18 2025 19:17:44
Module start 'content'
Timing: Jan 18 2025 19:17:45
Module end 'content'
Timing: Jan 18 2025 19:17:45
Script end

Main resources:

Total runtime0.7852 sec
Peak memory usage4,096.0000 KB
Database Queries84

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0100 589.1797152.6406
Module start 'layout' 0.01000.0037 741.820339.4766
Module start 'content' 0.01370.7700 781.2969635.1484
Module end 'content' 0.78380.0014 1,416.445320.1250
Script end 0.7851  1,436.5703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4548160.0002
Check MTime0.00130.1691160.0001
Mysql Total
Database connection0.00230.291010.0023
Mysqli_queries0.702189.4171840.0084
Looping result0.00070.0898820.0000
Template Total0.749795.520.3749
Template load0.00280.352820.0014
Template processing0.746995.133020.3735
Template load and register function0.00010.016510.0001
states
state_id_array0.00040.047510.0004
state_identifier_array0.00070.095320.0004
Override
Cache load0.00250.3236580.0000
Sytem overhead
Fetch class attribute can translate value0.00050.068820.0003
Fetch class attribute name0.00150.1872130.0001
XML
Image XML parsing0.00060.076920.0003
class_abstraction
Instantiating content class attribute0.00000.0050170.0000
General
dbfile0.00120.1569160.0001
String conversion0.00000.001140.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
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 43
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs