You are here

public function AddToCart::execute in Ubercart 8.4

Executes the plugin.

Overrides ExecutableInterface::execute

File

uc_cart/src/Plugin/Action/AddToCart.php, line 31

Class

AddToCart
Provides an action that can add a product to the cart.

Namespace

Drupal\uc_cart\Plugin\Action

Code

public function execute($entity = NULL) {
  uc_cart_add_item($entity
    ->id(), 1, NULL, NULL, TRUE, FALSE, TRUE);
}