Patrick Henninger
2018-12-28 03:50:42 +01:00
parent 4a2ae61ed4
commit 1190d72b52
5 changed files with 13 additions and 13 deletions

View File

@@ -174,7 +174,7 @@ Cart::total();
The method will automatically format the result, which you can tweak using the three optional parameters The method will automatically format the result, which you can tweak using the three optional parameters
```php ```php
Cart::total($decimals, $decimalSeperator, $thousandSeperator); Cart::total($decimals, $decimalSeparator, $thousandSeparator);
``` ```
You can set the default number format in the config file. You can set the default number format in the config file.
@@ -192,7 +192,7 @@ Cart::tax();
The method will automatically format the result, which you can tweak using the three optional parameters The method will automatically format the result, which you can tweak using the three optional parameters
```php ```php
Cart::tax($decimals, $decimalSeperator, $thousandSeperator); Cart::tax($decimals, $decimalSeparator, $thousandSeparator);
``` ```
You can set the default number format in the config file. You can set the default number format in the config file.
@@ -210,7 +210,7 @@ Cart::subtotal();
The method will automatically format the result, which you can tweak using the three optional parameters The method will automatically format the result, which you can tweak using the three optional parameters
```php ```php
Cart::subtotal($decimals, $decimalSeperator, $thousandSeperator); Cart::subtotal($decimals, $decimalSeparator, $thousandSeparator);
``` ```
You can set the default number format in the config file. You can set the default number format in the config file.
@@ -228,7 +228,7 @@ Cart::discount();
The method will automatically format the result, which you can tweak using the three optional parameters The method will automatically format the result, which you can tweak using the three optional parameters
```php ```php
Cart::discount($decimals, $decimalSeperator, $thousandSeperator); Cart::discount($decimals, $decimalSeparator, $thousandSeparator);
``` ```
You can set the default number format in the config file. You can set the default number format in the config file.
@@ -246,7 +246,7 @@ Cart::initial();
The method will automatically format the result, which you can tweak using the three optional parameters The method will automatically format the result, which you can tweak using the three optional parameters
```php ```php
Cart::initial($decimals, $decimalSeperator, $thousandSeperator); Cart::initial($decimals, $decimalSeparator, $thousandSeparator);
``` ```
You can set the default number format in the config file. You can set the default number format in the config file.

View File

@@ -49,7 +49,7 @@ return [
| Default number format | Default number format
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This defaults will be used for the formated numbers if you don't | This defaults will be used for the formatted numbers if you don't
| set them in the method call. | set them in the method call.
| |
*/ */
@@ -60,7 +60,7 @@ return [
'decimal_point' => '.', 'decimal_point' => '.',
'thousand_seperator' => ',' 'thousand_separator' => ','
], ],

View File

@@ -575,11 +575,11 @@ class Cart
$stored = $this->getConnection()->table($this->getTableName()) $stored = $this->getConnection()->table($this->getTableName())
->where('identifier', $identifier)->first(); ->where('identifier', $identifier)->first();
$storedContent = unserialize($stored->content); $storedContent = unserialize(data_get($stored, 'content'));
$currentInstance = $this->currentInstance(); $currentInstance = $this->currentInstance();
$this->instance($stored->instance); $this->instance(data_get($stored, 'instance'));
$content = $this->getContent(); $content = $this->getContent();
@@ -742,7 +742,7 @@ class Cart
} }
/** /**
* Get the Formated number * Get the Formatted number
* *
* @param $value * @param $value
* @param $decimals * @param $decimals
@@ -759,7 +759,7 @@ class Cart
$decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point'); $decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point');
} }
if(is_null($thousandSeperator)){ if(is_null($thousandSeperator)){
$thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator'); $thousandSeperator = is_null(config('cart.format.thousand_separator')) ? ',' : config('cart.format.thousand_separator');
} }
return number_format($value, $decimals, $decimalPoint, $thousandSeperator); return number_format($value, $decimals, $decimalPoint, $thousandSeperator);

View File

@@ -456,7 +456,7 @@ class CartItem implements Arrayable, Jsonable
} }
if (is_null($thousandSeperator)){ if (is_null($thousandSeperator)){
$thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator'); $thousandSeperator = is_null(config('cart.format.thousand_separator')) ? ',' : config('cart.format.thousand_separator');
} }
return number_format($value, $decimals, $decimalPoint, $thousandSeperator); return number_format($value, $decimals, $decimalPoint, $thousandSeperator);

View File

@@ -1034,6 +1034,6 @@ class CartTest extends TestCase
{ {
$this->app['config']->set('cart.format.decimals', $decimals); $this->app['config']->set('cart.format.decimals', $decimals);
$this->app['config']->set('cart.format.decimal_point', $decimalPoint); $this->app['config']->set('cart.format.decimal_point', $decimalPoint);
$this->app['config']->set('cart.format.thousand_seperator', $thousandSeperator); $this->app['config']->set('cart.format.thousand_separator', $thousandSeperator);
} }
} }