RickChase Posted November 20, 2002 Posted November 20, 2002 When we add an item to the catalog, we need to have a field that tells where the item physically is in the warehouse (Aisle 4, Case 8, Shelf C). This only needs to be available when adding the item to the database, and then it would need to print out on the invoice. It does not need to appear in the catalog at all. This is not anything that the customer would benefit from. Any ideas? Thank you
RickChase Posted November 20, 2002 Author Posted November 20, 2002 Update: I have added the field "products_location" to the "products" table, using the same attributes that are assigned to "products_model" field. I then went into "invoice.php" and copied the line that displays the model number and pasted it below the model line. I then changed "model" to "location", like this... echo ' </td>' . "n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "n"; echo ' <td class="dataTableContent" valign="top">' . $order->products[$i]['location'] . '</td>' . "n"; echo ' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "n" . I have also added define('TABLE_HEADING_PRODUCTS_LOCATION', 'Location'); so that my heading appears in the proper column. I have also added a location to my item, yet when I view my invoice, I see where the location should be (heading at the top of the column and everything) yet it does not show. What am I missing? I keep thinking that I need to specify what table to look at, but since I copied everything from "model" and added my new "location" field to the same table, I thought I'd be ok. Help is appreciated. Thank you.
♥olby Posted November 21, 2002 Posted November 21, 2002 Sounds like the good old balance between <tr> and <td>'s. The changes are fine, but .. You've probably put your changes in the right place, after the <table> but forgot to make a <tr> </tr> around your work. Best Regards olby
RickChase Posted November 21, 2002 Author Posted November 21, 2002 Thanks for the suggestion, but I did not add any rows - I only added the one "td" as shown above. I didn't want to paste the whole page, but here is the entire "body" table... <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_LOCATION; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td> </tr> <?php for ($i=0; $i<sizeof($order->products); $i++) { echo ' <tr class="dataTableRow">' . "n" . ' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name']; if (sizeof($order->products[$i]['attributes']) > 0) { for ($j=0; $j<sizeof($order->products[$i]['attributes']); $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; echo '</i></small></nobr>'; } } echo ' </td>' . "n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "n"; echo ' <td class="dataTableContent" valign="top">' . $order->products[$i]['location'] . '</td>' . "n"; echo ' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n"; echo ' </tr>' . "n"; } ?> Again, the database is setup for it, but I cannot get it to work :?
RickChase Posted November 21, 2002 Author Posted November 21, 2002 ...and since I can't edit my above post - obviously that is not the entire body table, just the relevant rows...
RickChase Posted January 8, 2003 Author Posted January 8, 2003 Can anyone take a look at the code and offer suggestions? I reallly need to get this to work and it is infuriating me that I cannot. Here is what it looks like right now... echo ' </td>' . "n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['location'] . '</td>' . "n" . ' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "n" . The "Location" header appears above the column, but the field is blank. Why won't this work?! Rick
Ajeh Posted January 8, 2003 Posted January 8, 2003 Did you add your new field to the appropriate sections in /includes/classes/order.php Follow the same pattern as the model like you did for the invoice.php file.
RickChase Posted January 8, 2003 Author Posted January 8, 2003 Linda, I have now modified the orders.php as you described above. Thank you very much for your assistance. However, when I did I got an error that the field was not found in the orders_products table. So I added the same field that I added in the products table (products_location,varchar(12),Not Null,0) and now it is showing only the default of "0" - but it is showing something so I am getting very excited again. How do I get the assigned value to show? Where else should I be configuring something? It seems to me that somewhere there is something I need to configure so that when the item is placed in the cart, OSC knows to copy the field from the "products" table over to the "orders_products" table. Where might that be? Thank you for your help. Rick
Ajeh Posted January 9, 2003 Posted January 9, 2003 You need to follow the model from the shopping cart to the order on checkout and from then through the invoice. The information has to be transfered from the cart to the orders table so that you can get it out in the invoice. Check that in the checkout processing of the order that the information is being put into the orders table so it can later be retrieved.
RickChase Posted January 9, 2003 Author Posted January 9, 2003 Thank you, thank you!! I had to modify ALOT more files than I had anticipated (on both the catalog and admin sides), but thank you so much for helping me through it. They were (directory listing omitted to save time) order.php (multiple) shopping_cart.php (multiple) checkout_process.php product_info.php invoice.php and had to create the fields in the proper tables (2). This was certainly more than I bargained for, and if it wasn't for you it would still be unresolved. Thanks again, Rick
Ajeh Posted January 9, 2003 Posted January 9, 2003 I have just modified those same areas several times so I am familiar with the flow to them. Once you get the hang of it then it is not so bad ... until then ... you kind of get lost at the stop sign and just think you are losing your mind ... :shock:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.