Shop_BundleItemProduct class
Defined in |
/modules/shop/models/shop_bundleitemproduct.php, lines 23-200 |
Inheritance |
Phpr_Extension » Phpr_Extensible » Phpr_Validatable » Db_Base » Db_WhereBase » Db_SqlBase » Db_ActiveRecord » Shop_BundleItemProduct |
Author |
LemonStand eCommerce Inc. |
Represents a product record in a bundle item.
Usually you don't need to create objects of this class directly,
because Bundle Helper class has methods
for manipulating with objects of this class.
Show inherited properties.
Property details
¶
allow_manual_quantity property
public boolean $allow_manual_quantity;
Determines whether manual quantity input is allowed for this product.
¶
bundle_item property
A reference to the parent bundle item object.
¶
default_quantity property
public integer $default_quantity;
Specifies the default product quantity.
¶
id property
public integer $id;
Specifies the bundle item product identifier.
¶
is_default property
public boolean $is_default;
Determines whether this product is a default product in the bundle item.
¶
product property
A reference to the product associated with this bundle item product record.
¶
product_id property
public integer $product_id;
Identifier of a product ( Shop_Product) object associated with this bundle item product record.
Method details
¶
find_by_id() method
public static Shop_BundleItemProduct find_by_id(integer $id)
$id |
integer |
specifies the bundle item product identifier. |
{return} |
Shop_BundleItemProduct |
returns the bundle item product object. Returns NULL if the object is not found. |
Finds a bundle item product by its identifier.
¶
get_price() method
public float get_price( Shop_Product $product=NULL, array $product_options=NULL, boolean $apply_catalog_price_rules=false)
$product |
Shop_Product |
currently selected product object. If no object provided, the product assigned to the item will be used. |
$product_options |
array |
specifies selected product options (Option Matrix support) |
$apply_catalog_price_rules |
boolean |
determines whether catalog price rules should be applied to the result.
Pass TRUE to this parameter to get the item sale price. |
{return} |
float |
returns the bundle item product price. |
Returns the bundle item product price.
Takes into account the price mode settings applied to the product.
Applies the tax if it is required by the configuration. The optional $product parameter represents a currently
selected product object. If no object provided, the product assigned to the item will be used. If you use
Option Matrix
feature, pass selected bundle item product's options to the second parameter. Use Shop_BundleHelper::get_selected_options()
method to load the selected options. Example:
$selected_options = Shop_BundleHelper::get_selected_options($item, $item_product);
Price: <?= format_currency($item_product->get_price($product, $selected_options)) ?>
¶
get_price_no_tax() method
public float get_price_no_tax( Shop_Product $product=NULL, integer $quantity=1, integer $customer_group_id=NULL, array $product_options=NULL, boolean $apply_catalog_price_rules=false)
$product |
Shop_Product |
currently selected product object. If no object provided, the product assigned to the item will be used. |
$quantity |
integer |
specifies the product quantity ordered. |
$customer_group_id |
integer |
specifies an identifier of a customer group.
If no value provided, uses the current front-end customer's group identifier. |
$product_options |
array |
specifies selected product options (Option Matrix support) |
$apply_catalog_price_rules |
boolean |
determines whether catalog price rules should be applied to the result.
Pass TRUE to this parameter to get the item sale price. |
{return} |
float |
returns the bundle item product price without any taxes applied. |
Returns the bundle item product price without any taxes applied.
The optional $product parameter represents a currently selected product object.
If no object provided, the product assigned to the item will be used. Usually using of this method
is not necessary in front-end code - use get_price() method instead.
¶
get_sale_price() method
public float get_sale_price( Shop_Product $product=NULL, array $product_options=NULL)
$product |
Shop_Product |
currently selected product object. If no object provided, the product assigned to the item will be used. |
$product_options |
array |
specifies selected product options (Option Matrix support) |
{return} |
float |
returns the bundle item product sale price. |
Returns the bundle item product sale price.
Takes into account the price mode settings applied to the product. Applies the tax if it is required by the configuration.
The optional $product parameter represents a currently selected product object. If no object provided,
the product assigned to the item will be used. If you use Option Matrix
feature, pass selected bundle item product's options to the second parameter. Use Shop_BundleHelper::get_selected_options()
method to load the selected options. Example:
$selected_options = Shop_BundleHelper::get_selected_options($item, $item_product);
Sale price: <?= format_currency($item_product->get_sale_price($product, $selected_options)) ?>
|