final class MultiCurrencyException extends NotPurchasableException
9
{
10
/**
11
* @var AbstractCartPosition
12
*/
13
private $position;
14
/**
15
* @var ShoppingCart
16
*/
17
private $shoppingCart;
18
19
/**
20
* {@inheritDoc}
21
*/
22
public function __construct(string $message, ShoppingCart $shoppingCart, AbstractCartPosition $position)
23
{
24
parent::__construct($message ?: 'Can not add this item to cart because of different currency');
25
$this->position = $position;
26
$this->shoppingCart = $shoppingCart;
27
}
28
29
public function resolve(): bool
30
{
31
Yii::error('Cart position "' . $this->position->getName() . '" was removed from the cart because multi-currency cart is not available for now', 'hipanel.cart');