Basket in a box, fetch?

Author Message

Robin Sørlie

Tuesday 29 July 2003 6:19:12 am

Hi

Posted this in setup & design forum:

In my pagelayout template I have a "box" on the right side which show the products in basket and total amount.

I have tried this:

{section name=Basket show=$basket.items|gt(0)}
<input type="hidden" name="ProductItemIDList[]" value="{$Basket:ProductItem:item.id}" />

<table width="100%">
{section name=ProductItem loop=$basket.items}
<tr>
<td class="menybox" width="100%" colspan="2"><a class="menybox" href={concat("/content/view/full/",$Basket:ProductItem:item.node_id,"/")|ezurl}>{$Basket:ProductItem:item.item_count} x {$Basket:ProductItem:item.object_name|wash}{$Basket:ProductItem:item.item_count}</a>
</td> {/section}
</tr>
<tr>
<td class="menybox" width="50%">Total:</td>
<td class="menybox" width="50%"></td>
</tr>
<tr>
<td class="menybox" width="50%">{$basket.total_inc_vat|l10n(currency)}</td>
<td class="menybox" width="50%">{$basket.total_ex_vat|l10n(currency)}</td>
</tr>
</table>
{/section}

{section name=Basket show=$basket.items|lt(1) } You have no products in your basket.
{/section}

This works fine when I'm in /shop/basket/, but not when browsing around for more products. I suppose I need a fetch function here, but how can I fetch from basket?

Found this on the forum http://www.ez.no/developer/ez_publish_3/forum/developer/referencing_shop_baskets_when_continuing_shopping

But I'm not sure what Bård is thinking about.

-Robin

Jan Borsodi

Tuesday 29 July 2003 1:42:05 pm

I don't think there is a fetch function available for this at the moment. However by creating a custom template operator you could return the basket object. Using it could be something like.

{let basket=currentbasket()}
{$basket.items}
{/let}

The template operator would have to programmed in PHP though.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

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 31 2025 04:20:04
Script start
Timing: Jan 31 2025 04:20:04
Module start 'layout'
Timing: Jan 31 2025 04:20:04
Module start 'content'
Timing: Jan 31 2025 04:20:05
Module end 'content'
Timing: Jan 31 2025 04:20:05
Script end

Main resources:

Total runtime1.0284 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.1094151.1953
Module start 'layout' 0.00480.0028 739.304736.6172
Module start 'content' 0.00761.0200 775.9219923.0625
Module end 'content' 1.02750.0008 1,698.984411.8750
Script end 1.0283  1,710.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3070160.0002
Check MTime0.00130.1247160.0001
Mysql Total
Database connection0.00080.075110.0008
Mysqli_queries0.978695.1568540.0181
Looping result0.00050.0528520.0000
Template Total0.991196.420.4955
Template load0.00290.285920.0015
Template processing0.988196.086920.4941
Template load and register function0.00160.153210.0016
states
state_id_array0.00090.087110.0009
state_identifier_array0.00130.123420.0006
Override
Cache load0.00200.1970380.0001
Sytem overhead
Fetch class attribute can translate value0.00060.058420.0003
Fetch class attribute name0.00200.199330.0007
XML
Image XML parsing0.00060.063020.0003
class_abstraction
Instantiating content class attribute0.00000.000930.0000
General
dbfile0.00080.0729170.0000
String conversion0.00000.000740.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs