SilverShop\Model\Buyable
A buyable class implies it as an associated order item that can be added to an order.
Enforce a createItem function on all objects that should be added to cart.
eg: Product class.
Synopsis
interface Buyable
{
- // methods
- public OrderItem createItem()
- public boolean canPurchase()
- public ShopCurrency sellingPrice()
Methods
public
- canPurchase() — Checks if the buyable can be purchased. If a buyable cannot be purchased then the method should return false
- createItem() — Create a new OrderItem to add to an order.
- sellingPrice() — The price the customer gets this buyable for, with any additional additions or subtractions.