shopp_product_variant_options()

get an associative array of the option menu names and array of options associated each menu for a product.

shopp_product_variant_options ( $product )

@param int $product (required) product id of the product to retrieve the options for
@return array of options, false on error or non-variant product

Description

Get an associative array of the option menu names and array of options associated each menu for a product

Example

// Get an array of the product variant options for a product
$options = shopp_product_variant_options(130);

print_r($options);

// Should output something like:
// Array
// (
//     [Size] => Array
//         (
//             [0] => medium
//             [1] => large
//             [2] => x-large
//             [3] => small
//             [4] => xx-large
//             [5] => large-tall
//             [6] => x-large tall
//             [7] => 2x-large tall
//             [8] => 2x-large
//         )
// 
//     [Color] => Array
//         (
//             [0] => Black/Grey Colorbi
//             [1] => Navy Baby Solid
//             [2] => Red/Iron Colorbloc
//             [3] => Iron Solid
//             [4] => Dark Avocado Soil
//         )
// 
// )

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar