Group
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.
Constants
INVALID_EMPTY |
|
INVALID_HYPHEN |
|
INVALID_NUMERIC |
|
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 | $slug | A product group's slug. | |
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 | scopeSlug($query, $slug) | Find by slug. | |
Builder | scopeNotHidden($query) | Restrict to groups which are publicly visible. | |
Builder | scopeSorted($query) | Sort by display order. | |
string | getRoutePath($fullUrl = false, int|null $pid = null) | Get client area route path for group. | |
bool | validateSlugIsUnique(string $slug) | Validate slug is unique. | |
bool | validateSlugFormat(string $slug) | Ensure slug is in a valid format for use. | |
string; | autoGenerateUniqueSlug() | Auto generate unique slug based on name. | |
OrderForm | orderFormTemplate() | Retrieve a product group's associated order form | |
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. | |
bool | isMarketConnectGroup() | - | |
string | getMarketConnectControllerClass() | - |
Details
static
boot ()
HasMany
products ()
A product group has many products in it.
HasMany
features ()
A product group can have many features.
Builder
scopeSlug ($query, $slug)
Find by slug.
Builder
scopeNotHidden ($query)
Restrict to groups which are publicly visible.
Builder
scopeSorted ($query)
Sort by display order.
string
getRoutePath ($fullUrl = false, int|null $pid = null)
Get client area route path for group.
bool
validateSlugIsUnique (string $slug)
Validate slug is unique.
bool
validateSlugFormat (string $slug)
Ensure slug is in a valid format for use.
string;
autoGenerateUniqueSlug ()
Auto generate unique slug based on name.
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.
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.