shopp_product_variant()

retrieves a specific Price object representing a product price, variant, or addon.

shopp_product_variant ( $variant, $pricetype )

@param mixed $variant the id of the variant, or array('product'=>int, 'option' => array('menu1name'=>'option', 'menu2name'=>'option') ) to specify variant by product id and option
@param string $pricetype (optional default:variant) product, variant, or addon
@return Price Price object or false on error

Description

Retrieves a specific Price object representing a product price, variant, or addon.

// Lookup variant by id
$Variant = shopp_product_variant( 258 );

// Lookup variant by product id and option set
$option = array('Size'=>'medium', 'Color'=>'Navy Baby Solid');
$Variant = shopp_product_variant(array('product'=>130, 'option'=>$option), 'variant');

// Lookup addon by product id and addon option
$option = array('Special' => 'Embroidered');
$Addon = shopp_product_variant(array('product'=>130, 'option'=>$option), 'addon' );

// Lookup product Price by product id
$Price = shopp_product_variant(array('product'=>31), 'product');

See Also

You must be logged in to post a comment.

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

Skip to toolbar