Latest News: (loading..)

greasemonkey

Members
  • Content count

    1,165
  • Joined

  • Last visited

  • Days Won

    23

greasemonkey last won the day on March 26

greasemonkey had the most liked content!

About greasemonkey

Profile Information

  • Real Name
    Scott
  • Gender
    Male
  1. Hi All, if any one is following this thread. I need some query help. As I had mentioned I have successfully created (by editing ShipStation supported ZenCart module) a shipstation integration module for OsCommerce and I have been using it for several months. It is a HUGE money saver for us to be able to compare rates on the fly before printing labels. Where I'm stuck is with the main query for the orders - when there is only 1 order in the database in the pending status it will not pull the order... When there is more than one order... it works like a charm. I presume there is something wrong with the "while" (which is what I believe loops).... but I have tried and failed. Any help? //get order from database $orders_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS . " WHERE orders_id >'0' and IFNULL(last_modified, date_purchased) BETWEEN '" . $sd . "' AND DATE_ADD('" . $ed . "', INTERVAL 1 MINUTE)"); $orders_result = tep_db_fetch_array($orders_query); if ($orders_result['orders_id']) { //begin outputing XML echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; echo "<Orders>\n"; //process orders while ($orders_result = tep_db_fetch_array($orders_query)) { //get order items from datbase $orderitems_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_PRODUCTS . " WHERE orders_id = '" . $orders_result['orders_id'] . "'"); // $orderitems_result = tep_db_fetch_array($orderitems_query); $cust_id = $orders_result['customers_id']; $cust_deff_id = $orders_result['customers_default_address_id']; $address_query = tep_db_query("SELECT * FROM " . TABLE_ADDRESS_BOOK . " WHERE customers_id = '$cust_id' and address_book_id = '$cust_deff_id'"); $address_result = tep_db_fetch_array($address_query); //billing country code $billing_country_id = $orders_result['billing_country']; $billing_query = tep_db_query("SELECT * FROM " . TABLE_COUNTRIES . " WHERE countries_name = '$billing_country_id'"); $billing_result = tep_db_fetch_array($billing_query); //billing country code //shipping country code $shipping_country_id = $orders_result['delivery_country']; $shipping_query = tep_db_query("SELECT * FROM " . TABLE_COUNTRIES . " WHERE countries_name = '$shipping_country_id'"); $shipping_result = tep_db_fetch_array($shipping_query); //billing zone code $billing_zone_id = addslashes($orders_result['billing_state']); $zone_billing_query = tep_db_query("SELECT * FROM " . TABLE_ZONES . " WHERE zone_name = '$billing_zone_id'"); $zone_billing_result = tep_db_fetch_array($zone_billing_query); //billing zone code //shipping zone code $shipping_zone_id = addslashes($orders_result['delivery_state']); $zone_shipping_query = tep_db_query("SELECT * FROM " . TABLE_ZONES . " WHERE zone_name = '$shipping_zone_id'"); $zone_shipping_result = tep_db_fetch_array($zone_shipping_query); //shipping zone code $ship_order_id = $orders_result['orders_id']; $ship_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '$ship_order_id' and class = 'ot_shipping'"); $ship_result = tep_db_fetch_array($ship_query); $order_total_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '$ship_order_id' and class = 'ot_total'"); $order_total_result = tep_db_fetch_array($order_total_query); $order_tax_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '$ship_order_id' and class = 'ot_tax'"); $order_tax_result = tep_db_fetch_array($order_tax_query); $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $orders_result['orders_status'] . "'"); $orders_status = tep_db_fetch_array($orders_status_query); $orders_history_query = tep_db_query("select date_added from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($orders_result['orders_id']) . "' and orders_status_id = '" . $order_status_id . "' order by date_added LIMIT 1"); $orders_history = tep_db_fetch_array($orders_history_query); $orders_history_comments_query = tep_db_query("select comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($orders_result['orders_id']) . "' and (comments is not null or comments != '') order by date_added LIMIT 1"); $orders_history_comments = tep_db_fetch_array($orders_history_comments_query); $shipping_comments = $orders_history_comments['comments']; echo "\t<Order>\n"; //order details AddFieldToXML("OrderID", $orders_result['orders_id']); AddFieldToXML("OrderNumber", $orders_result['orders_id']); AddFieldToXML("OrderDate", date('m/d/Y h:i A', strtotime($orders_result['date_purchased']))); AddFieldToXML("OrderStatus", '<![CDATA[' . $orders_status['orders_status_name'] . ']]>'); AddFieldToXML("LastModified", date('m/d/Y h:i A', strtotime($orders_result['last_modified']))); AddFieldToXML("ShippingMethod", '<![CDATA[' . $ship_result['title'] . ']]>'); AddFieldToXML("PaymentMethod", '<![CDATA[' . $orders_result['payment_method'] . ']]>'); AddFieldToXML("OrderTotal", round($order_total_result['value'], 2)); AddFieldToXML("TaxAmount", round($order_tax_result['value'], 2)); AddFieldToXML("ShippingAmount", round($ship_result['value'], 2)); AddFieldToXML("CustomerNotes", '<![CDATA[' . $shipping_comments . ']]>'); //order details //customer details echo "\t<Customer>\n"; AddFieldToXML("CustomerCode", $orders_result['customers_id']); //billing details echo "\t<BillTo>\n"; $billing_state = $orders_result['billing_state']; AddFieldToXML("Name", '<![CDATA[' . $orders_result['billing_name'] . ']]>'); AddFieldToXML("Company", '<![CDATA[' . $orders_result['billing_company'] . ']]>'); AddFieldToXML("Phone", $orders_result['customers_telephone']); AddFieldToXML("Email", $orders_result['customers_email_address']); echo "\t</BillTo>\n"; echo "\t<ShipTo>\n"; $shipping_state = $orders_result['delivery_state']; AddFieldToXML("Name", '<![CDATA[' . $orders_result['delivery_name'] . ']]>'); AddFieldToXML("Company", '<![CDATA[' . $orders_result['delivery_company'] . ']]>'); AddFieldToXML("Address1", '<![CDATA[' . $orders_result['delivery_street_address'] . ']]>'); AddFieldToXML("Address2", '<![CDATA[' . $orders_result['delivery_suburb'] . ']]>'); AddFieldToXML("City", '<![CDATA[' . $orders_result['delivery_city'] . ']]>'); AddFieldToXML("State", '<![CDATA[' . $shipping_state . ']]>'); AddFieldToXML("PostalCode", $orders_result['delivery_postcode']); AddFieldToXML("Country", $shipping_result['countries_iso_code_2']); AddFieldToXML("Phone", $orders_result['customers_telephone']); echo "\t</ShipTo>\n"; //shipping details echo "\t</Customer>\n"; //customer details echo "\t<Items>\n"; while ($orderitems_result = tep_db_fetch_array($orderitems_query)) { //process Order Items $image_query = tep_db_query("SELECT products_image, products_weight FROM " . TABLE_PRODUCTS . " WHERE products_id = '" . $orderitems_result['products_id'] . "'"); $image_result = tep_db_fetch_array($image_query); $weight = $image_result['products_weight']; $weight_grams = $weight * 1000; echo "\t<Item>\n"; AddFieldToXML("SKU", '<![CDATA[' . $orderitems_result['products_model']. ']]>'); AddFieldToXML("Name", '<![CDATA[' . $orderitems_result['products_name']. ']]>'); AddFieldToXML("ImageUrl", '<![CDATA[' . HTTP_SERVER . DIR_WS_CATALOG . 'images/' . $image_result['products_image']. ']]>'); AddFieldToXML("Weight", $weight_grams); AddFieldToXML("WeightUnits", 'grams'); AddFieldToXML("Quantity", $orderitems_result['products_quantity']); AddFieldToXML("UnitPrice", round($orderitems_result['final_price'], 2)); AddFieldToXML("Location", '<![CDATA['. $orderitems_result['products_location'] . ']]>'); //get attributes $orderitems_attributes_query = tep_db_query("SELECT orders_products_attributes_id, products_options, products_options_values FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " WHERE orders_id = '" . $orders_result['orders_id'] . "' and orders_products_id = '" . $orderitems_result['orders_products_id'] . "'"); echo "\t<Options>\n"; while ($orderitems_attributes_result = tep_db_fetch_array($orderitems_attributes_query)) { echo "\t<Option><Name><![CDATA[" . $orderitems_attributes_result['products_options'] . "]]></Name><Value><![CDATA[" . $orderitems_attributes_result['products_options_values'] . "]]></Value></Option>\n"; } echo "\t</Options>\n"; echo "\t</Item>\n"; } //process Order Items echo "\t</Items>\n"; echo "\t</Order>\n"; } //process Orders //finish outputing XML echo "</Orders>"; }
  2. I too use batch print without frames or PDF.
  3. @BrockleyJohn thanks again for your help. I spoke to my host about it last night and it turned out to be a simple fix - just a restart of mysqld....I presume it glitched out with the time change last week. Here was their reply for those interested:
  4. @BrockleyJohn yes it would seem to be an issue with MySQL. It is currently set at -4 GMT and America/Toronto is currently -5 GMT (we are -4 GMT in daylight savings time.... which ended 11/5). Researching quickly it seem like a timezone table could/should be set up...
  5. @BrockleyJohn thanks so much for your quick answer.... I'll try not to get your support thread too off topic then. Yes, I have my php.ini file set to date.timezone = "America/Toronto" And when I navigate to admin/server_info it does show correctly... including on admin/whos_online.... However the date for orders in the DB is 1 hour ahead. Example an order placed at EST 15:21:30 (my time.... as stamped by the CC processing API) landed in the orders table as 2017-11-15 16:21:30? Thinking about this.... that wouldn't be the server time (the server is on CST which would be 14:21:30)?????
  6. @BrockleyJohn just looking at this addon out to fix my server time issue (I'm in America/Toronto however my server is in America/Chicago) However, I don't require the opening a closing configs. Is there a simple config to have the store open 24/7?
  7. I believe it unrelated... I will leave with him to clarify if he sees it important.
  8. I'm guessing he nuked it himself as it just turned into more of the same....
  9. @puggybelle glad it worked... gotta put the warning out there again. Do not run that quick script on a live database without first testing it on a dummy db. As for moving to SSL across the entire site... read this thread. i did the same about a year back base on the info found in there
  10. @puggybelle as frank said test on a dummy db.... if you are just looking to run a query in phpmyadmin you could try something like update table_name set field_name = replace( field_name, 'original text', 'replacement text');
  11. @kymation thanks Jim.... it would seem I had a senior moment. Somehow I left FILENAME_STORE_LOGO... when I replaced the file straight from github the transfer failed and I didn't notice.
  12. the code is copied off github https://github.com/gburton/Responsive-osCommerce/blob/master/admin/store_logo.php Or do you mean you don't experience the problem in your fresh copy?
  13. Anyone have a clean brand new version of responsive they could quickly test for a bug? From the admin just try and upload/save a NEW logo.... brow When I do so I'm being returned to: admin/FILENAME_STORE_LOGO?action=save obviously not a good URL since filename has been removed. Looking at the code in admin/store_logo.php I do see a reference to filename if ($store_logo->parse()) { if ($store_logo->save()) { $messageStack->add_session(SUCCESS_LOGO_UPDATED, 'success'); tep_db_query("update configuration set configuration_value = '" . tep_db_input($store_logo->filename) . "' where configuration_value = '" . STORE_LOGO . "'"); } else { $error = true; } } else { $error = true; }
  14. Have a look at this thread... I never had a chance to make this into an addon... but all the info is there
  15. I believe Gary had been working on a Mailchimp/Mandrill commercial addon.... @burt I remember testing it when you where working on it... did you finish it?