You can do that by creating a rule, which you then trigger by rules link, or a view VBO block, like (copied from here https://www.drupal.org/node/1468392#comment-10270105):
The Rules Part:
- create a new rules component. Make it an Action set.
- First, add a name. EG "VBO Add To Cart". Below, you'll see a table with three rows - you only need to fill in the top one.
Choose Commerce product from the dropdown (under Entity), and then fill in the other 2 with something memorable like 'Commerce Product' for the label. The machine name needs to be something like commerce_product. Click continue.
- On the next page, choose 'add action'. Choose the type of action: Add product to cart.
- On the next page you need to add the user and the sku. In the user field, start by writing 'site'. This will trigger the dropdown, and you can choose site:current-user. Then for the SKU - first click 'switch to data selection'. You can then click in the field, and select the entity you named earlier (not site). Then you can select sku. Now change the quantity if you need to, then click save.
The Views Part (The easy part)
For this you need VBO installed. Make a view displaying a table of commerce products. You can add the name and the price fields. Next add the VBO field. From the actions list, you should see your newly created rule action. Select it, and if you want, choose to skip the confirmation. Under the bulk options, I also changed it to display as single buttons, as I only have this one action that can be performed. Now save the view. (If you want the tickbox on the left of your table, just rearrange the fields.
Now place your view where you want it (eg a block on a page, or a page, or inserted into a panel) and view it. You should be able to select multiple products with the checkboxes, and then add them to the cart with one click.
Or do it programmatically, like
<?php
global $user;
$line_item = commerce_product_line_item_new(commerce_product_load($YOUR_PRODUCT_ID));
commerce_cart_product_add($user->uid, $line_item);
$line_item = commerce_product_line_item_new(commerce_product_load($OTHER_PRODUCT_ID));
commerce_cart_product_add($user->uid, $line_item);
?>
in a custom (Ajax) callback.