refactor cartAdd EventListener, removing Request references
This commit is contained in:
@@ -23,21 +23,22 @@
|
||||
|
||||
namespace Thelia\Core\Event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Model\Cart;
|
||||
|
||||
class CartEvent extends ActionEvent
|
||||
class CartEvent extends Event
|
||||
{
|
||||
protected $cart;
|
||||
public $cart;
|
||||
public $quantity;
|
||||
public $append;
|
||||
public $newness;
|
||||
public $productSaleElementsId;
|
||||
public $product;
|
||||
public $cartItem;
|
||||
|
||||
public function __construct(Request $request, Cart $cart)
|
||||
public function __construct(Cart $cart)
|
||||
{
|
||||
parent::__construct($request);
|
||||
$this->cart = $cart;
|
||||
}
|
||||
|
||||
public function getCart()
|
||||
{
|
||||
return $this->cart;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ final class TheliaEvents
|
||||
/**
|
||||
* sent when a new item is added to current cart
|
||||
*/
|
||||
const AFTER_CARTADDITEM = "cart.addItem";
|
||||
const AFTER_CARTADDITEM = "cart.after.addItem";
|
||||
|
||||
/**
|
||||
* sent when a cart item is modify
|
||||
|
||||
Reference in New Issue
Block a user