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.