mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-11 18:54:33 +00:00
Add changes from https://github.com/Crinsane/LaravelShoppingcart/pull/350
Add changes from https://github.com/Crinsane/LaravelShoppingcart/pull/349 Add changes from https://github.com/Crinsane/LaravelShoppingcart/pull/478
This commit is contained in:
10
README.md
10
README.md
@@ -174,7 +174,7 @@ Cart::total();
|
||||
The method will automatically format the result, which you can tweak using the three optional parameters
|
||||
|
||||
```php
|
||||
Cart::total($decimals, $decimalSeperator, $thousandSeperator);
|
||||
Cart::total($decimals, $decimalSeparator, $thousandSeparator);
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
```php
|
||||
Cart::tax($decimals, $decimalSeperator, $thousandSeperator);
|
||||
Cart::tax($decimals, $decimalSeparator, $thousandSeparator);
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
```php
|
||||
Cart::subtotal($decimals, $decimalSeperator, $thousandSeperator);
|
||||
Cart::subtotal($decimals, $decimalSeparator, $thousandSeparator);
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
```php
|
||||
Cart::discount($decimals, $decimalSeperator, $thousandSeperator);
|
||||
Cart::discount($decimals, $decimalSeparator, $thousandSeparator);
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
```php
|
||||
Cart::initial($decimals, $decimalSeperator, $thousandSeperator);
|
||||
Cart::initial($decimals, $decimalSeparator, $thousandSeparator);
|
||||
```
|
||||
|
||||
You can set the default number format in the config file.
|
||||
|
||||
@@ -49,7 +49,7 @@ return [
|
||||
| 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.
|
||||
|
|
||||
*/
|
||||
@@ -60,7 +60,7 @@ return [
|
||||
|
||||
'decimal_point' => '.',
|
||||
|
||||
'thousand_seperator' => ','
|
||||
'thousand_separator' => ','
|
||||
|
||||
],
|
||||
|
||||
|
||||
@@ -575,11 +575,11 @@ class Cart
|
||||
$stored = $this->getConnection()->table($this->getTableName())
|
||||
->where('identifier', $identifier)->first();
|
||||
|
||||
$storedContent = unserialize($stored->content);
|
||||
$storedContent = unserialize(data_get($stored, 'content'));
|
||||
|
||||
$currentInstance = $this->currentInstance();
|
||||
|
||||
$this->instance($stored->instance);
|
||||
$this->instance(data_get($stored, 'instance'));
|
||||
|
||||
$content = $this->getContent();
|
||||
|
||||
@@ -742,7 +742,7 @@ class Cart
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Formated number
|
||||
* Get the Formatted number
|
||||
*
|
||||
* @param $value
|
||||
* @param $decimals
|
||||
@@ -759,7 +759,7 @@ class Cart
|
||||
$decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point');
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -456,7 +456,7 @@ class CartItem implements Arrayable, Jsonable
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -1034,6 +1034,6 @@ class CartTest extends TestCase
|
||||
{
|
||||
$this->app['config']->set('cart.format.decimals', $decimals);
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user