\OrderItem
OrderItem is a physical component of an order, that describes a product
- Author: morven
Synopsis
class OrderItem
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $casting = ;
- private static array $summary_fields = ;
- // methods
- public Product Product()
- public Product getMatchProduct()
- public Decimal getSubTotal()
- public Decimal getTaxTotal()
- public Currency getTotal()
- public void getCustomDetails()
- public Boolean canView()
- public Boolean canCreate()
- public Boolean canEdit()
- public Boolean canDelete()
Hierarchy
Extends
- DataObject
Members
private
- $casting
- $db
- $has_one
- $summary_fields
Methods
public
- Product() — Find any items in the product catalogue with a matching SKU, good for adding "Order again" links in account panels or finding "Most ordered" etc.
- canCreate() — Anyone can create an order item
- canDelete() — No one can delete items once they are created
- canEdit() — No one can edit items once they are created
- canView() — Only order creators or users with VIEW admin rights can view
- getCustomDetails() — Unserialise the list of customisations and rendering into a basic HTML string
- getMatchProduct() — Get the product, this method is used by casting
- getSubTotal() — Get the total cost of this item based on the quantity, not including tax
- getTaxTotal() — Get the total cost of tax for this item based on the quantity
- getTotal() — Get the total cost of this item based on the quantity