Two 'add to cart' buttons using different attributes I am using Ubercart 3 on Drupal 7 for my website.

How am I able to have two "Add to cart" button on a product page that use two different attributes? So for example I can have:

(Buy the large version)
(Buy the small version) 

Those two buttons match my attributes that I have set in the back, so customers can click on one of those and add the product to the cart directly.
A. Enable Ubercart Cart Links (part of core). 
B. Add necessary attributes and make sure you have a default attribute set. 

With UC cart links, you can perform the add-to-cart functionality with many different AND DYNAMIC arguments. Without making a new add-to-cart button using Form API or complicated setups. 

You can, 


Add any quantity of any number of products to the customer's cart, with specific attributes and options for each added product, if applicable.
Display a custom message to the user.
Track the click for display on a store report.
Empty the customer's shopping cart.
Redirect to any page on the site.


Basically you make a URL that will, when opened, adds given items with given parameters to the current user's cart. 

cart/add/e-p123_a1o2


See above link. When opened, it will first empty the cart (e), adds product/node ID 123 to the cart(p123) with attribute of ID 1 (a1) and that attribute's option ID 2 (o2). 

You can see a very good help instructions on help section of uc_cart_links module's admin page (admin/help/uc_cart_links) .

You can build the URLs using Drupal's url() or l() functions.

Put these snippets in your node.tpl.php file of the product node type (node--product.tpl.php) where you want to display buttons. 

&lt;div id="buy-large"&gt;
&lt;?php
 print l(
      t('Buy the large version'), 
      'cart/add/'.$node-&gt;id.'_a101'
    ); 
  ?&gt;
&lt;/div&gt;
&lt;div id="buy-small"&gt;
&lt;?php 
 print l(
      t('Buy the small version'), 
      'cart/add/'.$node-&gt;id.'_a102'
    );
?&gt;
&lt;/div&gt;


if you are putting this code in a block or anywhere other than node.tpl.php or variants, change $node-&gt;nid to arg(1) . This arg(1) thing will only work if the button is being displayed in full content page. 
if you are placing these buttons in a View, replace $node-&gt;nid with the appropriate node ID by adding a node: ID field and tokens.
If you want to see attribute and option IDs, go to attributes page and you will see the attribute/option ID which is a numeric one. 

Good luck!