Latest News: (loading..)

dave704

Members
  • Content count

    1
  • Joined

  • Last visited

About dave704

Profile Information

  • Real Name
    Dave G.
  1. I figured out how to get the order attributes to show up in the customers account history (account_history_info.php or account_history_info.tpl.php if osCMax), add the // denuz section as shown below, or if using a different contribution, trial and error should work. The contribution has an update for the admin/orders.php which works fine, but you can't just cut and paste it, because in orders.php the order number is referenced with $HTTP_GET_VARS['oID'], and account_history_info is using $HTTP_GET_VARS['order_id'] . The other problem is the whole, "I installed this and later found out you can't add two of the same product with different information in the text fields." This seems to be fatal flaw in the contrib, not that it can't be solved. It appears that when you add a product with a text field, the text input goes into a new table and is referenced to the item number by using the customers unique session id number. Unfortunately, this only works for one product per customer session. If you look at application_top.php, you find the whole tragedy of it all: tep_db_query("delete from customers_basket_text_attributes where products_id = " . tep_get_prid($HTTP_POST_VARS['products_id'][$i]) . " and session_id = '" . $osCsid . "'"); Since the contrib was designed to hold the text attributes based on the customers session id, if the customer goes back to the product (meaning they're still inside of the same session, therefore having the same session id), the contrib, by nature has to delete the text attributes fields for that product and session id before it can fill the field again. If I have time, I'll look into rewriting this so it stores the attributes somewhere else temporarily for items added to the cart, or something else maybe. Otherwise, don't bother messing with it thinking you'll get it to add more than one of the same product to the cart with different text fields - it won't work, and there's no "fix" for it aside from adding a hefty chunk of code and a table or so into it. Here's the code for account_history_info.php: if ( (isset($order->products[$i]['textattributes'])) && (sizeof($order->products[$i]['textattributes']) >0) ) { for ($j=0, $n2=sizeof($order->products[$i]['textattributes']); $j<$n2; $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['textattributes'][$j]['name'] . ': ' . $order->products[$i]['textattributes'][$j]['text'] . '</i></small></nobr>'; } } // denuz text attr $pid = @mysql_result(tep_db_query("select products_id from products_description where products_name='" . tep_db_input($order->products[$i]['name']) . "'"), 0, "products_id"); $attr_q = tep_db_query("select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $HTTP_GET_VARS['order_id'] . " and ota.products_id = " . $pid . " and pta.products_text_attributes_id = ota.products_text_attributes_id"); while ($attr = tep_db_fetch_array($attr_q)) { echo '<br><nobr><small> <i> - ' . $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text']); echo '</i></small></nobr>'; } // eof denuz text attr echo '</td>' . "\n";