Skip to the content
Documentation

wish_list_count

No ratings yet

Summary

Fetches a wishlist and returns the number of items in it.

Usage

fetch( 'shop', 'wish_list_count', hash( 'production_id', production_id ) )

Parameters

Name Type Description Required
production_id integer The ID number of the target wishlist. Yes.

Returns

The number of items that make up the wishlist (as an integer).

Description

This function fetches the products that belong to a certain wishlist and returns an integer. The integer reveals the number of items that make up the wishlist. The system stores wishlists using the same solution that is used to store the contents of shopping baskets, the "product collection" schema. The desired wishlist must be specified using the ID number of the product collection that contains the target wishlist.

Examples

Example 1

{def $sum=fetch( 'shop', 'wish_list_count',  hash( 'productcollection_id', 13 ) )}
There are {$sum} items in wishlist number 13.

Outputs the number of items that make up wishlist number 13.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.