![]() |
commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
|
Inherits Commercetools\Base\JsonObject.
Inherited by Commercetools\Api\Models\Cart\LineItemModel.
Public Attributes | |
| const | FIELD_ID = 'id' |
| const | FIELD_KEY = 'key' |
| const | FIELD_PRODUCT_ID = 'productId' |
| const | FIELD_PRODUCT_KEY = 'productKey' |
| const | FIELD_NAME = 'name' |
| const | FIELD_PRODUCT_SLUG = 'productSlug' |
| const | FIELD_PRODUCT_TYPE = 'productType' |
| const | FIELD_VARIANT = 'variant' |
| const | FIELD_PRICE = 'price' |
| const | FIELD_QUANTITY = 'quantity' |
| const | FIELD_TOTAL_PRICE = 'totalPrice' |
| const | FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity' |
| const | FIELD_TAXED_PRICE = 'taxedPrice' |
| const | FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions' |
| const | FIELD_STATE = 'state' |
| const | FIELD_TAX_RATE = 'taxRate' |
| const | FIELD_PER_METHOD_TAX_RATE = 'perMethodTaxRate' |
| const | FIELD_SUPPLY_CHANNEL = 'supplyChannel' |
| const | FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel' |
| const | FIELD_PRICE_MODE = 'priceMode' |
| const | FIELD_LINE_ITEM_MODE = 'lineItemMode' |
| const | FIELD_INVENTORY_MODE = 'inventoryMode' |
| const | FIELD_SHIPPING_DETAILS = 'shippingDetails' |
| const | FIELD_CUSTOM = 'custom' |
| const | FIELD_ADDED_AT = 'addedAt' |
| const | FIELD_LAST_MODIFIED_AT = 'lastModifiedAt' |
| const | FIELD_RECURRENCE_INFO = 'recurrenceInfo' |
Additional Inherited Members | |
Static Public Member Functions inherited from Commercetools\Base\JsonObject | |
| static | of ($data=null) |
| static | fromArray (array $data=[]) |
| static | fromStdClass (?stdClass $data=null) |
Definition at line 25 of file LineItem.php.
| Commercetools\Api\Models\Cart\LineItem::getAddedAt | ( | ) |
Date and time (UTC) the Line Item was added to the Cart.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getCustom | ( | ) |
Custom Fields of the Line Item.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getDiscountedPricePerQuantity | ( | ) |
Discounted price of a single quantity of the Line Item.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getDistributionChannel | ( | ) |
Used to select a Product Price. The referenced Channel has the ProductDistribution ChannelRoleEnum.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getId | ( | ) |
Unique identifier of the LineItem.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getInventoryMode | ( | ) |
Inventory mode specific to this Line Item only, and valid for the entire quantity of the Line Item. Only present if the inventory mode is different from the inventoryMode specified on the Cart.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getKey | ( | ) |
User-defined unique identifier of the LineItem.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getLastModifiedAt | ( | ) |
Date and time (UTC) the Line Item was last updated.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getLineItemMode | ( | ) |
Indicates how the Line Item is added to the Cart.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getName | ( | ) |
Name of the Product.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getPerMethodTaxRate | ( | ) |
Tax Rate per Shipping Method for a Cart with Multiple ShippingMode. For a Cart with Platform TaxMode it is automatically set after the Shipping Method is added. For a Cart with External TaxMode, the Tax Rate must be set with ExternalTaxRateDraft.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getPrice | ( | ) |
Price of a Line Item selected from the Product Variant according to the Product priceMode. If the priceMode is Embedded ProductPriceMode and the variant field hasn't been updated, the price may not correspond to a price in variant.prices.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getPriceMode | ( | ) |
Indicates how the Price for the Line Item is set.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getProductId | ( | ) |
id of the Product the Line Item is based on.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getProductKey | ( | ) |
key of the Product.
This field is only present on:
key is available on that specific Product at the time the LineItem was created or updated on the Cart. key is available on the specific Product at the time the Order was created from the Cart. Present on resources created or updated after 3 December 2021.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getProductSlug | ( | ) |
slug of the current version of the Product. Updated automatically if the slug changes. Empty if the Product has been deleted. The productSlug field of LineItem is not expanded when using Reference Expansion.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getProductType | ( | ) |
Product Type of the Product.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getQuantity | ( | ) |
Number of Line Items of the given Product Variant present in the Cart or Order.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getRecurrenceInfo | ( | ) |
Recurring Order and frequency data.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getShippingDetails | ( | ) |
Container for Line Item-specific addresses.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getState | ( | ) |
Tracks specific quantities of the Line Item within a given State. When a Line Item is added to a Cart, its full quantity is set to the built-in "Initial" state. State transitions for Line Items are managed on the Order.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getSupplyChannel | ( | ) |
Identifies Inventory entries that are reserved. The referenced Channel has the InventorySupply ChannelRoleEnum.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getTaxedPrice | ( | ) |
Automatically set after taxRate is set.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getTaxedPricePortions | ( | ) |
Total taxed prices based on the quantity of Line Item assigned to each Shipping Method. Only applicable for Carts with Multiple ShippingMode. Automatically set after perMethodTaxRate is set.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getTaxRate | ( | ) |
Platform TaxMode, the taxRate of Line Items is set automatically once a shipping address is set. The rate is based on the TaxCategory that applies for the shipping address. External TaxMode, the taxRate of Line Items can be set using ExternalTaxRateDraft. Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getTotalPrice | ( | ) |
Total price of this Line Item equalling price multiplied by quantity. If the Line Item is discounted, the total price is the discountedPricePerQuantity multiplied by quantity. Includes taxes if the TaxRate includedInPrice is true.
If ExternalPrice LineItemPriceMode is used with high-precision money, then the total price is rounded by using the HalfEven rounding mode.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::getVariant | ( | ) |
Holds the data of the Product Variant added to the Cart.
The data is saved at the time the Product Variant is added to the Cart and is not updated automatically when Product Variant data changes. Must be updated using the Recalculate update action.
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setAddedAt | ( | ?DateTimeImmutable | $addedAt | ) |
| ?DateTimeImmutable | $addedAt |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setCustom | ( | ?CustomFields | $custom | ) |
| ?CustomFields | $custom |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setDiscountedPricePerQuantity | ( | ?DiscountedLineItemPriceForQuantityCollection | $discountedPricePerQuantity | ) |
| ?DiscountedLineItemPriceForQuantityCollection | $discountedPricePerQuantity |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setDistributionChannel | ( | ?ChannelReference | $distributionChannel | ) |
| ?ChannelReference | $distributionChannel |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setId | ( | ?string | $id | ) |
| ?string | $id |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setInventoryMode | ( | ?string | $inventoryMode | ) |
| ?string | $inventoryMode |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setKey | ( | ?string | $key | ) |
| ?string | $key |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setLastModifiedAt | ( | ?DateTimeImmutable | $lastModifiedAt | ) |
| ?DateTimeImmutable | $lastModifiedAt |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setLineItemMode | ( | ?string | $lineItemMode | ) |
| ?string | $lineItemMode |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setName | ( | ?LocalizedString | $name | ) |
| ?LocalizedString | $name |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setPerMethodTaxRate | ( | ?MethodTaxRateCollection | $perMethodTaxRate | ) |
| ?MethodTaxRateCollection | $perMethodTaxRate |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setPrice | ( | ?Price | $price | ) |
| ?Price | $price |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setPriceMode | ( | ?string | $priceMode | ) |
| ?string | $priceMode |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setProductId | ( | ?string | $productId | ) |
| ?string | $productId |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setProductKey | ( | ?string | $productKey | ) |
| ?string | $productKey |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setProductSlug | ( | ?LocalizedString | $productSlug | ) |
| ?LocalizedString | $productSlug |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setProductType | ( | ?ProductTypeReference | $productType | ) |
| ?ProductTypeReference | $productType |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setQuantity | ( | ?int | $quantity | ) |
| ?int | $quantity |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setRecurrenceInfo | ( | ?LineItemRecurrenceInfo | $recurrenceInfo | ) |
| ?LineItemRecurrenceInfo | $recurrenceInfo |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setShippingDetails | ( | ?ItemShippingDetails | $shippingDetails | ) |
| ?ItemShippingDetails | $shippingDetails |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setState | ( | ?ItemStateCollection | $state | ) |
| ?ItemStateCollection | $state |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setSupplyChannel | ( | ?ChannelReference | $supplyChannel | ) |
| ?ChannelReference | $supplyChannel |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setTaxedPrice | ( | ?TaxedItemPrice | $taxedPrice | ) |
| ?TaxedItemPrice | $taxedPrice |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setTaxedPricePortions | ( | ?MethodTaxedPriceCollection | $taxedPricePortions | ) |
| ?MethodTaxedPriceCollection | $taxedPricePortions |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setTaxRate | ( | ?TaxRate | $taxRate | ) |
| ?TaxRate | $taxRate |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setTotalPrice | ( | ?CentPrecisionMoney | $totalPrice | ) |
| ?CentPrecisionMoney | $totalPrice |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| Commercetools\Api\Models\Cart\LineItem::setVariant | ( | ?ProductVariant | $variant | ) |
| ?ProductVariant | $variant |
Implemented in Commercetools\Api\Models\Cart\LineItemModel.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_ADDED_AT = 'addedAt' |
Definition at line 51 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_CUSTOM = 'custom' |
Definition at line 50 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity' |
Definition at line 38 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel' |
Definition at line 45 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_ID = 'id' |
Definition at line 27 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_INVENTORY_MODE = 'inventoryMode' |
Definition at line 48 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_KEY = 'key' |
Definition at line 28 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_LAST_MODIFIED_AT = 'lastModifiedAt' |
Definition at line 52 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_LINE_ITEM_MODE = 'lineItemMode' |
Definition at line 47 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_NAME = 'name' |
Definition at line 31 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_PER_METHOD_TAX_RATE = 'perMethodTaxRate' |
Definition at line 43 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_PRICE = 'price' |
Definition at line 35 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_PRICE_MODE = 'priceMode' |
Definition at line 46 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_PRODUCT_ID = 'productId' |
Definition at line 29 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_PRODUCT_KEY = 'productKey' |
Definition at line 30 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_PRODUCT_SLUG = 'productSlug' |
Definition at line 32 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_PRODUCT_TYPE = 'productType' |
Definition at line 33 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_QUANTITY = 'quantity' |
Definition at line 36 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_RECURRENCE_INFO = 'recurrenceInfo' |
Definition at line 53 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_SHIPPING_DETAILS = 'shippingDetails' |
Definition at line 49 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_STATE = 'state' |
Definition at line 41 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_SUPPLY_CHANNEL = 'supplyChannel' |
Definition at line 44 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_TAX_RATE = 'taxRate' |
Definition at line 42 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_TAXED_PRICE = 'taxedPrice' |
Definition at line 39 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions' |
Definition at line 40 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_TOTAL_PRICE = 'totalPrice' |
Definition at line 37 of file LineItem.php.
| const Commercetools\Api\Models\Cart\LineItem::FIELD_VARIANT = 'variant' |
Definition at line 34 of file LineItem.php.