Shop_OrderItem
The Shop_OrderItem class represents items of a specific order. You may need to access order items on the Order Details page. Objects of this are available through the order $items field.
Parent class: Db_ActiveRecord
Class fields
- $discount – the item discount value
- $discount_tax_included - the item discount amount, tax inclusive
- $product – a product object associated with the order item. An object of the Shop_Product class.
- $product_name – a name of a product associated with the order item
- $product_sku – a SKU of a product associated with the order item
- $price – a price of a single item without a price of extra options and without the discount applied
- $single_price - a price of a single order item, taking into account a price of extra options. Do not takes the discount value into account. Subtract the discount value to get a total item unit price.
- $price_tax_included - item price (including extras), tax inclusive
- $quantity - a number of items of this type in a order
- $subtotal - (item price - discount)*quantity
- $subtotal_tax_incl - subtotal, tax inclusive
- $tax - a sales tax value calculated for a single item (doesn't take into account the item quantity). The tax is calculated basing on the unit price + extra options prices.
- $tax_2 - a second sales tax value, if applicable.
- $tax_name_1 - name of the first sales tax applied
- $tax_name_2 - name of the second sales tax applied
- $uploaded_files - contains a collection of files uploaded by the customer on the Product Details page. The collection is an object of Db_DataCollection class. Each element in the collection is an object of the Db_File class.
Class methods
- eval_single_price() - returns a price of a single order item, taking into account a price of extra options. Do not takes the discount value into account. Subtract the discount value to get a total item unit price. You can use the $single_price field instead of this method.
- output_product_name($output_name = true) – returns a string containing a product name, options and extra options. The optional parameter allows to exclude the product name from the result string and return only options and extra options.
- get_options() - returns an array of product options selected by the customer. Each element of the array is another array with keys corresponding option names and values corresponding option values, for example: array('color'=>'yellow', 'size'=>'small')
- get_extra_options() - returns a list of extra (paid) options selected by the customer. Each element of the array is another array with 2 elements. The first elements corresponds an option price, and the second element corresponds the option name. For example: array(12.5, 'Extra 125 Mb RAM')
See also:
Next: shop:cart
Previous: Shop_Order
Return to API (function, action and class reference)
Comments
No comments posted so far.
Add your comment
Loading form...