Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
It seems that some of the "Cart Item" events do not work with rules and ubercart.
To test it, a made a rule like this
{ "rules_alter_product_quantity" : {
"LABEL" : "TEST UBERCART RULE",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules", "entity" ],
"ON" : [ "uc_cart_item_insert", "uc_cart_item_delete" ],
"DO" : [ { "drupal_message" : { "message" : "IT WORKS!" } } ]
}
}
Whenever I try to add a new item to the cart or to update the quantity of an existing cart, no message is shown. When I delete a cart item, a message is shown to the screen.
Comments
Comment #0.0
denisr CreditAttribution: denisr commentedimproved reporting
Comment #1
Feet CreditAttribution: Feet commentedI can confirm I've found the same
The event After deleting a cart item does work but
Cart Items
After saving a new cart item; &
After updating an existing cart item do not
Comment #2
Feet CreditAttribution: Feet commentedI think the problem for this will be in Ubercart so changing the tags (hope that's alright).
I've looked but couldn't find the events in uc_cart.rules.inc where I thought they'd be, so I'm not much help. But will keep hunting.
Comment #3
Feet CreditAttribution: Feet commentedWoops, have just seen #1492626: "Cart Items" triggers dont work so will return labels to how they were.
Don't mind me. Ha
Comment #3.0
Feet CreditAttribution: Feet commentedbetter explanation
Comment #4
Feet CreditAttribution: Feet commentedWoops, have just seen #1492626: "Cart Items" triggers dont work so will return labels to how they were.
Don't mind me. Ha
Comment #5
TR CreditAttribution: TR commentedThis was fixed long ago by #1492626: "Cart Items" triggers dont work