sort_by price optionlist first item ?

Author Message

Martin Ulrich

Tuesday 16 November 2010 12:51:45 pm

In my shop there are products with different quantities and prices.

I do a productclass with multioption-datatype and options items:

1 ltr. beer 2.50 bugs

2 ltr. beer 5.00 bugs

3 ltr. beer 10.00 bugs

(And leave the main price field with 0.00 (bugs))

Works fine:) But now I want to sort the productlist, this case, because main pricefield is 0.00 (bugs), by price value of the first option item.

In product lineview I can fetch the price of first option item with:

{$node.object.data_map.additional_options.data_map.value.optiongroup_list.0.multioption_list.0.optionlist.0.additional_price}

And in the Productlist with I can fetch the price of first option item with:

{def $pricedesc = fetch( 'content', 'tree', hash( 'parent_node_id', 2,

 'offset', $view_parameters.offset,
 'sort_by', array(XXXXX ), 
 'class_filter_type', 'include',
 'class_filter_array', array( 'product' )
 ) ) }

{foreach $pricedesc as $child}
{$child.object.data_map.additional_options.value.optiongroup_list.0.multioption_list.0.optionlist.0.additional_price}
{/foreach}

Now I want to sort the productlist by the value of the first optionlist item. But not able to write the code. Is it possible to define a variable and do sort by $variable?

mmh.

How can I sort by optionlist bugs? XXXXX

very thanks!

gr. Bugbeer

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

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 04:21:19
Script start
Timing: Jan 18 2025 04:21:19
Module start 'layout'
Timing: Jan 18 2025 04:21:19
Module start 'content'
Timing: Jan 18 2025 04:21:19
Module end 'content'
Timing: Jan 18 2025 04:21:19
Script end

Main resources:

Total runtime0.8229 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.0313152.6406
Module start 'layout' 0.00650.0029 740.671939.4688
Module start 'content' 0.00940.8123 780.1406436.8047
Module end 'content' 0.82170.0012 1,216.94538.1563
Script end 0.8229  1,225.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4008160.0002
Check MTime0.00130.1625160.0001
Mysql Total
Database connection0.00080.098510.0008
Mysqli_queries0.780094.7903460.0170
Looping result0.00040.0512440.0000
Template Total0.788195.820.3941
Template load0.00210.261020.0011
Template processing0.786095.514120.3930
Template load and register function0.00010.016910.0001
states
state_id_array0.00160.199810.0016
state_identifier_array0.00070.085720.0004
Override
Cache load0.00180.2191200.0001
Sytem overhead
Fetch class attribute can translate value0.00050.061510.0005
Fetch class attribute name0.00050.062310.0005
XML
Image XML parsing0.00010.012710.0001
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00090.1062100.0001
String conversion0.00000.001240.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
2content/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: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs