Composable Commerce PHP SDKPHP SDK
  • Namespace
  • Class
  • Tree

Namespaces

  • Commercetools
    • Commons
      • Helper
    • Core
      • Builder
        • Request
        • Update
      • Cache
      • Client
        • Adapter
        • OAuth
      • Error
      • Helper
        • Annotate
        • State
          • Renderer
        • Subscriber
          • Log
      • Model
        • ApiClient
        • Cart
        • CartDiscount
        • Category
        • Channel
        • Common
        • Customer
        • CustomerGroup
        • CustomField
        • CustomObject
        • DiscountCode
        • Extension
        • Inventory
        • Message
        • Order
        • OrderEdit
        • Payment
        • Product
          • Search
        • ProductDiscount
        • ProductSelection
        • ProductType
        • Project
        • Review
        • ShippingMethod
        • ShoppingList
        • State
        • Store
        • Subscription
        • TaxCategory
        • Type
        • Zone
      • Request
        • ApiClients
        • CartDiscounts
          • Command
        • Carts
          • Command
        • Categories
          • Command
        • Channels
          • Command
        • CustomerGroups
          • Command
        • Customers
          • Command
        • CustomField
          • Command
        • CustomObjects
        • DiscountCodes
          • Command
        • Extensions
          • Command
        • GraphQL
        • InStores
        • Inventory
          • Command
        • Me
          • Command
        • Messages
        • OrderEdits
          • Command
          • StagedOrder
            • Command
        • Orders
          • Command
        • Payments
          • Command
        • ProductDiscounts
          • Command
        • Products
          • Command
        • ProductSelections
          • Command
        • ProductTypes
          • Command
        • Project
          • Command
        • Query
        • Reviews
          • Command
        • ShippingMethods
          • Command
        • ShoppingLists
          • Command
        • States
          • Command
        • Stores
          • Command
        • Subscriptions
          • Command
        • TaxCategories
          • Command
        • Types
          • Command
        • Zones
          • Command
      • Response

Classes

  • AbsoluteCartDiscountValue
  • CartDiscount
  • CartDiscountCollection
  • CartDiscountDraft
  • CartDiscountReference
  • CartDiscountReferenceCollection
  • CartDiscountTarget
  • CartDiscountValue
  • CustomLineItemsTarget
  • GiftLineItemCartDiscountValue
  • LineItemsTarget
  • MultiBuyCustomLineItemsTarget
  • MultiBuyLineItemsTarget
  • RelativeCartDiscountValue
  • ShippingCostTarget

Class CartDiscountDraft

Commercetools\Core\Model\Common\AbstractJsonDeserializeObject implements Commercetools\Core\Model\Common\JsonDeserializeInterface, Commercetools\Core\Model\Common\ObjectTreeInterface uses Commercetools\Core\Model\Common\ObjectTreeTrait
Extended by Commercetools\Core\Model\Common\JsonObject implements JsonSerializable uses Commercetools\Core\Model\Common\ContextTrait
Extended by Commercetools\Core\Model\CartDiscount\CartDiscountDraft
Namespace: Commercetools\Core\Model\CartDiscount
API documentation: https://docs.commercetools.com/http-api-projects-cartDiscounts.html#cartdiscount
Located at Core/Model/CartDiscount/CartDiscountDraft.php

Methods summary

public static Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# ofNameValuePredicateTargetOrderActiveAndDiscountCode( Commercetools\Core\Model\Common\LocalizedString $name, Commercetools\Core\Model\CartDiscount\CartDiscountValue $value, string $cartPredicate, Commercetools\Core\Model\CartDiscount\CartDiscountTarget $target, string $sortOrder, boolean $isActive, boolean $requiresDiscountCode, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$name
$value
$cartPredicate
$target
$sortOrder
$isActive
$requiresDiscountCode
$context

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public static Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# ofNameValuePredicateOrderActiveAndDiscountCode( Commercetools\Core\Model\Common\LocalizedString $name, Commercetools\Core\Model\CartDiscount\CartDiscountValue $value, string $cartPredicate, string $sortOrder, boolean $isActive, boolean $requiresDiscountCode, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$name
$value
$cartPredicate
$sortOrder
$isActive
$requiresDiscountCode
$context

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft

Methods inherited from Commercetools\Core\Model\Common\JsonObject

__construct(), __get(), hasField(), isOptional()

Methods inherited from Commercetools\Core\Model\Common\AbstractJsonDeserializeObject

__sleep(), fromArray(), jsonSerialize(), of(), toArray()

Methods inherited from Commercetools\Core\Model\Common\ContextAwareInterface

getContext(), getContextCallback(), setContext(), setContextIfNull()

Methods inherited from Commercetools\Core\Model\Common\ObjectTreeInterface

parentSet(), rootGet(), rootSet()

Methods used from Commercetools\Core\Model\Common\ContextTrait

getContext(), getContextCallback(), setContext(), setContextIfNull()

Methods used from Commercetools\Core\Model\Common\ObjectTreeTrait

parentSet(), rootGet(), rootSet()

Magic methods summary

public Commercetools\Core\Model\Common\LocalizedString
# getName( )

Returns

Commercetools\Core\Model\Common\LocalizedString
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setName( Commercetools\Core\Model\Common\LocalizedString $name = null )

Parameters

$name

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public Commercetools\Core\Model\Common\LocalizedString
# getDescription( )

Returns

Commercetools\Core\Model\Common\LocalizedString
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setDescription( Commercetools\Core\Model\Common\LocalizedString $description = null )

Parameters

$description

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public Commercetools\Core\Model\CartDiscount\CartDiscountValue
# getValue( )

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountValue
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setValue( Commercetools\Core\Model\CartDiscount\CartDiscountValue $value = null )

Parameters

$value

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public string
# getCartPredicate( )

Returns

string
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setCartPredicate( string $cartPredicate = null )

Parameters

$cartPredicate

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public Commercetools\Core\Model\CartDiscount\CartDiscountTarget
# getTarget( )

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountTarget
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setTarget( Commercetools\Core\Model\CartDiscount\CartDiscountTarget $target = null )

Parameters

$target

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public string
# getSortOrder( )

Returns

string
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setSortOrder( string $sortOrder = null )

Parameters

$sortOrder

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public boolean
# getIsActive( )

Returns

boolean
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setIsActive( boolean $isActive = null )

Parameters

$isActive

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public Commercetools\Core\Model\Common\DateTimeDecorator
# getValidFrom( )

Returns

Commercetools\Core\Model\Common\DateTimeDecorator
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setValidFrom( DateTime $validFrom = null )

Parameters

$validFrom

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public Commercetools\Core\Model\Common\DateTimeDecorator
# getValidUntil( )

Returns

Commercetools\Core\Model\Common\DateTimeDecorator
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setValidUntil( DateTime $validUntil = null )

Parameters

$validUntil

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public boolean
# getRequiresDiscountCode( )

Returns

boolean
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setRequiresDiscountCode( boolean $requiresDiscountCode = null )

Parameters

$requiresDiscountCode

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public string
# getStackingMode( )

Returns

string
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setStackingMode( string $stackingMode = null )

Parameters

$stackingMode

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public Commercetools\Core\Model\CustomField\CustomFieldObjectDraft
# getCustom( )

Returns

Commercetools\Core\Model\CustomField\CustomFieldObjectDraft
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setCustom( Commercetools\Core\Model\CustomField\CustomFieldObjectDraft $custom = null )

Parameters

$custom

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft
public string
# getKey( )

Returns

string
public Commercetools\Core\Model\CartDiscount\CartDiscountDraft
# setKey( string $key = null )

Parameters

$key

Returns

Commercetools\Core\Model\CartDiscount\CartDiscountDraft

Constants summary

string NAME
# 'name'
string DESCRIPTION
# 'description'
string VALUE
# 'value'
string CART_PREDICATE
# 'cartPredicate'
string TARGET
# 'target'
string SORT_ORDER
# 'sortOrder'
string IS_ACTIVE
# 'isActive'
string VALID_FROM
# 'validFrom'
string VALID_UNTIL
# 'validUntil'
string REQUIRES_DISCOUNT_CODE
# 'requiresDiscountCode'
string STACKING_MODE
# 'stackingMode'
string CUSTOM
# 'custom'
string KEY
# 'key'

Constants inherited from Commercetools\Core\Model\Common\JsonObject

DECORATOR, ELEMENT_TYPE, INITIALIZED, OPTIONAL, TYPE

Constants inherited from Commercetools\Core\Model\Common\AbstractJsonDeserializeObject

JSON_DESERIALIZE_INTERFACE, TYPEABLE_INTERFACE

PHP SDK API documentation generated by ApiGen