This commit is contained in:
Patrick Henninger
2022-02-05 23:50:14 +01:00
parent 6d97194b9b
commit f7d6c5df7a
3 changed files with 0 additions and 38 deletions

View File

@@ -3,18 +3,6 @@
use Money\Money;
return [
/*
|--------------------------------------------------------------------------
| Gross price as base price
|--------------------------------------------------------------------------
|
| This default value is used to select the method to calculate prices and taxes
| If true the item price is managed as a gross price, so taxes will be calculated by separation/exclusion
|
*/
'calculator' => \Gloudemans\Shoppingcart\Calculation\DefaultCalculator::class,
/*
|--------------------------------------------------------------------------

View File

@@ -1,9 +0,0 @@
<?php
namespace Gloudemans\Shoppingcart\Exceptions;
use RuntimeException;
class InvalidCalculatorException extends RuntimeException
{
}

View File

@@ -1306,23 +1306,6 @@ class CartTest extends TestCase
});
}
/** @test */
public function it_use_gross_price_as_base_price()
{
$cart = $this->getCartDiscount(0);
config(['cart.calculator' => GrossPrice::class]);
$cartItem = $cart->add(new BuyableProduct([
'name' => 'First item',
'price' => 100,
]), 2);
$cart->setGlobalTax(22);
// check net price
$this->assertEquals(new Money(8197, new Currency('USD')), $cartItem->priceNet);
}
/**
* Get an instance of the cart.
*