A product group

A product group contains one or more order-able products and determines how those products are displayed in order forms to clients.

class Group extends AbstractModel

Properties summary

Type Property Description
protected $table
protected $columnMap
protected $booleans
protected $commaSeparated
int $id A product group's unique identifier.
string $name A product group's name.
string $headline A product group's headline.
string $tagline A product group's tagline.
string $orderFormTemplate The order form template a product group should display on the order form, or null to use the default shopping cart template.
string[] $disabledPaymentGateways Payment gateways which should NOT be displayed to the client when ordering products in a product group.
bool $isHidden Whether or not a product group is displayed to clients in the shopping cart.
int $displayOrder The order in which a product group is displayed to clients.
Carbon $createdAt The date a product group was created.
Carbon $updatedAt The date a product group was last modified.
Collection|Product[] $products The products that belong to a product group.
Collection|Feature[] $features The products that belong to a product group.
Collection|DynamicTranslation[] $translatedNames
Collection|DynamicTranslation[] $translatedHeadlines
Collection|DynamicTranslation[] $translatedTaglines

Methods summary

Return Type Method Name Description
static  boot() -
HasMany products() A product group has many products in it.
HasMany features() A product group can have many features.
Builder scopeNotHidden($query) Restrict to groups which are publicly visible.
Builder scopeSorted($query) Sort by display order.
OrderForm orderFormTemplate() Retrieve a product group's associated order form
string[] getAvailableBillingCycles() Get available billing cycles for product.
HasMany|DynamicTranslation[] translatedNames() Return the translated names for the specific product
HasMany|DynamicTranslation[] translatedHeadlines() Return the translated headlines for the specific product
HasMany|DynamicTranslation[] translatedTaglines() Return the translated taglines for the specific product
string getNameAttribute(string $name) Get the group's name - this will override the output from the db value if set in Lang.
string getHeadlineAttribute(string $headline) Get the group's headline - this will override the output from the db value if set in Lang.
string getTaglineAttribute(string $tagline) Get the group's tagline - this will override the output from the db value if set in Lang.
static string getGroupName(int $groupId, string $fallback = '', string $language = null) Obtain the product group name for the current language, passed language or fallback to the currently defined value for the product group.
static string getHeadline(int $groupId, string $fallback = '', string $language = null) Obtain the product headline for the current language, passed language or fallback to the currently defined value for the product group.
static string getTagline(int $groupId, string $fallback = '', string $language = null) Obtain the product tagline for the current language, passed language or fallback to the currently defined value for the product group.

Details

static boot ()

HasMany products ()

A product group has many products in it.

Return Value

HasMany

HasMany features ()

A product group can have many features.

Return Value

HasMany

Builder scopeNotHidden ($query)

Restrict to groups which are publicly visible.

Parameters

$query

Return Value

Builder

Builder scopeSorted ($query)

Sort by display order.

Parameters

$query

Return Value

Builder

OrderForm orderFormTemplate ()

Retrieve a product group's associated order form

Use the default template if the product group doesn't have an associated order form.

Return Value

OrderForm

string[] getAvailableBillingCycles ()

Get available billing cycles for product.

Return Value

string[]

HasMany|DynamicTranslation[] translatedNames ()

Return the translated names for the specific product

Return Value

HasMany|DynamicTranslation[]

HasMany|DynamicTranslation[] translatedHeadlines ()

Return the translated headlines for the specific product

Return Value

HasMany|DynamicTranslation[]

HasMany|DynamicTranslation[] translatedTaglines ()

Return the translated taglines for the specific product

Return Value

HasMany|DynamicTranslation[]

string getNameAttribute (string $name)

Get the group's name - this will override the output from the db value if set in Lang.

Parameters

string $name The value from the database

Return Value

string

string getHeadlineAttribute (string $headline)

Get the group's headline - this will override the output from the db value if set in Lang.

Parameters

string $headline The value from the database

Return Value

string

string getTaglineAttribute (string $tagline)

Get the group's tagline - this will override the output from the db value if set in Lang.

Parameters

string $tagline The value from the database

Return Value

string

static string getGroupName (int $groupId, string $fallback = '', string $language = null)

Obtain the product group name for the current language, passed language or fallback to the currently defined value for the product group.

Parameters

int $groupId
string $fallback
string $language

Return Value

string

static string getHeadline (int $groupId, string $fallback = '', string $language = null)

Obtain the product headline for the current language, passed language or fallback to the currently defined value for the product group.

Parameters

int $groupId
string $fallback
string $language

Return Value

string

static string getTagline (int $groupId, string $fallback = '', string $language = null)

Obtain the product tagline for the current language, passed language or fallback to the currently defined value for the product group.

Parameters

int $groupId
string $fallback
string $language

Return Value

string