Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Duende1

Members
  • Content count

    18
  • Joined

  • Last visited

Profile Information

  • Real Name
    Not Timmy (but almost)
  • Website
  1. Duende1

    QBI Quickbooks Import

    I'm looking forward to using this contribution. So far I have used and modified a number of other brilliant contributions but I seem to have an issue launching this one. For example, I installed everything and uploaded the files but I get the following browser error: FIREFOX says ... "The page isn't redirecting properly". The url is: [...]/catalog/admin/qbi_config.php?msg=1 IE just times out. I get the same error with and without my lists.iif uploaded. With and without the sql files uploaded. I've both uploaded and installed the sql files on my own seeing how the drop tables command is there and I have removed the alter statements so they wouldn't error out. Did the manual db alterations because of the initial error. I'm probably way over-thinking this and a search on "bi_config.php?msg=1" shows some old issues but I can't tell how this would relate to me. Thanks in advance and I hope that this isn't a big deal. Many seem to get it all loaded and started easily. Thanks again for your time.
  2. Duende1

    NEW! Complete Order Editing Tool!

    Sorry Folks, :'( The post above has a bug in it where hitting the first two "Update" buttons on the admin/edit_orders.php page will actually add a blank comment. Currently I'm a updating the page to hold textarea boxes so that we can edit the page just like the address fields and use the existing "update_order" case statement. Otherwise I'll need to write a new html block to accommodate what happens when a comment is added. IDEA: Edit the comments in place. Add a delete button to delete the row.
  3. Duende1

    NEW! Complete Order Editing Tool!

    Incorporating the Edit Comments Contribution into the Order Editor. Currently, I have the Order Editor 2.8.2 and Edit Comments (found here). Had a brief chat or two with Insomniac2 about integrating these two contributions. The original Edit Comments has directions for placing it in the original admin/orders.php file. Once I picked up on the subtle clue, it became very easy to integrate these two. Feel free to first read the "Tying it all together" comment at the end of this message. So here it is: FILE: admin/edit_orders.php FIND: if (($action == 'edit') && isset($_GET['oID'])) { $oID = tep_db_prepare_input($_GET['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $order_exists = true; if (!tep_db_num_rows($orders_query)) { $order_exists = false; $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error'); } } PLACE THIS (unedited) CODE BEFORE (basically right after the huge switch statement and before the code mentioned above): /* * Edit comments */ switch ($HTTP_POST_VARS['action_comment']) { case 'edit_comment_true': if(isset($HTTP_POST_VARS['txt_comment']) && isset($HTTP_POST_VARS['comment_id'])){ tep_db_query("update " . TABLE_ORDERS_STATUS_HISTORY . " set comments = '".tep_db_input($HTTP_POST_VARS['txt_comment'])."' where orders_status_history_id = '" . tep_db_input($HTTP_POST_VARS['comment_id']) . "'"); } break; case 'delete_comment_true': if(isset($HTTP_POST_VARS['comment_id'])){ tep_db_query("DELETE FROM " . TABLE_ORDERS_STATUS_HISTORY . " where orders_status_history_id = '" . tep_db_input($HTTP_POST_VARS['comment_id']) . "'"); } break; } /* **** Edit comments eof **** */ FIND: <!-- Begin Status Block --> , and then scroll down to where the status and comments table is built: <?php $orders_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added"); if (tep_db_num_rows($orders_history_query)) { while ($orders_history = tep_db_fetch_array($orders_history_query)) { echo ' <tr>' . "\n" . ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" . ' <td class="smallText" align="center">'; if ($orders_history['customer_notified'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n"; } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n"; } echo ' <td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" . ' <td class="smallText" align="left">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n"; echo ' <td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" . ' <td class="smallText" align="left">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n"; PASTE IN RIGHT AFTER: /* ******* Edit comments ********* */ echo ' <td class="smallText">' . '</form>' . tep_draw_form('edit_comment', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array()) ). tep_draw_hidden_field('comment_id',$orders_history['orders_status_history_id']); if($HTTP_POST_VARS['action_comment']=='edit_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']) echo tep_image_submit('button_update.gif', IMAGE_EDIT); else echo tep_image_submit('button_edit.gif', IMAGE_EDIT); if($HTTP_POST_VARS['action_comment']=='edit_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']){ echo tep_draw_hidden_field('action_comment','edit_comment_true'); echo '<br>'.tep_draw_textarea_field('txt_comment','soft',60,5,stripslashes(nl2br(tep_db_output($orders_history['comments'])))); }else echo tep_draw_hidden_field('action_comment','edit_comment'); echo '</form>'.' '; echo tep_draw_form('delete_comment', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array()) ); if($HTTP_POST_VARS['action_comment']=='delete_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']){ echo tep_draw_hidden_field('action_comment','delete_comment_true'); echo '<br>'.TEXT_INFO_DELETE_COMMENT.'<br><br><br>'; }else echo tep_draw_hidden_field('action_comment','delete_comment'); echo tep_draw_hidden_field('comment_id',$orders_history['orders_status_history_id']); if($HTTP_POST_VARS['action_comment']=='delete_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']) echo tep_image_submit('button_confirm.gif', IMAGE_CONFIRM); else echo tep_image_submit('button_delete.gif', IMAGE_DELETE); echo '</form> '. '</td>' . "\n"; /* ******* Edit comments eof ********* */ FINALLY: ADD ANOTHER "Form" tep function right after (BUT before the "else"): tep_draw_form('edit_order', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array('action')) . 'action=update_order'); Mine looks like this: This code below finishes off the PHP block started in "<!-- Begin Status Block -->" mentioned above. /* ******* Edit comments eof ********* */ echo ' </tr>' . "\n" . tep_draw_form('edit_order', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array('action')) . 'action=update_order'); } } else { echo ' <tr>' . "\n" . ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . ' </tr>' . "\n"; } ?> TYING IT ALL TOGETHER: Alright, it's a bit convoluted, but the reason that the Edit Comments code does not work in the Order Editor contribution is that the admin/edit_orders.php file uses a form across multiple sections and the Edit Comments code creates two new forms of its' own. Embedded html forms simply won't work. To keep things as simple as possible, install the Edit Comments switch statement in the spot indicated. That works for both the old admin/orders.php and the new admin/edit_orders.php. Now if you look at the "PASTE IN RIGHT AFTER" code you'll see that I immediately close one form with </form>. While it's very messy HTML in my mind (... this whole damn original orders.php page is very bad, period, and the contributions are forced to follow it's example), it is better to change as little as possible. So we need to close that main form, allow Edit Comments to open and close its own forms, then we must open the main form back up again ... so all admin/edit_orders.php UPDATE buttons will work. Please pay attention to your periods ( . ), "echo" commands and semi-colons ( ; ). I tried to keep the changes to the Edit Comments code and leave as much of the Edit Orders code alone, BUT you need to make sure that your code integrates and concatenates correctly.
  4. Duende1

    NEW! Complete Order Editing Tool!

    Damn ... I'm letting some timer run out and then I can't complete my edit ... Here's the rest of my post: We need someone smarter in PhP and osCommerce than myself, but I saw right off the bat that the stripslashes function completely replaced the original (in my case from version 2.8.1) the ... tep_db_prepare_input($_POST['update_customer_name']) Now, tep_db_prepare_input(stripslashes($_POST['update_customer_name'])) actually worked like the original. E.G. Any apostrophes would throw and error. So I compromised using the stripslashes with version 2.8.2's tep_db_input. Who knows how badly we can get hacked, but at least this is in the admin section, so we're probably OK. Let me know if this works for those having trouble saving the main customer address in Order Editor 2.8.2 (admin/edit_orders.php)
  5. Duende1

    NEW! Complete Order Editing Tool!

    Alrighty ... if your customer's main address is disappearing in the edit_order.php, try this: FILE: edit_orders.php FIND: around line 74 // 1.1 UPDATE ORDER INFO ##### $UpdateOrders = "update " . TABLE_ORDERS . " set customers_name = '" . tep_db_input(stripslashes($update_customer_name)) . "', customers_company = '" . tep_db_input(stripslashes($update_customer_company)) . "', customers_street_address = '" . tep_db_input(stripslashes($update_customer_street_address)) . "', customers_suburb = '" . tep_db_input(stripslashes($update_customer_suburb)) . "', customers_city = '" . tep_db_input(stripslashes($update_customer_city)) . "', customers_state = '" . tep_db_input(stripslashes($update_customer_state)) . "', customers_postcode = '" . tep_db_input($update_customer_postcode) . "', customers_country = '" . tep_db_input(stripslashes($update_customer_country)) . "', customers_telephone = '" . tep_db_input($update_customer_telephone) . "', customers_email_address = '" . tep_db_input($update_customer_email_address) . "',"; REPLACE $UpdateOrders = "UPDATE " . TABLE_ORDERS . " SET customers_name = '" . tep_db_input(stripslashes($_POST['update_customer_name'])) . "', customers_company = '" . tep_db_input(stripslashes($_POST['update_customer_company'])) . "', customers_street_address = '" . tep_db_input(stripslashes($_POST['update_customer_street_address'])) . "', customers_suburb = '" . tep_db_input(stripslashes($_POST['update_customer_suburb'])) . "', customers_city = '" . tep_db_input(stripslashes($_POST['update_customer_city'])) . "', customers_state = '" . tep_db_input($update_customer_state) . "', customers_postcode = '" . tep_db_input(stripslashes($_POST['update_customer_postcode'])) . "', customers_country = '" . tep_db_input($update_customer_country) . "', customers_telephone = '" . tep_db_input(stripslashes($_POST['update_customer_telephone'])) . "', customers_email_address = '" . tep_db_input(stripslashes($_POST['update_customer_email_address'])) . "',";
  6. Duende1

    Customers extra fields

    Hi, I just popped back over to see what's doing. [aside] BTW: I just modified a recipe from Monika Mathe's, Deep Inside osCommerce: The Cookbook, to search the order "comments" (we'll be adding serial numbers when products ship) from the generic order listing within admin. She's damn impressive ... her recipe gets bundled into an existing query as a sub query. Got an error on the "back" button, though but nothing too terrible.[/aside] Anyway, my brain's a bit frazzled. Where exactly do you want these drop downs and what will be populated within them? I haven't looked yet but I suspect that form elements are generated with some form of "tep_" function. Let me know what you're looking for because I might need it too :-" ...ciao
  7. Duende1

    Customers extra fields

    I see your point about the email. I re read the post and remembered that there were email issues. As for the double data output I wonder if it's a language ID issue? Either duplicate language ID's (that may have popped in during testing) or if the query is just weak, poorly written and ignores an intended constraint? I have multiple languages available and like the original email add-on, I don't get duplicates. So I'm definitely curious. Perhaps I need to remove my extra languages and see what happens. Anyway, I have to move on to some reporting and then back to adding extra fields to the Order Editor ... then see about Admin only extra fields.
  8. Duende1

    Customers extra fields

    Evidently, my last edit bombed out and now I can no longer edit ... oh well. FILE: admin/includes/languages/#your_language#/invoice.php NOTE - Add the following line to define the Extra Fields Heading. define('TABLE_HEADING_EXTRAFIELDS','ADDITIONAL ACCOUNT INFORMATION'); ... also I can't get my separator function to work above my Extra Fields heading on my invoice. Recently I just removed that and placed a " hr size="3" " tag. :)
  9. Duende1

    Customers extra fields

    I'm glad insomniac2 jumped on this ... I'll have to see about the email part as there is already an update for emailing (that works for me, at least). Anyways ... here's the first draft of some code to get the invoice to print the extra fields. As insomniac2 mentioned, we have enough code in this contribution to help generate the extra fields almost anywhere, although I believe it was only missing the invoice integration. Everything else (add/edit forms, etc) should be easier and I'll get working on Order Editor. Below I tried to mimic the structure used within osC without changing anything, per se. I wanted to simply get an extra piece of information into queries that are already being run. Then use that extra "id" info for tying together orders/customers/extra_fields, etc. FILE: admin/includes/classes/order.php LINE ~13 NOTE- We need to add a variable to hold our extra fields info. FIND: class order { var $info, $totals, $products, $customer, $delivery, $content_type; function order($order_id = '') { $this->info = array(); REPLACE: class order { var $info, $extra_fields, $totals, $products, $customer, $delivery; function order($order_id) { $this->info = array(); $this->extra_fields = array(); FILE: admin/includes/classes/order.php LINE ~28 NOTE - The only change for the following find/replace is the addition of "customers_id" to the order_query. FIND: $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id. "'"); REPLACE: $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); FILE: admin/includes/classes/order.php LINE ~48 Only added 'cust_id' => $order['customers_id'], to the "$this->customer = array" -- don't forget the comma. $this->customer = array('cust_id' => $order['customers_id'], 'name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']); FILE: admin/invoice.php NOTE - This output is its own table that can be placed above the "Comments" on the invoice.php. Seeing how there are a number of different invoice layouts available, then I suggest plugging this in above the comments section and below the products. Otherwise just take your time and work with the formatting. <!-- PRINT EXTRA FIELDS CODE STARTS HERE //--> <?php $orders_extrafields_query = tep_db_query("SELECT DISTINCT o.customers_id, cte.value, efi.fields_name, o.customers_name FROM " .TABLE_EXTRA_FIELDS_INFO. " efi INNER JOIN " .TABLE_CUSTOMERS_TO_EXTRA_FIELDS. " cte ON (efi.fields_id = cte.fields_id) INNER JOIN " .TABLE_ORDERS. " o ON (cte.customers_id = o.customers_id) WHERE (efi.languages_id = '".$languages_id."') AND (o.customers_id ='". tep_db_input($order->customer['cust_id']) ."') ORDER BY cte.fields_id ASC"); if (tep_db_num_rows($orders_extrafields_query)) { $has_extrafields = false; echo ' <tr>'; echo ' <td width="95%">' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>'; echo ' </tr>'; echo ' <table width="95%" width="100%" border="0" cellpadding="0" cellspacing="0" class="main">'; echo ' <tr>'; echo ' <td><strong>' . TABLE_HEADING_EXTRAFIELDS . ':</strong><br><br></td>'; echo ' </tr>'; while ($orders_extrafields = tep_db_fetch_array($orders_extrafields_query)) { if (tep_not_null($orders_extrafields['value'])) { $has_extrafields = true;// Not Null = Has Extra Fields if (tep_not_null($orders_extrafields['value'])) { $exInfo = new objectInfo($orders_extrafields); echo '<tr>'; echo ' <td width="95%">'; echo ' <strong>' . nl2br(tep_db_output($orders_extrafields['fields_name'])) .':</strong><br /><span class="smallText">' . nl2br(tep_db_output($orders_extrafields['value'])) . '</span><br /><br />'; echo ' </td>'; echo '</tr>'; } } } if ($has_extrafields == false) { /*most of this stuff is row-to-row ending the section (with a FINAL row to end the table) */ echo ' <tr>'; echo ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>'; echo ' </tr>'; } echo ' <tr>'; echo ' <td>' . tep_draw_separator('pixel_trans.gif', '1', '7') . '</td>'; echo ' </tr>'; echo ' </table>'; } ?> <!-- PRINT EXTRA FIELDS CODE ENDS HERE //-->
  10. Duende1

    Customers extra fields

    I'm taking a look at that now. Keep in mind that I have never created a contribution, I've been using osC for about a hectic month now, this is only one of a few high priority tasks, and I'm a former Coldfusion developer; so there will be some trial and error. I still need to study how the order status and comments are handled, but at first glance it seems like most things are order-centric but our extra fields seem purely customer-centric. Tying it all together neatly will be an issue. Another couple of days will show me if I'm way off course here, BUT I need to get this done and I don't have lots of time. As I wrap it up I'd love to chat with the contribution creator and a couple of others to help clean up my work. If an update comes out sooner then great, I can jump to my other tasks. :-" To keep it simple-r I'm trying to modify in this order: Add extra fields to the invoice print out. Add the add/edit form to the admin/order details (original osC page) Add the add/edit form to the great Order Editor contribution (3 places). Add admin-only extra fields that will print out in the update emails and invoices.
  11. Duende1

    Customers extra fields

    Well, my friend I decided to use osC in my new job. So I'm getting paid for some of this -- although it's just one of many projects. I've used pay carts (.Net & Coldfusion) in the past and it just comes down to the type of pain you like. With these forums, contributions and a couple of books I just bought, I look forward to heavily modding my osC into a mean customer/product management tool. I look forward to giving back.
  12. Duende1

    Customers extra fields

    Hello, Great contribution. Everything worked for me without a hitch. For those of you having problems (and you have the newest stable osC), keep in mind that there are a few minor typos. For example, in step three "languages" is your language folder not a folder named languages. And "extrafields.php" is really "extra_fields.php". I had to bring that up, just in case. MINOR FIX TO THE "EMAIL" PART OF THIS CONTRIBUTION: If you have multiple languages setup in your site then the following line from checkout_process.php will grab the very first record in the extra_fields_info table. I have three languages setup and I noticed that my fields_name was incorrect in the email. Was this ... $extrfieldsinf = tep_db_query("select fields_name from " . TABLE_EXTRA_FIELDS_INFO . " where fields_id = '" . $dataexfes['fields_id'] . "'"); I simply added the language check and it works... $extrfieldsinf = tep_db_query("select fields_name from " . TABLE_EXTRA_FIELDS_INFO . " where fields_id = '" . $dataexfes['fields_id'] . "' and languages_id ='" . $languages_id . "'"); Now folks, I will begin the very painful process of taking our brand new extra fields information and output it in the invoice and the Order Editor contribution (at least three spots there :'( ). I'll post updates as I get stuff working. Wish me luck.
  13. I could use this contribution and this is what I found there ... [the new contribution should be accepted shortly I assume]
×