Just for sake of explaining some things, lets say you want a link on your product page that adds the product to the cart in a specifically configured way. For example, lets use the old standby of a "T-Shirt". There can probably be color and size for attributes. Lets also say you sell "Pants" that have a size and color, but you want the user to be able to use the dropdowns for pants and have buttons for T-Shirts.
The buttons would be pre-configured, and the pants would allow any choice
You would do the following in the app/designt/frontend/YOURTHEME/default/template/catalog/product/view.phtml
Look for
<?php if ($_product->isSaleable() && $this->hasOptions()):?>
<?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif;?>
and replace it with something like this
<?php
if ($_product->isSaleable() && $this->hasOptions())
{
$attSetName = "TSHIRT";
$product = Mage::registry('current_product');
$attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$attributeSetModel->load($product->getAttributeSetId());
$attributeSetName = $attributeSetModel->getAttributeSetName();
// Its only going to work on Tshirts that are configurable products
// All others (PANTS) will fall to the default magento functionality
if (strtoupper($attributeSetName)== $attSetName && $product->getTypeId() == "configurable")
{
// Here is where you will add the cart links to set up products directly to the cart
// It *MAY* make more sense to set these up as custom variables, but for simplicity's sake, lets just hard code them in here for now
$productA = "/?super_attribute[146]=60&super_attribute[147]=67&super_attribute[145]=57&super_attribute[144]=49&super_attribute[148]=69&super_attribute[149]=75&super_attribute[150]=80&qty=1";
$productB = "/?super_attribute[146]=60&super_attribute[147]=67&super_attribute[145]=57&super_attribute[144]=49&super_attribute[148]=69&super_attribute[149]=75&super_attribute[150]=80&qty=1";
echo '<div id="YOURATTRIBUTESETNAMEcustomProducst">';
echo '<a href="/checkout/cart/add/product/' . $_product->getId() . $productA . '" />Buy Custom Option A</a>';
echo '<a href="/checkout/cart/add/product/' . $_product->getId() . $productB . '" />Buy Custom Option B</a>';
echo '</div>';
}
}
else
{
// Do the default magento action
// *not sure if container1 or container2. Each section does its own thing so
// just experiment. Mine was container2
echo $this->getChildChildHtml('container2', '', true, true);
}
?>
This code is untested. I coded it up on the fly, and I believe strongly that it is a sound base to find a good solution! GOOD LUCK.