Jump to content

Llamma123

Members
  • Content count

    35
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    TheHeadLlamma
  • Website
  1. Llamma123

    [Contribution] - USPS Methods

    That was the answer no zip code defined! Thanks I'm glad I asked I was about to start down the path of providing an unnecessary password.
  2. Llamma123

    [Contribution] - USPS Methods

    I just did a fesh install of 2.3.1 and did the drop on top install of USPS methods. I followed all the instalation instructions and have a USPS user/pass that works in production. I get the error message An error occured with the USPS shipping calculations. If you would like to use USPS as your shipping method, please contact the store owner. I find there is no field to configure the USPS password in the admin configuration so I'm pretty sure that is an issue. Just thought I would throw this out there and see if anyone else has figured out a solution
  3. Thanks for the input. The information seems to only be available in the orders_history table. The entries I need to use will all look something like the following. United States Postal Service (1 x 1.75lbs) (1lbs, 12oz) (First-Class Mail International Package): United States Postal Service (1 x 0.5lbs) (0lbs, 8oz) (Express Mail) : United States Postal Service (1 x 0.6lbs) (0lbs, 9.6oz) (US Postal Service): Federal Express (1 x 0.5lbs) (Home Delivery) Federal Express (1 x 0.5lbs) (Express Saver (3 Day)) Federal Express (1 x 0.5lbs) (2 Day Air): Federal Express (1 x 0.5lbs) (Standard Overnight (by 3PM, later for rural)): Federal Express (1 x 0.5lbs) (Priority (by 10:30AM, later for rural)): Federal Express (1 x 0.5lbs) (First Overnight): I've also been working on some updates to my invoice and a part of this was adding a short carrier/service level so I added the following to look at the Orders History table. $check_shipping_query = tep_db_query("SELECT text, title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' and sort_order = 2"); $check_shipping = tep_db_fetch_array($check_shipping_query); $service= substr($check_shipping['title'],0,1); if ($service==U){ $carrier='USPS'; } else { $carrier='FEDEX'; } $pmtshort='PP'; if ($order->info['payment_method'] == "Check/Money Order") $pmtshort='MO'; if ($order->info['payment_method'] == 'Cardinal Centinel') $pmtshort='CC'; $shpclass=false; IF (strpos($check_shipping['title'], "US Postal") !== false) $shpclass='Postal'; IF (strpos($check_shipping['title'], "Express Mail") !== false) $shpclass='Express'; IF (strpos($check_shipping['title'], "Express Mail International") !==false) $shpclass='<b>INTL Express</b>'; IF (strpos($check_shipping['title'], "Priority Mail International") !==false) $shpclass='<b>INTL Priority</b>'; IF (strpos($check_shipping['title'], "First-Class Mail International Package") !==false) $shpclass='<b>INTL First</b>'; IF (strpos($check_shipping['title'], "Home Delivery") !== false) $shpclass='Ground'; IF (strpos($check_shipping['title'], "Express Saver ") !== false) $shpclass='Saver'; IF (strpos($check_shipping['title'], "2 Day") !== false) $shpclass='2 Day'; IF (strpos($check_shipping['title'], "Standard Overnight") !== false) $shpclass='Overnight'; IF (strpos($check_shipping['title'], "by 10:30AM") !== false) $shpclass='POvernight'; IF (strpos($check_shipping['title'], "First Overnight") !== false) $shpclass='FOvernight'; So with the above I have the basic tools to get the job done I'm sure there are other methods. I'm pretty much a novice when it comes to PHP so I welcome any input or comments on prefered ways to accomplish the same thing. So now the big question, where do I go from here? I should be able to build an array that includes the order number,carrier, service level, and the weight. Oh yeah the weight anyone know any cool commands to select the data between the first set of parenthesis in a string?
  4. I hope someone out there can point me in the right direction. I'm slowly learning PHP coding and have a reasonable understanding of what is going on in this code but did not write it myself. I know there are already other modules to do batch printing of packing slips/invoices but I would like to add this one to the contributions as well, its pretty simple requires 2 new files and 1 new table and optional modification of one file to add a link to the batch print page from orders.php What it does: 1-Take all the new orders and makes a page with a listing of all the orders and provides links to each invoice. 2-When the page is loaded a table is populated with all the orders that are on the list. In internet explorer you choose to print the page and use the second tab of the print dialog to opt to print all linked documents. This prints the listing as well as one invoice for each order. 3-Once this batch is printed you click the success button and it steps through the table created, updating each order with a status change to 'Processing' and notifies the customer. multiprint.php <?php require('includes/application_top.php'); include(DIR_WS_CLASSES . 'order.php'); $ids_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_status = 7 or orders_status = 8"); $invNum=mysql_num_rows($ids_query); tep_db_query("DELETE FROM `order_invoice_printed` "); echo " <h1>Make sure the printer has <b><u>$invNum</b></u> sheets of paper</h1>Displaying $invNum invoices to print...<br>In Internet Explorer go to File/Print, select the options tab and check the print all linked documents tab<br>If print was successful click the button to update statuses"; echo '<br> <b>Batch Print Invoices:</b> <form name="input" action="updatestatus.php" method="get"> <input type="submit" value="Success!!" /> </form>'; $oIDmax = min($oIDmin + $capacity,$oIDmax); while ($row = mysql_fetch_row($ids_query)) { $oIDCurr=$row[0]; tep_db_query("insert into order_invoice_printed (Order_ID, Print_Status) values ('" . (int)$oIDCurr . "', 0)"); $order = new order($oIDCurr); echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oIDCurr) . '" TARGET="multi_invoice">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> '; echo '(' .$order->customer['name'] . ' - Order #' . $oIDCurr . ') <br>'; } ?> and the code to make the updates to the selected orders updatestatus.php <?php require('includes/application_top.php'); include(DIR_WS_CLASSES . 'order.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $status=2; $comments=''; $id_query = tep_db_query("select Order_ID from order_invoice_printed where Print_Status=0"); while ($row = mysql_fetch_row($id_query)) { $oIDCurr=$row[0]; $check_status_query = tep_db_query("SELECT customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = $oIDCurr"); $check_status = tep_db_fetch_array($check_status_query); if (($check_status['orders_status'] != 2) || tep_not_null($comments)) { tep_db_query("update " . TABLE_ORDERS . " set orders_status = 2, last_modified = now() where orders_id = '" . (int)$oIDCurr . "'"); } $customer_notified = '1'; $email = STORE_NAME . "\n\n" . "Order Number: #" . ' ' . $oIDCurr . "\n" . "Invoice URL: " . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oIDCurr, 'SSL') . "\n" . "Date Ordered: " . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(Updated , $orders_status_array[$status]); tep_mail($check_status['customers_name'], $check_status['customers_email_address'], "Order Update from Llamma Corp", $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified) values ('" . (int)$oIDCurr . "', 2, now(), '" . tep_db_input($customer_notified) . "')"); } header( "Location: http://yoursite.com/catalog/admin/orders.php" ) ?> If you would like to try this out create the two files named as above add to your admin directory and add one table called 'order_invoice_printed' add to that table 2 rows called 'Order_ID' int(11) and 'Print_Status' char(1) you are up and running. As coded the orders in status 6 or 7 will be added to the list, alter the status line in multiprint.php to suit your needs. So that the basic deal. It works, its probably not all that pretty. I think done right it could be done in a single file and without the need for an additional table. What i would like to improve is the the ordering of the invoices. Once we have printed the stack we sort for any duplicate orders, we separate based on USPS shipped order and FedEx shipped orders and then order the postal service orders to group the heavier ones that will go USPS priority and the lighter ones that will be shipped USPS first class. I would like automate the process by pre-sorting the orders, first grouping any orders from the same customer, then the various fedex descending by weight and then postal service descending by weight. It seems like building an array of the orders and then manipulate the array before it is presented to the screen might be a viable option and could also eliminate the need for a table. I believe this whole process could be contained in a single file as apposed to two as we have done above. Any input would be appreciated.
  5. Llamma123

    PayPal IPN redirect issue

    First off I'm a relative novice when it comes to OSC and pretty dumb when it comes to IPN so I welcom any one to jump in here if I am giving bad advice. The URL should be http://yoursite.com/catalog/checkout_process.php (note that the ?osCsid=351adsf321asdf321asdf is a session identifyer and something that should never be hard coded as it changes with each session) I think you could jam "http://yoursite.com/catalog/checkout_process.php" into the paypal redirect feature and see sucess but it sounds like that would be circumventing the proper process and you would loose out on some data. Did you enable PayPal IPN in your paypal account under Profile/Selling Preferences/Instant Payment Notification Preferences? or did you enable auto return under Profile/Selling Preferences/Website Payment Preferences? I think you will need to give PayPal your website URL (like "http://yoursite.com/catalog/checkout_process.php") in one or the other place so it knows where to go after a sucessful payment has been received. It is possible that you need to update a config file to go allong with IPN to pass your URL to PayPal... can you post a link to the IPN you downloaded and installed? It does NOT look to me like you should edit the following file. /catalog/includes/languages/english/modules/payment/paypal_ipn.php Is there another paypal_ipn.php you were referring to?
  6. Llamma123

    UPS shipping

    Adjust the Tare weight (the idea is to add default weight for packaging) from admin navigate to Configuration|Shipping/Packaging|Package Tare Weight
  7. Llamma123

    List of "Must-Have" Modules?

    Thanks for the list, any others?
×