Ok, i got it to work in the all_products page.
If that interests somebody, here is my (not perfect, but working
) code that has to go in line 107 of the tpl_modules_products_all_listing.php file located in your template :
PHP Code:
if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {
$link2 = '<form name="cart_quantity" action="index.php?main_page=product_info&products_id=' . $products_all->fields['products_id'] . '&action=add_product" method="post" enctype="multipart/form-data">';
$link2 .= '<input type="hidden" name="cart_quantity" value="1" />';
$link2 .= '<input type="hidden" name="products_id" value="' . $products_all->fields['products_id'] . '" />';
$sqllink2 = "SELECT options_id , options_values_id FROM products_attributes WHERE products_id = " . $products_all->fields['products_id'];
$resultlink2 = mysql_query($sqllink2) or die ('Erreur '.$sqllink2.' '.mysql_error());
while ($ligne = mysql_fetch_assoc($resultlink2)) {
$link2 .= '<input type="hidden" name="id[' . $ligne[options_values_id] . ']" value="'.$ligne[options_values_id].'" checked="checked" id="attrib-'.$ligne[options_values_id].'-'.$ligne[options_values_id].'" />';
}
$link2 .= '<input type="image" src="includes/templates/classic/buttons/english/button_buy_now.png" alt="Add to Cart" title=" Add to Cart " />';
$link2 .= '</form>';
$disp_text = zen_get_products_description($products_all->fields['products_id']);
$disp_text = zen_clean_html($disp_text);
$display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_ALL_LIST_DESCRIPTION, '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '"> ' . MORE_INFO_TEXT . '</a><br><br>' . $link2));
}
It should add a buy now button and retreive and force auto-selecting of ALL the attributes for each product.
Hope that will help somebody.
Arno