The following code restores the text attribute values when a user
has added items to the cart before logging in. Without the fix,
all text values were lost in the restore_contents logic.

Files to modify
/catalog/includes/classes/shopping_cart.php

FIND:
// OTF contrib begins
//$attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "' and products_id = '" . $products['products_id'] . "'");
$attributes_query_raw = "select products_options_id, " .
"products_options_value_id, products_options_value_text from " .
TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" .
(int)$customer_id . "' and products_id = '" .
tep_db_input($products['products_id']) . "'";
$attributes_query = tep_db_query($attributes_query_raw);
// OTF contrib ends

// OTF contrib begins
if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) {
$this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text'];
}
// OTF contrib ends }

REPLACE with
//LPM fix to restore text attribute values to cart object
$attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
while ($attributes = tep_db_fetch_array($attributes_query))
{
$this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];
if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID)
{
$this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text'];
}
}
//LPM



More...