ibexa

Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

best_sell_list

Summary

Fetches the most popular / most sold products.

Usage

fetch( 'shop', 'best_sell_list',
       hash( 'top_parent_node_id', id,
             'limit',              limit ) )

Parameters

NameTypeDescriptionRequired
top_parent_node_id integer The ID number of the top node. Yes.
limit integer The number of objects that should be returned. Yes.

Returns

An array of ezcontentobject objects or FALSE.

Description

This function fetches the most popular / most sold products that are located within a part of the content node tree. The "top_parent_node_id" parameter must be used to tell the function under which node it should look for popular products. The "limit" parameter controls the number of items that will be returned. The function returns an array of ezcontentobject objects. If the function is unable to find any products, FALSE will be returned.

Examples

Example 1

{def $best_sellers=fetch( 'shop', 'best_sell_list',
                          hash( 'top_parent_node_id', 2,
                                'limit',              5 ) )}
 
{foreach $best_sellers as $product}
    {$product.name} <br />
{/foreach}

Outputs the names of the five most popular products that are located somewhere below node number 2.

Balazs Halasy (06/02/2004 12:49 pm)

Balazs Halasy (29/04/2005 9:17 am)


Comments

There are no comments.