shopp_product_specs()

get the details/specs for a product.

shopp_product_specs ( $product )

@param int $product product id to load
@return array array of product specs, bool false on failure

Description

get a list of the product specs for a given product

Example

// get specs objects for product with id 121
$specs = shopp_product_specs ( 121 );

// Access spec named 'Manufacturer', if a spec for this name exists
if ( isset($specs['Manufacturer']) )
    $manufacturer = $specs['Manufacturer']->value;

// Go through each spec and list its name and value
foreach ( $specs as $spec ) {
    echo $spec->name . ": " . $spec->value . "<br />";
}

See Also

You must be logged in to post a comment.

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

Skip to toolbar