eZ Community » Forums » Setup & design » sort_by price optionlist first item ?
expandshrink

sort_by price optionlist first item ?

sort_by price optionlist first item ?

Tuesday 16 November 2010 9: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 finehappy.gif Emoticon 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

Modified on Tuesday 16 November 2010 10:05:11 pm by Martin Ulrich

No reply yet!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from