# WHMCS\Product\Group

`Class` · extends `AbstractModel` · implements `SlugInterface`

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.

## Traits

- `SlugTrait`


## Methods

### boot

```php
public static function boot()
```

### products

```php
public function products()
```

A product group has many products in it.

**Returns** `\Illuminate\Database\Eloquent\Relations\HasMany`

### features

```php
public function features()
```

A product group can have many features.

**Returns** `\Illuminate\Database\Eloquent\Relations\HasMany`

### scopeSlug

```php
public function scopeSlug($query, $slug)
```

Find by slug.

**Returns** `Builder`

### scopeNotHidden

```php
public function scopeNotHidden($query)
```

Restrict to groups which are publicly visible.

**Returns** `Builder`

### scopeSorted

```php
public function scopeSorted($query)
```

Sort by display order.

**Returns** `Builder`

### getRoutePath

```php
public function getRoutePath($fullUrl = false, ?int $pid = null)
```

Get client area route path for group.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `bool` | `$fullUrl` |  |


**Returns** `string`

### validateSlugIsUnique

```php
public function validateSlugIsUnique(string $slug): bool
```

Validate slug is unique.

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$slug` |  |


**Returns** `bool`

### autoGenerateUniqueSlug

```php
public function autoGenerateUniqueSlug(): string
```

Auto generate unique slug based on name.

**Returns** `string;`

### getExistingSlugCheck

```php
public function getExistingSlugCheck(string $slug): Builder
```

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$slug` |  |


**Returns** `Builder`

### orderFormTemplate

```php
public function orderFormTemplate()
```

Retrieve a product group's associated order form

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

**Returns** `\WHMCS\View\Template\OrderForm`

### translatedNames

```php
public function translatedNames()
```

Return the translated names for the specific product

**Returns** `\Illuminate\Database\Eloquent\Relations\HasMany\|\WHMCS\Language\DynamicTranslation[]`

### translatedHeadlines

```php
public function translatedHeadlines()
```

Return the translated headlines for the specific product

**Returns** `\Illuminate\Database\Eloquent\Relations\HasMany\|\WHMCS\Language\DynamicTranslation[]`

### translatedTaglines

```php
public function translatedTaglines()
```

Return the translated taglines for the specific product

**Returns** `\Illuminate\Database\Eloquent\Relations\HasMany\|\WHMCS\Language\DynamicTranslation[]`

### getNameAttribute

```php
public function getNameAttribute($name)
```

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

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$name` | The value from the database |


**Returns** `string`

### getHeadlineAttribute

```php
public function getHeadlineAttribute($headline)
```

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

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$headline` | The value from the database |


**Returns** `string`

### getTaglineAttribute

```php
public function getTaglineAttribute($tagline)
```

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

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `string` | `$tagline` | The value from the database |


**Returns** `string`

### getGroupName

```php
public static function getGroupName($groupId, $fallback = '', $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**

| Type | Name | Description |
|  --- | --- | --- |
| `int` | `$groupId` |  |
| `string` | `$fallback` |  |
| `string` | `$language` |  |


**Returns** `string`

### getHeadline

```php
public static function getHeadline($groupId, $fallback = '', $language = null)
```

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

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `int` | `$groupId` |  |
| `string` | `$fallback` |  |
| `string` | `$language` |  |


**Returns** `string`

### getTagline

```php
public static function getTagline($groupId, $fallback = '', $language = null)
```

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

**Parameters**

| Type | Name | Description |
|  --- | --- | --- |
| `int` | `$groupId` |  |
| `string` | `$fallback` |  |
| `string` | `$language` |  |


**Returns** `string`

### isMarketConnectGroup

```php
public function isMarketConnectGroup()
```

**Returns** `bool`

### getMarketConnectControllerClass

```php
public function getMarketConnectControllerClass()
```

**Returns** `string`

### productSlugs

```php
public function productSlugs()
```

### disallowedPaymentGateways

```php
public function disallowedPaymentGateways(): Collection
```