$dispatcher
$dispatcher : \Symfony\Component\EventDispatcher\EventDispatcherInterface
Class Cart where all actions are manage like adding, modifying or delete items.
Class Cart
addArticle(\Thelia\Core\Event\ActionEvent $event)
add an article to cart
| \Thelia\Core\Event\ActionEvent | $event |
deleteArticle(\Thelia\Core\Event\ActionEvent $event)
Delete specify article present into cart
| \Thelia\Core\Event\ActionEvent | $event |
modifyArticle(\Thelia\Core\Event\ActionEvent $event)
Modify article's quantity
don't use Form here just test the Request.
| \Thelia\Core\Event\ActionEvent | $event |
getSubscribedEvents() : array
Returns an array of event names this subscriber wants to listen to.
The array keys are event names and the value can be:
For instance:
The event names to listen to
getCart(\Symfony\Component\HttpFoundation\Request $request) : \Thelia\Model\Cart
search if cart already exists in session. If not try to create a new one or duplicate an old one.
| \Symfony\Component\HttpFoundation\Request | $request |
updateQuantity(\Thelia\Model\CartItem $cartItem, $quantity)
| \Thelia\Model\CartItem | $cartItem | |
| $quantity |
addItem(\Thelia\Model\Cart $cart, $productId, $productSaleElementsId, $quantity, \Thelia\Model\ProductPrice $productPrice)
| \Thelia\Model\Cart | $cart | |
| $productId | ||
| $productSaleElementsId | ||
| $quantity | ||
| \Thelia\Model\ProductPrice | $productPrice |
createCart(\Thelia\Core\HttpFoundation\Session\Session $session) : \Thelia\Model\Cart
| \Thelia\Core\HttpFoundation\Session\Session | $session |
duplicateCart(\Thelia\Model\Cart $cart, \Thelia\Core\HttpFoundation\Session\Session $session, \Thelia\Model\Customer $customer) : \Thelia\Model\Cart
try to duplicate existing Cart. Customer is here to determine if this cart belong to him.
| \Thelia\Model\Cart | $cart | |
| \Thelia\Core\HttpFoundation\Session\Session | $session | |
| \Thelia\Model\Customer | $customer |