Skip to content

Commit

Permalink
Feat/add information (#94)
Browse files Browse the repository at this point in the history
* add total without tax

* version increment

---------

Co-authored-by: ArthurLashermes <alashermes@openstudio.fr>
  • Loading branch information
ArthurLashermes and ArthurLashermes authored Jul 26, 2024
1 parent 0fb6fb2 commit 7327191
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.2.26</version>
<version>2.2.27</version>
<authors>
<author>
<name>Vincent Lopes-Vicente</name>
Expand Down
20 changes: 20 additions & 0 deletions Model/Api/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ class Cart extends BaseApiModel
*/
protected $items;

/**
* @var float
* @OA\Property(
* type="number",
* format="float",
* )
*/
protected $totalWithoutTax;
/**
* @var ContainerInterface
*/
Expand Down Expand Up @@ -187,6 +195,7 @@ function ($theliaCartItem) use ($modelFactory, $deliveryCountry) {
);

$this
->setTotalWithoutTax($theliaModel->getTotalAmount())
->setDeliveryTax($postageTax)
->setTaxes($theliaModel->getTotalVAT($deliveryCountry, null, false))
->setDelivery($estimatedPostage)
Expand Down Expand Up @@ -394,6 +403,17 @@ public function setItems($items)
return $this;
}

public function getTotalWithoutTax(): float
{
return $this->totalWithoutTax;
}

public function setTotalWithoutTax(float $totalWithoutTax): Cart
{
$this->totalWithoutTax = $totalWithoutTax;
return $this;
}

/**
* Creates an array of OpenApi coupons from an array of coupons codes, then returns it.
*
Expand Down

0 comments on commit 7327191

Please sign in to comment.