Referencing shop baskets when continuing shopping.

Author Message

Paul Forsyth

Thursday 29 May 2003 2:55:05 am

In my page layout i have a side panel that allows the user to view the current basket and checkout when ready. Also there is a count of the number of items in the basket.

If i am currently viewing the basket there is a template variable $basket defined that i can use to query about the item count.

When i am not viewing the basket, eg im continuing to shop, the $basket variable is no longer defined.

Is it possible to query the basket contents when the basket is not part of module.result? Can session vars be accessed somehow?

thanks

paul

Bård Farstad

Monday 02 June 2003 10:25:07 am

For this kind of functionality I would create a template function or operator which fetches the information from the bakset. You can also cache this information in the session or use the cache block function.

There is already written one template function which returns the basket as an array. This function is defined in the shop module and is called basket. We've used this function in a similar setup as you describe.

--bård

Documentation: http://ez.no/doc

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 30 2025 21:42:38
Script start
Timing: Jan 30 2025 21:42:38
Module start 'layout'
Timing: Jan 30 2025 21:42:38
Module start 'content'
Timing: Jan 30 2025 21:42:38
Module end 'content'
Timing: Jan 30 2025 21:42:38
Script end

Main resources:

Total runtime0.0280 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 588.2656151.2266
Module start 'layout' 0.00820.0054 739.4922220.7344
Module start 'content' 0.01360.0129 960.2266997.7422
Module end 'content' 0.02640.0015 1,957.968829.9922
Script end 0.0280  1,987.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.003110.9092140.0002
Check MTime0.00114.1000140.0001
Mysql Total
Database connection0.00103.719310.0010
Mysqli_queries0.004917.589730.0016
Looping result0.00000.075810.0000
Template Total0.00113.910.0011
Template load0.00082.811410.0008
Template processing0.00031.050110.0003
Override
Cache load0.00051.800510.0005
General
dbfile0.00062.320880.0001
String conversion0.00000.050240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs