tedbooks Posted January 16, 2005 Posted January 16, 2005 hi i am trying to make two contributions to work with each other restore order attributes option type there is a conflict between the two and when the cart is restored with the first contribution the attributes are not shown here is a part of the code that gets the attributes in my account_history_info.php with modification for option type and it is working for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr>' . "\n" . ' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td class="main" valign="top">' . $order->products[$i]['name']; if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) { for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>'; } } echo '</td>' . "\n"; and this is the part of the code that deals with attributes ib restore_order.php which gives me no value for attributes for ($i=0, $n=sizeof($restore_order->products); $i<$n; $i++) { $pID = $restore_order->products[$i]['id']; $qty = $restore_order->products[$i]['qty']; $attributes = array(); if ( (isset($restore_order->products[$i]['attributes'])) && (sizeof($restore_order->products[$i]['attributes']) > 0) ) { for ($j=0, $n2=sizeof($restore_order->products[$i]['attributes']); $j<$n2; $j++) { $attribute_options_id_query = tep_db_query("select products_options_name, products_options_id from " . TABLE_PRODUCTS_OPTIONS . " where products_options_name = '" . $restore_order->products[$i]['attributes'][$j]['option'] . "'"); $attribute_options_id = tep_db_fetch_array($attribute_options_id_query); $attribute_options_values_id_query = tep_db_query("select products_options_values_id ,products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_name = '" . $restore_order->products[$i]['attributes'][$j]['value'] . "'"); $attribute_options_values_id = tep_db_fetch_array($attribute_options_values_id_query); $attributes[$attribute_options_id['products_options_name']] = '{' . $attribute_options_id['products_options_name'] . '}' . $attribute_options_values_id['products_options_values_name']; } } $cart->add_cart($pID, ($cart->get_quantity(tep_get_uprid($pID, $attributes))) + $qty, $attributes, false); i know it is a long shot since both are pretty old contribution but they are beautiful work and if i could get this to work it would be great thanks in advance for any help you can provide Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.