Hi there!
Here's a quick fix for the "added again the free product but with full price" problem:
There are small modification in 3 files, highlited in red.
classes/shopping_cart.php, function get_products()
// Get 1 free
if (is_array ($free_product = $this->get1free ($products_id))) {
// Add the free product to the shopping cart (Customer cannot alter this)
$products_array[] = array('id' => $free_product['id'],
'name' => $free_product['name'],
'model' => $free_product['model'],
'image' => $free_product['image'],
'price' => 0,
'quantity' => $free_product['quantity'],
'weight' => $free_product['weight'],
'final_price' => 0,
'tax_class_id' => $products['products_tax_class_id'],
'attributes' => '',
'free' => 1
);
} //if (is_array
// end Get 1 free
--------------------------------------------------------------------------------------------------
shopping_cart.php
$info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
'text' => $products_name);
$info_box_contents[$cur_row][] = array('align' => 'center',
'params' => 'class="productListing-data" valign="top"',
'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_hidden_field('free[]', $products[$i]['free']) );
$info_box_contents[$cur_row][] = array('align' => 'right',
'params' => 'class="productListing-data" valign="top"',
'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
}
new productListingBox($info_box_contents);
--------------------------------------------------------------------------------------------------
application_top.php, case 'update_product' section:
$isFree = $HTTP_POST_VARS['free'][$i];
if ($isFree != 1)
{
$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
}
That's it, it works for me.