|
Shop_OptionMatrixRecord class
Represents Option Matrix record.
Usually you don't need to access objects of this class directly.
See AlsoPublic propertiesShow inherited properties.
Public methodsShow inherited methods.
Events
Property details¶ base_price propertypublic float $base_price;
Specifies the base price of the record.
¶ cost propertypublic float $cost;
Specifies the product cost.
¶ depth propertypublic float $depth;
Specifies the product depth.
¶ disabled propertypublic boolean $disabled;
Determines whether the record is disabled.
¶ expected_availability_date propertypublic Phpr_DateTime $expected_availability_date;
Specifies the expected availability date.
¶ height propertypublic float $height;
Specifies the product height.
¶ id propertypublic integer $id;
Specifies the record database identifier.
¶ images propertypublic Db_DataCollection $images;
A collection of images assigned to the category. Each element in the collection is an object of the Db_File class. You can use this property directly to
output category images, or use the image_url() method. Not proxiable.
¶ in_stock propertypublic integer $in_stock;
Specifies the number of items in stock.
¶ on_sale propertypublic boolean $on_sale;
Determines whether the product is on sale.
¶ sale_price_or_discount. propertypublic string $sale_price_or_discount.;
Specifies the sale price or discount in the following format: 10, -10, 10%.
¶ sku propertypublic string $sku;
Specifies the product SKU.
¶ weight propertypublic float $weight;
Specifies the product weight.
¶ width propertypublic float $width;
Specifies the product width.
Method details¶ find_record() methodpublic static Shop_OptionMatrixRecord find_record(array $options, mixed $product, boolean $option_keys=false)
Returns Option Matrix record by option values.
The $options parameter should contain a list of product options and option values in the
following format: ['Option name 1'=>'option value 1', 'Option name 2'=>'option value 2']
or: ['option_key_1'=>'option value 1', 'option_key_2'=>'option value 2'].
Option keys and values are case sensitive. See also $option_keys parameter.
¶ get_options() methodpublic array get_options(boolean $option_keys=true)
Returns options associated with the record as array of option keys and values.
¶ get_price() methodpublic float get_price(mixed $product, integer $quantity=1, integer $customer_group_id=NULL, boolean $no_tax=false)
Returns product price, taking into account tier pricing. Returns product price with tax included,
if the Display catalog/cart prices including tax
option is enabled unless the $no_tax parameter value is FALSE.
¶ get_sale_price() methodpublic float get_sale_price(mixed $product, integer $quantity=1, integer $customer_group_id=NULL, boolean $no_tax=false)
Returns product sale price. Returns price with tax included,
if the Display catalog/cart prices including tax
option is enabled unless the $no_tax parameter value is FALSE.
¶ get_sale_reduction() methodpublic float get_sale_reduction(mixed $product, integer $quantity=1, $customer_group_id=NULL)
Returns the difference between the regular price and sale price of the product.
¶ get_volume() methodpublic float get_volume(mixed $product)
Returns the product volume.
¶ is_low_stock() methodpublic boolean is_low_stock(mixed $product)
Returns TRUE if inventory tracking for the product is enabled and the product has reached the low stock threshold.
¶ is_on_sale() methodpublic boolean is_on_sale(mixed $product)
Returns TRUE if there are active catalog-level price rules affecting the product price or if the product is on sale ('On Sale' checkbox).
¶ is_out_of_stock() methodpublic boolean is_out_of_stock(mixed $product)
Returns TRUE if inventory tracking for the product is enabled and the product is out of stock.
¶ is_property_supported() methodpublic mixed is_property_supported(string $field_name)
Determines whether a specified field can be loaded from the record.
Not supported properties are loaded from a base product.
¶ options_as_string() methodpublic void options_as_string()
Returns options associated with the record as string.
The returned string has the following format: Color: green, Size: large.
¶ reset_cache() methodpublic static void reset_cache()
Resets Option Matrix internal cache.
Option Matrix caches records within a single request using product options as a cache key.
|