1

The function is now a part of the CartInterface and implemented in the Cart::isShippable() method. You can use the CartManager service to retrieve the Cart object and call the method: \Drupal::service('uc_cart.manager')->get()->isShippable()


1

So the context is mandatory and it is actually important because it sets the data you want to fetch when the rule is triggered. I just needed to set the context to the good entity as follow. "entity" = @ContextDefinition("entity:uc_order", The working annotation is the following. /** * Definition of the action performed. * * @RulesAction( * id = "...


1

As for D8 latest version, it looks like uc_cart_get_contents is not working anymore. So here is how I managed to do it : /** @var \Drupal\uc_cart\CartManager $cartManager */ $cartManager = \Drupal::service('uc_cart.manager'); $items = $cartManager->get()->getContents(); $variables['nbr_cart_items'] = count($items);


Only top voted, non community-wiki answers of a minimum length are eligible