mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-19 13:55:26 +00:00
Added InstanceIdentifier
This commit is contained in:
@@ -11,6 +11,7 @@ use Gloudemans\Shoppingcart\Contracts\Buyable;
|
||||
use Gloudemans\Shoppingcart\Exceptions\UnknownModelException;
|
||||
use Gloudemans\Shoppingcart\Exceptions\InvalidRowIDException;
|
||||
use Gloudemans\Shoppingcart\Exceptions\CartAlreadyStoredException;
|
||||
use Gloudemans\Shoppingcart\Contracts\InstanceIdentifier;
|
||||
|
||||
class Cart
|
||||
{
|
||||
@@ -68,6 +69,12 @@ class Cart
|
||||
{
|
||||
$instance = $instance ?: self::DEFAULT_INSTANCE;
|
||||
|
||||
if ($instance instanceof InstanceIdentifier)
|
||||
{
|
||||
$this->discount = $instance->getInstanceGlobalDiscount();
|
||||
$this->instance = $instance->getInstanceIdentifier();
|
||||
}
|
||||
|
||||
$this->instance = sprintf('%s.%s', 'cart', $instance);
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user