Please enable JavaScript to view this site.

AudienceView Unlimited 7  Product Guides

 


 

av.cart.productExists(product_type,product_name)

av.cart.productCount(product_type,product_name)

av.cart.productValue(product_type,product_name)

 


 

av.cart.productExists(product_type,product_name)

productExists is a utility function that search the cart for the product supplied and return true if there is a match and false if there is no match. The function accepts the following parameters:

Parameter

Type

Description

product_type

string

The type of product being search for, allowed values are:

admission

bundle

miscellaneous_item

gift

stored_value

product_name

string or regex

The name of the product being searched for, will attempt to find a match on:

product name

product description

product short description

Supports regex pattern matching

One of either of the parameters are required to find a match. If neither of them are supplied, the function returns true if there are at least one product in the cart.

Example Usage:

Function Call

 

productExists('admission','Wizard of Oz')

returns true if there is an admission type product on the cart where the event name, short description or description is an exact match of "Wizard Of Oz" - case sensitive

productExists('','Wizard of Oz')

returns true for any product type on the cart where the product name, short description or description is an exact match of "Wizard Of Oz" - case sensitive

productExists('',/oz/i)

returns true for any product type on the cart where the product name, short description or description contains 'oz' - case insensitive

 

av.cart.productCount(product_type,product_name)

productCount is a utility function that search the cart for the product supplied and return the count of how many times that product exists on the order. The function accepts the following parameters:

Parameter

Type

Description

product_type

string

The type of product being search for, allowed values are:

admission

bundle

miscellaneous_item

gift

stored_value

product_name

string or regex

The name of the product being searched for, will attempt to find a match on:

product name

product description

product short description

Supports regex pattern matching

One of either of the parameters are required to find a match. If neither of them are supplied the function returns the count of all products in the cart.

Example Usage:

Function Call

 

productCount('admission','Wizard of Oz')

returns the count of admission if there is an admission type product on the cart where the event name, short description or description is an exact match of "Wizard Of Oz" - case sensitive

productCount('','Wizard of Oz')

returns the count of any product type on the cart where the product name, short description or description is an exact match of "Wizard Of Oz" - case sensitive

productCount('',/oz/i)

returns the count for any product type on the cart where the product name, short description or description contains 'oz' - case insensitive

 

av.cart.productValue(product_type,product_name)

productValue is a utility function that search the cart for the product supplied and returns the value of that product on the cart. The function accepts the following parameters:

Parameter

Type

Description

product_type

string

The type of product being search for, allowed values are:

admission

bundle

miscellaneous_item

gift

stored_value

product_name

string or regex

The name of the product being searched for, will attempt to find a match on:

product name

product description

product short description

Supports regex pattern matching

One of either of the parameters are required to find a match. If neither of them are supplied the function returns the total value of all products in the cart.

Example Usage:

Function Call

 

productValue('admission','Wizard of Oz')

returns the values of admissions if there is an admission type product on the cart where the event name, short description or description is an exact match of "Wizard Of Oz" - case sensitive

productValue('','Wizard of Oz')

returns the value of any product type on the cart where the product name, short description or description is an exact match of "Wizard Of Oz" - case sensitive

productValue('',/oz/i)

returns the value for any product type on the cart where the product name, short description or description contains 'oz' - case insensitive