SilverShop\Model\Variation\Variation
Product Variation
Provides a means for specifying many variations on a product.
Used in combination with ProductAttributes, such as color, size.
A variation will specify one particular combination, such as red, and large.
Synopsis
class Variation
extends DataObject
implements
Buyable
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $owns = ;
- private static array $many_many = ;
- private static array $casting = ;
- private static array $versioning = ;
- private static array $extensions = ;
- private static array $summary_fields = ;
- private static array $searchable_fields = ;
- private static array $indexes = ;
- private static string $singular_name = 'Variation';
- private static string $plural_name = 'Variations';
- private static string $default_sort = 'InternalItemID';
- private static $order_item = OrderItem::class;
- private static string $table_name = 'SilverShop_Variation';
- private static bool $title_has_label = true;
- private static string $title_separator = ':';
- private static string $title_glue = ', ';
- // methods
- public void getCMSFields()
- public void onBeforeWrite()
- public void getTitle()
- public void getCategoryIDs()
- public void getCategories()
- public void canPurchase()
- public void IsInCart()
- public void Item()
- public void addLink()
- public string Link()
- public void createItem()
- public void sellingPrice()
Hierarchy
Members
private
- $casting
- $db
- $default_sort
- $extensions
- $has_one
- $indexes
- $many_many
- $order_item
- $owns
- $plural_name
- $searchable_fields
- $singular_name
- $summary_fields
- $table_name
- $title_glue — string
- $title_has_label — SilverShop\Model\Variation\bool
- $title_separator — string
- $versioning
Methods
public
- IsInCart()
- Item()
- Link() — Returns a link to the parent product of this variation (variations don't have their own pages)
- addLink()
- canPurchase()
- createItem()
- getCMSFields()
- getCategories()
- getCategoryIDs()
- getTitle()
- onBeforeWrite() — Save selected attributes - somewhat of a hack.
- sellingPrice()