Google Cloud Channel V1 Client - Class DiscountComponent (2.4.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
Google\Type\Money

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

hasDiscountAbsolute

setDiscountAbsolute

Fixed value discount.

Parameter
Name
Description
Returns
Type
Description
$this

getDiscountType

Type of the discount.

Returns
Type
Description
int
Enum of type DiscountType .

setDiscountType

Type of the discount.

Parameter
Name
Description
var
int

Enum of type DiscountType .

Returns
Type
Description
$this

getDiscountValue

Returns
Type
Description
string
Create a Mobile Website
View Site in Mobile | Classic
Share by: