# Google Cloud Channel V1 Client - Class DiscountComponent (2.4.1)

2.4.1 (latest) 2.4.0 2.3.1 2.2.1 2.1.4 2.0.0 1.9.5 1.8.2 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Channel V1 Client class DiscountComponent.

Represents a single component of the total discount applicable on a Price.

Generated from protobuf message `google.cloud.channel.v1.DiscountComponent`

## Namespace

Google \\ Cloud \\ Channel \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ discount_percentage` | `float` Discount percentage, represented as decimal. For example, a 20% discount will be represented as 0.2. |
| `↳ discount_absolute` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html` Fixed value discount. |
| `↳ discount_type` | `int` Type of the discount. |

### getDiscountPercentage

Discount percentage, represented as decimal.

For example, a 20% discount will be represented as 0.2.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### hasDiscountPercentage

### setDiscountPercentage

Discount percentage, represented as decimal.

For example, a 20% discount will be represented as 0.2.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDiscountAbsolute

Fixed value discount.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html|null` |   |

### hasDiscountAbsolute

### setDiscountAbsolute

Fixed value discount.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Money.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDiscountType

Type of the discount.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [DiscountType](https://docs.cloud.google.com/php/docs/reference/cloud-channel/latest/V1.DiscountType). |

### setDiscountType

Type of the discount.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [DiscountType](https://docs.cloud.google.com/php/docs/reference/cloud-channel/latest/V1.DiscountType). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDiscountValue

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |