mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 15:41:24 +00:00
Fix
This commit is contained in:
@@ -4,18 +4,6 @@ use Money\Money;
|
|||||||
|
|
||||||
return [
|
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,
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Rounding strategy
|
| Rounding strategy
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Gloudemans\Shoppingcart\Exceptions;
|
|
||||||
|
|
||||||
use RuntimeException;
|
|
||||||
|
|
||||||
class InvalidCalculatorException extends RuntimeException
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -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.
|
* Get an instance of the cart.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user