This reverts commit 5d117a0acd.
This commit is contained in:
Patrick Henninger
2019-01-09 12:22:25 +01:00
parent 13238f9883
commit 55f1c4617f
7 changed files with 21 additions and 211 deletions

View File

@@ -424,33 +424,6 @@ class Cart
return $this->numberFormat($this->initialFloat(), $decimals, $decimalPoint, $thousandSeperator);
}
/**
* Get the total weight of the items in the cart.
*
* @return float
*/
public function weightFloat()
{
$content = $this->getContent();
$total = $content->reduce(function ($total, CartItem $cartItem) {
return $total + ($cartItem->qty * $cartItem->weight);
}, 0);
return $total;
}
/**
* Get the total weight of the items in the cart.
*
* @param int $decimals
* @param string $decimalPoint
* @param string $thousandSeperator
* @return string
*/
public function weight($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
return $this->numberFormat($this->weightFloat(), $decimals, $decimalPoint, $thousandSeperator);
}
/**
* Search the cart content for a cart item matching the given search closure.
*
@@ -630,12 +603,12 @@ class Cart
* @param mixed $identifier Identifier of the Cart to merge with.
* @param bool $keepDiscount Keep the discount of the CartItems.
* @param bool $keepTax Keep the tax of the CartItems.
* @return bool
* @return void
*/
public function merge( $identifier, $keepDiscount = false, $keepTax = false )
{
if( ! $this->storedCartWithIdentifierExists($identifier)) {
return false;
return;
}
$stored = $this->getConnection()->table($this->getTableName())
@@ -646,8 +619,6 @@ class Cart
foreach ($storedContent as $cartItem) {
$this->addCartItem($cartItem, $keepDiscount, $keepTax);
}
return true;
}
/**