- 🇨🇭Switzerland Siegrist
This was never committed. We have been using it for years, and it works great. Please commit the fix.
Commerce cart event CART_ORDER_ITEM_UPDATE isn't triggered when you update a commerce line item (to add quantity, for example).
CART_ENTITY_ADD and CART_ORDER_ITEM_REMOVE are well triggered when you add a new item or delete one.
Create a custom event subscriber for those events, and do "add/update/delete" items request from POSTMAN:
public static function getSubscribedEvents() {
return [
CartEvents::CART_ENTITY_ADD => [['addToCart', 100]],
CartEvents::CART_ORDER_ITEM_REMOVE => [['removeFromCart', 100]],
CartEvents::CART_ORDER_ITEM_UPDATE => [['updateCart', 100]],
];
}
I'm not sure, but while "add" and "delete" use cart manager, "update" not.
Perhaps, changing "update" to use "updateOrderItem" from cart manager could solve the problem.
Fixed
1.5
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This was never committed. We have been using it for years, and it works great. Please commit the fix.