Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Totals Class Reference
Inheritance diagram for Totals:
AbstractExtensibleModel TotalsInterface AbstractModel CustomAttributesDataInterface ExtensibleDataInterface DataObject ExtensibleDataInterface

Public Member Functions

 getGrandTotal ()
 
 setGrandTotal ($grandTotal)
 
 getBaseGrandTotal ()
 
 setBaseGrandTotal ($baseGrandTotal)
 
 getSubtotal ()
 
 setSubtotal ($subtotal)
 
 getBaseSubtotal ()
 
 setBaseSubtotal ($baseSubtotal)
 
 getDiscountAmount ()
 
 setDiscountAmount ($discountAmount)
 
 getBaseDiscountAmount ()
 
 setBaseDiscountAmount ($baseDiscountAmount)
 
 getSubtotalWithDiscount ()
 
 setSubtotalWithDiscount ($subtotalWithDiscount)
 
 getBaseSubtotalWithDiscount ()
 
 setBaseSubtotalWithDiscount ($baseSubtotalWithDiscount)
 
 getShippingAmount ()
 
 setShippingAmount ($shippingAmount)
 
 getBaseShippingAmount ()
 
 setBaseShippingAmount ($baseShippingAmount)
 
 getShippingDiscountAmount ()
 
 setShippingDiscountAmount ($shippingDiscountAmount)
 
 getBaseShippingDiscountAmount ()
 
 setBaseShippingDiscountAmount ($baseShippingDiscountAmount)
 
 getTaxAmount ()
 
 setTaxAmount ($taxAmount)
 
 getBaseTaxAmount ()
 
 setBaseTaxAmount ($baseTaxAmount)
 
 getWeeeTaxAppliedAmount ()
 
 setWeeeTaxAppliedAmount ($weeeTaxAppliedAmount)
 
 getShippingTaxAmount ()
 
 setShippingTaxAmount ($shippingTaxAmount)
 
 getBaseShippingTaxAmount ()
 
 setBaseShippingTaxAmount ($baseShippingTaxAmount)
 
 getSubtotalInclTax ()
 
 setSubtotalInclTax ($subtotalInclTax)
 
 getBaseSubtotalInclTax ()
 
 setBaseSubtotalInclTax ($baseSubtotalInclTax)
 
 getShippingInclTax ()
 
 setShippingInclTax ($shippingInclTax)
 
 getBaseShippingInclTax ()
 
 setBaseShippingInclTax ($baseShippingInclTax)
 
 getBaseCurrencyCode ()
 
 setBaseCurrencyCode ($baseCurrencyCode)
 
 getQuoteCurrencyCode ()
 
 setQuoteCurrencyCode ($quoteCurrencyCode)
 
 getCouponCode ()
 
 setCouponCode ($couponCode)
 
 getItemsQty ()
 
 setItemsQty ($itemsQty=null)
 
 getItems ()
 
 setItems (array $items=null)
 
 getTotalSegments ()
 
 setTotalSegments ($totals=[])
 
 getExtensionAttributes ()
 
 setExtensionAttributes (\Magento\Quote\Api\Data\TotalsExtensionInterface $extensionAttributes)
 
- Public Member Functions inherited from AbstractExtensibleModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, ExtensionAttributesFactory $extensionFactory, AttributeValueFactory $customAttributeFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 getCustomAttributes ()
 
 getCustomAttribute ($attributeCode)
 
 setCustomAttributes (array $attributes)
 
 setCustomAttribute ($attributeCode, $attributeValue)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 setId ($value)
 
 __sleep ()
 
 __wakeup ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 
- Public Member Functions inherited from TotalsInterface
 setExtensionAttributes (\Magento\Quote\Api\Data\TotalsExtensionInterface $extensionAttributes)
 

Additional Inherited Members

- Data Fields inherited from CustomAttributesDataInterface
const CUSTOM_ATTRIBUTES = 'custom_attributes'
 
- Data Fields inherited from ExtensibleDataInterface
const EXTENSION_ATTRIBUTES_KEY = 'extension_attributes'
 
- Data Fields inherited from TotalsInterface
const KEY_GRAND_TOTAL = 'grand_total'
 
const KEY_BASE_GRAND_TOTAL = 'base_grand_total'
 
const KEY_SUBTOTAL = 'subtotal'
 
const KEY_BASE_SUBTOTAL = 'base_subtotal'
 
const KEY_DISCOUNT_AMOUNT = 'discount_amount'
 
const KEY_BASE_DISCOUNT_AMOUNT = 'base_discount_amount'
 
const KEY_SUBTOTAL_WITH_DISCOUNT = 'subtotal_with_discount'
 
const KEY_BASE_SUBTOTAL_WITH_DISCOUNT = 'base_subtotal_with_discount'
 
const KEY_SHIPPING_AMOUNT = 'shipping_amount'
 
const KEY_BASE_SHIPPING_AMOUNT = 'base_shipping_amount'
 
const KEY_SHIPPING_DISCOUNT_AMOUNT = 'shipping_discount_amount'
 
const KEY_BASE_SHIPPING_DISCOUNT_AMOUNT = 'base_shipping_discount_amount'
 
const KEY_TAX_AMOUNT = 'tax_amount'
 
const KEY_BASE_TAX_AMOUNT = 'base_tax_amount'
 
const KEY_WEEE_TAX_APPLIED_AMOUNT = 'weee_tax_applied_amount'
 
const KEY_SHIPPING_TAX_AMOUNT = 'shipping_tax_amount'
 
const KEY_BASE_SHIPPING_TAX_AMOUNT = 'base_shipping_tax_amount'
 
const KEY_SUBTOTAL_INCL_TAX = 'subtotal_incl_tax'
 
const KEY_BASE_SUBTOTAL_INCL_TAX = 'base_subtotal_incl_tax'
 
const KEY_SHIPPING_INCL_TAX = 'shipping_incl_tax'
 
const KEY_BASE_SHIPPING_INCL_TAX = 'base_shipping_incl_tax'
 
const KEY_BASE_CURRENCY_CODE = 'base_currency_code'
 
const KEY_QUOTE_CURRENCY_CODE = 'quote_currency_code'
 
const KEY_COUPON_CODE = 'coupon_code'
 
const KEY_ITEMS = 'items'
 
const KEY_TOTAL_SEGMENTS = 'total_segments'
 
const KEY_ITEMS_QTY = 'items_qty'
 
- Protected Member Functions inherited from AbstractExtensibleModel
 filterCustomAttributes ($data)
 
 initializeCustomAttributes ()
 
 convertCustomAttributeValues (array &$customAttributes)
 
 getCustomAttributesCodes ()
 
 _setExtensionAttributes (\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)
 
 _getExtensionAttributes ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 
- Protected Attributes inherited from AbstractExtensibleModel
 $extensionAttributesFactory
 
 $extensionAttributes
 
 $customAttributeFactory
 
 $customAttributesCodes = null
 
 $customAttributesChanged = false
 
- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Cart Totals

@SuppressWarnings(PHPMD.ExcessivePublicCount) @codeCoverageIgnore

Definition at line 17 of file Totals.php.

Member Function Documentation

◆ getBaseCurrencyCode()

getBaseCurrencyCode ( )

Get base currency code

Returns
string|null

Implements TotalsInterface.

Definition at line 465 of file Totals.php.

466  {
467  return $this->getData(self::KEY_BASE_CURRENCY_CODE);
468  }

◆ getBaseDiscountAmount()

getBaseDiscountAmount ( )

Get discount amount in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 129 of file Totals.php.

130  {
131  return $this->getData(self::KEY_BASE_DISCOUNT_AMOUNT);
132  }

◆ getBaseGrandTotal()

getBaseGrandTotal ( )

Get grand total in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 45 of file Totals.php.

46  {
47  return $this->getData(self::KEY_BASE_GRAND_TOTAL);
48  }

◆ getBaseShippingAmount()

getBaseShippingAmount ( )

Get shipping amount in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 213 of file Totals.php.

214  {
215  return $this->getData(self::KEY_BASE_SHIPPING_AMOUNT);
216  }

◆ getBaseShippingDiscountAmount()

getBaseShippingDiscountAmount ( )

Get shipping discount amount in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 255 of file Totals.php.

256  {
257  return $this->getData(self::KEY_BASE_SHIPPING_DISCOUNT_AMOUNT);
258  }

◆ getBaseShippingInclTax()

getBaseShippingInclTax ( )

Get shipping including tax in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 444 of file Totals.php.

445  {
446  return $this->getData(self::KEY_BASE_SHIPPING_INCL_TAX);
447  }

◆ getBaseShippingTaxAmount()

getBaseShippingTaxAmount ( )

Get shipping tax amount in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 360 of file Totals.php.

361  {
362  return $this->getData(self::KEY_BASE_SHIPPING_TAX_AMOUNT);
363  }

◆ getBaseSubtotal()

getBaseSubtotal ( )

Get subtotal in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 87 of file Totals.php.

88  {
89  return $this->getData(self::KEY_BASE_SUBTOTAL);
90  }

◆ getBaseSubtotalInclTax()

getBaseSubtotalInclTax ( )

Get subtotal including tax in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 402 of file Totals.php.

403  {
404  return $this->getData(self::KEY_BASE_SUBTOTAL_INCL_TAX);
405  }

◆ getBaseSubtotalWithDiscount()

getBaseSubtotalWithDiscount ( )

Get subtotal in base currency with applied discount

Returns
float|null

Implements TotalsInterface.

Definition at line 171 of file Totals.php.

172  {
173  return $this->getData(self::KEY_BASE_SUBTOTAL_WITH_DISCOUNT);
174  }

◆ getBaseTaxAmount()

getBaseTaxAmount ( )

Get tax amount in base currency

Returns
float|null

Implements TotalsInterface.

Definition at line 297 of file Totals.php.

298  {
299  return $this->getData(self::KEY_BASE_TAX_AMOUNT);
300  }

◆ getCouponCode()

getCouponCode ( )

{Get applied coupon code

Returns
string|null
}

Implements TotalsInterface.

Definition at line 505 of file Totals.php.

506  {
507  return $this->getData(self::KEY_COUPON_CODE);
508  }

◆ getDiscountAmount()

getDiscountAmount ( )

Get discount amount in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 108 of file Totals.php.

109  {
110  return $this->getData(self::KEY_DISCOUNT_AMOUNT);
111  }

◆ getExtensionAttributes()

getExtensionAttributes ( )

{Retrieve existing extension attributes object or create a new one.

Returns
\Magento\Quote\Api\Data\TotalsExtensionInterface|null
}

Returns
\Magento\Quote\Api\Data\TotalsExtensionInterface|null

Implements TotalsInterface.

Definition at line 581 of file Totals.php.

◆ getGrandTotal()

getGrandTotal ( )

Get grand total in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 24 of file Totals.php.

25  {
26  return $this->getData(self::KEY_GRAND_TOTAL);
27  }

◆ getItems()

getItems ( )

Get totals by items

Returns
\Magento\Quote\Api\Data\TotalsItemInterface[]|null

Implements TotalsInterface.

Definition at line 544 of file Totals.php.

545  {
546  return $this->getData(self::KEY_ITEMS);
547  }

◆ getItemsQty()

getItemsQty ( )

Get items qty

Returns
int||null

Implements TotalsInterface.

Definition at line 523 of file Totals.php.

524  {
525  return $this->getData(self::KEY_ITEMS_QTY);
526  }

◆ getQuoteCurrencyCode()

getQuoteCurrencyCode ( )

Get quote currency code

Returns
string|null

Implements TotalsInterface.

Definition at line 486 of file Totals.php.

487  {
488  return $this->getData(self::KEY_QUOTE_CURRENCY_CODE);
489  }

◆ getShippingAmount()

getShippingAmount ( )

Get shipping amount in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 192 of file Totals.php.

193  {
194  return $this->getData(self::KEY_SHIPPING_AMOUNT);
195  }

◆ getShippingDiscountAmount()

getShippingDiscountAmount ( )

Get shipping discount amount in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 234 of file Totals.php.

235  {
236  return $this->getData(self::KEY_SHIPPING_DISCOUNT_AMOUNT);
237  }

◆ getShippingInclTax()

getShippingInclTax ( )

Get shipping including tax in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 423 of file Totals.php.

424  {
425  return $this->getData(self::KEY_SHIPPING_INCL_TAX);
426  }

◆ getShippingTaxAmount()

getShippingTaxAmount ( )

Get shipping tax amount in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 339 of file Totals.php.

340  {
341  return $this->getData(self::KEY_SHIPPING_TAX_AMOUNT);
342  }

◆ getSubtotal()

getSubtotal ( )

Get subtotal in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 66 of file Totals.php.

67  {
68  return $this->getData(self::KEY_SUBTOTAL);
69  }

◆ getSubtotalInclTax()

getSubtotalInclTax ( )

Get subtotal including tax in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 381 of file Totals.php.

382  {
383  return $this->getData(self::KEY_SUBTOTAL_INCL_TAX);
384  }

◆ getSubtotalWithDiscount()

getSubtotalWithDiscount ( )

Get subtotal in quote currency with applied discount

Returns
float|null

Implements TotalsInterface.

Definition at line 150 of file Totals.php.

151  {
152  return $this->getData(self::KEY_SUBTOTAL_WITH_DISCOUNT);
153  }

◆ getTaxAmount()

getTaxAmount ( )

Get tax amount in quote currency

Returns
float|null

Implements TotalsInterface.

Definition at line 276 of file Totals.php.

277  {
278  return $this->getData(self::KEY_TAX_AMOUNT);
279  }

◆ getTotalSegments()

getTotalSegments ( )

{Get dynamically calculated totals

Returns
\Magento\Quote\Api\Data\TotalSegmentInterface[]
}

Implements TotalsInterface.

Definition at line 563 of file Totals.php.

564  {
565  return $this->getData(self::KEY_TOTAL_SEGMENTS);
566  }

◆ getWeeeTaxAppliedAmount()

getWeeeTaxAppliedAmount ( )

Returns the total weee tax applied amount in quote currency.

Returns
float Item weee tax applied amount in quote currency.

Implements TotalsInterface.

Definition at line 318 of file Totals.php.

319  {
320  return $this->getData(self::KEY_WEEE_TAX_APPLIED_AMOUNT);
321  }

◆ setBaseCurrencyCode()

setBaseCurrencyCode (   $baseCurrencyCode)

Set base currency code

Parameters
string$baseCurrencyCode
Returns
$this

Implements TotalsInterface.

Definition at line 476 of file Totals.php.

477  {
478  return $this->setData(self::KEY_BASE_CURRENCY_CODE, $baseCurrencyCode);
479  }

◆ setBaseDiscountAmount()

setBaseDiscountAmount (   $baseDiscountAmount)

Set discount amount in base currency

Parameters
float$baseDiscountAmount
Returns
$this

Implements TotalsInterface.

Definition at line 140 of file Totals.php.

141  {
142  return $this->setData(self::KEY_BASE_DISCOUNT_AMOUNT, $baseDiscountAmount);
143  }

◆ setBaseGrandTotal()

setBaseGrandTotal (   $baseGrandTotal)

Set grand total in base currency

Parameters
float$baseGrandTotal
Returns
$this

Implements TotalsInterface.

Definition at line 56 of file Totals.php.

57  {
58  return $this->setData(self::KEY_BASE_GRAND_TOTAL, $baseGrandTotal);
59  }

◆ setBaseShippingAmount()

setBaseShippingAmount (   $baseShippingAmount)

Set shipping amount in base currency

Parameters
float$baseShippingAmount
Returns
$this

Implements TotalsInterface.

Definition at line 224 of file Totals.php.

225  {
226  return $this->setData(self::KEY_BASE_SHIPPING_AMOUNT, $baseShippingAmount);
227  }

◆ setBaseShippingDiscountAmount()

setBaseShippingDiscountAmount (   $baseShippingDiscountAmount)

Set shipping discount amount in base currency

Parameters
float$baseShippingDiscountAmount
Returns
$this

Implements TotalsInterface.

Definition at line 266 of file Totals.php.

267  {
268  return $this->setData(self::KEY_BASE_SHIPPING_DISCOUNT_AMOUNT, $baseShippingDiscountAmount);
269  }

◆ setBaseShippingInclTax()

setBaseShippingInclTax (   $baseShippingInclTax)

Set shipping including tax in base currency

Parameters
float$baseShippingInclTax
Returns
$this

Implements TotalsInterface.

Definition at line 455 of file Totals.php.

456  {
457  return $this->setData(self::KEY_BASE_SHIPPING_INCL_TAX, $baseShippingInclTax);
458  }

◆ setBaseShippingTaxAmount()

setBaseShippingTaxAmount (   $baseShippingTaxAmount)

Set shipping tax amount in base currency

Parameters
float$baseShippingTaxAmount
Returns
$this

Implements TotalsInterface.

Definition at line 371 of file Totals.php.

372  {
373  return $this->setData(self::KEY_BASE_SHIPPING_TAX_AMOUNT, $baseShippingTaxAmount);
374  }

◆ setBaseSubtotal()

setBaseSubtotal (   $baseSubtotal)

Set subtotal in base currency

Parameters
float$baseSubtotal
Returns
$this

Implements TotalsInterface.

Definition at line 98 of file Totals.php.

99  {
100  return $this->setData(self::KEY_BASE_SUBTOTAL, $baseSubtotal);
101  }

◆ setBaseSubtotalInclTax()

setBaseSubtotalInclTax (   $baseSubtotalInclTax)

Set subtotal including tax in base currency

Parameters
float$baseSubtotalInclTax
Returns
$this

Implements TotalsInterface.

Definition at line 413 of file Totals.php.

414  {
415  return $this->setData(self::KEY_BASE_SUBTOTAL_INCL_TAX, $baseSubtotalInclTax);
416  }

◆ setBaseSubtotalWithDiscount()

setBaseSubtotalWithDiscount (   $baseSubtotalWithDiscount)

Set subtotal in base currency with applied discount

Parameters
float$baseSubtotalWithDiscount
Returns
$this

Implements TotalsInterface.

Definition at line 182 of file Totals.php.

183  {
184  return $this->setData(self::KEY_BASE_SUBTOTAL_WITH_DISCOUNT, $baseSubtotalWithDiscount);
185  }

◆ setBaseTaxAmount()

setBaseTaxAmount (   $baseTaxAmount)

Set tax amount in base currency

Parameters
float$baseTaxAmount
Returns
$this

Implements TotalsInterface.

Definition at line 308 of file Totals.php.

309  {
310  return $this->setData(self::KEY_BASE_TAX_AMOUNT, $baseTaxAmount);
311  }

◆ setCouponCode()

setCouponCode (   $couponCode)

{Set applied coupon code

Parameters
string$couponCode
Returns
$this
}

Implements TotalsInterface.

Definition at line 513 of file Totals.php.

514  {
515  return $this->setData(self::KEY_COUPON_CODE, $couponCode);
516  }

◆ setDiscountAmount()

setDiscountAmount (   $discountAmount)

Set discount amount in quote currency

Parameters
float$discountAmount
Returns
$this

Implements TotalsInterface.

Definition at line 119 of file Totals.php.

120  {
121  return $this->setData(self::KEY_DISCOUNT_AMOUNT, $discountAmount);
122  }

◆ setExtensionAttributes()

setExtensionAttributes ( \Magento\Quote\Api\Data\TotalsExtensionInterface  $extensionAttributes)

{}

Parameters
\Magento\Quote\Api\Data\TotalsExtensionInterface$extensionAttributes
Returns
$this

Definition at line 592 of file Totals.php.

593  {
595  }
_setExtensionAttributes(\Magento\Framework\Api\ExtensionAttributesInterface $extensionAttributes)

◆ setGrandTotal()

setGrandTotal (   $grandTotal)

Set grand total in quote currency

Parameters
float$grandTotal
Returns
$this

Implements TotalsInterface.

Definition at line 35 of file Totals.php.

36  {
37  return $this->setData(self::KEY_GRAND_TOTAL, $grandTotal);
38  }

◆ setItems()

setItems ( array  $items = null)

Get totals by items

Parameters

Implements TotalsInterface.

Definition at line 555 of file Totals.php.

556  {
557  return $this->setData(self::KEY_ITEMS, $items);
558  }
$items

◆ setItemsQty()

setItemsQty (   $itemsQty = null)

Set items qty

Parameters
int$itemsQty
Returns
$this

Implements TotalsInterface.

Definition at line 534 of file Totals.php.

535  {
536  return $this->setData(self::KEY_ITEMS_QTY, $itemsQty);
537  }

◆ setQuoteCurrencyCode()

setQuoteCurrencyCode (   $quoteCurrencyCode)

Get quote currency code

Parameters
string$quoteCurrencyCode
Returns
$this

Implements TotalsInterface.

Definition at line 497 of file Totals.php.

498  {
499  return $this->setData(self::KEY_QUOTE_CURRENCY_CODE, $quoteCurrencyCode);
500  }

◆ setShippingAmount()

setShippingAmount (   $shippingAmount)

Set shipping amount in quote currency

Parameters
float$shippingAmount
Returns
$this

Implements TotalsInterface.

Definition at line 203 of file Totals.php.

204  {
205  return $this->setData(self::KEY_SHIPPING_AMOUNT, $shippingAmount);
206  }

◆ setShippingDiscountAmount()

setShippingDiscountAmount (   $shippingDiscountAmount)

Set shipping discount amount in quote currency

Parameters
float$shippingDiscountAmount
Returns
$this

Implements TotalsInterface.

Definition at line 245 of file Totals.php.

246  {
247  return $this->setData(self::KEY_SHIPPING_DISCOUNT_AMOUNT, $shippingDiscountAmount);
248  }

◆ setShippingInclTax()

setShippingInclTax (   $shippingInclTax)

Set shipping including tax in quote currency

Parameters
float$shippingInclTax
Returns
$this

Implements TotalsInterface.

Definition at line 434 of file Totals.php.

435  {
436  return $this->setData(self::KEY_SHIPPING_INCL_TAX, $shippingInclTax);
437  }

◆ setShippingTaxAmount()

setShippingTaxAmount (   $shippingTaxAmount)

Set shipping tax amount in quote currency

Parameters
float$shippingTaxAmount
Returns
$this

Implements TotalsInterface.

Definition at line 350 of file Totals.php.

351  {
352  return $this->setData(self::KEY_SHIPPING_TAX_AMOUNT, $shippingTaxAmount);
353  }

◆ setSubtotal()

setSubtotal (   $subtotal)

Set subtotal in quote currency

Parameters
float$subtotal
Returns
$this

Implements TotalsInterface.

Definition at line 77 of file Totals.php.

78  {
79  return $this->setData(self::KEY_SUBTOTAL, $subtotal);
80  }

◆ setSubtotalInclTax()

setSubtotalInclTax (   $subtotalInclTax)

Set subtotal including tax in quote currency

Parameters
float$subtotalInclTax
Returns
$this

Implements TotalsInterface.

Definition at line 392 of file Totals.php.

393  {
394  return $this->setData(self::KEY_SUBTOTAL_INCL_TAX, $subtotalInclTax);
395  }

◆ setSubtotalWithDiscount()

setSubtotalWithDiscount (   $subtotalWithDiscount)

Set subtotal in quote currency with applied discount

Parameters
float$subtotalWithDiscount
Returns
$this

Implements TotalsInterface.

Definition at line 161 of file Totals.php.

162  {
163  return $this->setData(self::KEY_SUBTOTAL_WITH_DISCOUNT, $subtotalWithDiscount);
164  }

◆ setTaxAmount()

setTaxAmount (   $taxAmount)

Set tax amount in quote currency

Parameters
float$taxAmount
Returns
$this

Implements TotalsInterface.

Definition at line 287 of file Totals.php.

288  {
289  return $this->setData(self::KEY_TAX_AMOUNT, $taxAmount);
290  }

◆ setTotalSegments()

setTotalSegments (   $totals = [])

{Set dynamically calculated totals

Parameters
}

Implements TotalsInterface.

Definition at line 571 of file Totals.php.

572  {
573  return $this->setData(self::KEY_TOTAL_SEGMENTS, $totals);
574  }
$totals
Definition: totalbar.phtml:10

◆ setWeeeTaxAppliedAmount()

setWeeeTaxAppliedAmount (   $weeeTaxAppliedAmount)

Sets the total weee tax applied amount in quote currency.

Parameters
float$weeeTaxAppliedAmount
Returns
$this

Implements TotalsInterface.

Definition at line 329 of file Totals.php.

330  {
331  return $this->setData(self::KEY_WEEE_TAX_APPLIED_AMOUNT, $weeeTaxAppliedAmount);
332  }

The documentation for this class was generated from the following file: