diff --git a/src/Cart.php b/src/Cart.php index e448979..85316d9 100644 --- a/src/Cart.php +++ b/src/Cart.php @@ -310,7 +310,6 @@ public function isCommercialCart() /** * Determines if current cart is enabled built-in tax system - * This is only possible if the cart is empty * * @return boolean */ @@ -784,7 +783,7 @@ public function getTaxRate() } /** - * Get the total tax rate applied to the current cart. + * Get the total tax amount applied to the current cart. * * @return float */ diff --git a/src/Config/config.php b/src/Config/config.php index 4d71ac5..07ee0ed 100644 --- a/src/Config/config.php +++ b/src/Config/config.php @@ -33,7 +33,7 @@ |-------------------------------------------------------------------------- | | This setting allows you to set the default state of using the built-in - | tax system or not every time you create a new cart + | taxing system or not every time you initialize the cart. | */ 'use_builtin_tax' => true, @@ -65,7 +65,7 @@ 'taxable' => true, 'allow_others_disable' => true, 'disable_others' => null, - 'include_calculations' => 'previous_actions', + 'include_calculations' => 'same_group_previous_actions', 'max_amount' => null, 'min_amount' => null ], @@ -75,7 +75,7 @@ | Action groups order |-------------------------------------------------------------------------- | - | This setting allows to prioritize groups of actions in ascending order. + | This setting allows to prioritize groups of actions in descending order. | If not set, actions will be sorted according to the time of applied. In | contrast, the actions will be sorted by groups order first, then sorted | by the time of applied. diff --git a/src/Item.php b/src/Item.php index a7291f3..e762a85 100644 --- a/src/Item.php +++ b/src/Item.php @@ -34,7 +34,6 @@ class Item implements CartNode 'taxable' => true, 'options' => [], 'extra_info' => [], - 'applied_actions' => null ]; /** @@ -46,6 +45,13 @@ class Item implements CartNode ItemsContainer::class ]; + /** + * Stores applied actions + * + * @var Illuminate\Support\Collection + */ + protected $appliedActions; + /** * Indicates whether or not this item belong to a commercial cart * @@ -166,7 +172,7 @@ public function getFilterValues() { return array_merge([ 'hash' => $this->getHash() - ], Arr::except($this->attributes, ['applied_actions'])); + ], $this->attributes); } /** @@ -321,7 +327,7 @@ protected function initAttributes(array $attributes = []) $this->setAttributes($attributes); // Creates the actions container - $this->attributes['applied_actions'] = new ActionsContainer; + $this->appliedActions = new ActionsContainer; return $this; } @@ -438,7 +444,7 @@ protected function setOptions(array $options = []) protected function getActionsContainer() { if ($this->inCommercialCart) { - return $this->attributes['applied_actions']; + return $this->appliedActions; } return new ActionsContainer;