Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 50
  1. #21
    Join Date
    Apr 2011
    Location
    England
    Posts
    16
    Plugin Contributions
    0

    Default Re: Quick status update

    Thanks for correcting my patch swguy

    Yes, I guess $customer_notified and $comments were redundant.

  2. #22
    Join Date
    Mar 2008
    Location
    QLD - Aussie
    Posts
    192
    Plugin Contributions
    0

    Default Re: Quick status update

    Thanks to swguy & slf3
    Works beautifully

  3. #23
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Quick status update

    Updated to support 1.5.0 and fix a bug in the creation of the status update form (missing end tag).
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #24
    Join Date
    Apr 2006
    Posts
    16
    Plugin Contributions
    0

    Default Re: Quick status update

    Anyway to just make it default to email customers? Once we get the order in we only update the status once to let the customer know it's shipped.

    Even a starting point of how to code that myself would be much appreciated. You make some awesome addons BTW!

  5. #25
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Quick status update

    Search down in orders.php for 'update_order'. This has the email logic; copy that back to the 'quick_status_update' case.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #26
    Join Date
    Apr 2006
    Posts
    16
    Plugin Contributions
    0

    Default Re: Quick status update

    Quote Originally Posted by swguy View Post
    Search down in orders.php for 'update_order'. This has the email logic; copy that back to the 'quick_status_update' case.
    Totally works! Thanks!

    In case anyone else needs to do this; all I had to do was pull everything from within the if/then block, and also grab the $check_status, from the same 'update_order' case, and paste it into the 'quick status update' block directly above it.


    Viola! (this is from around line 80 or so).
    PHP Code:
          // bof quick status update 
          
    case 'quick_status_update':
            
    $oID zen_db_prepare_input($_GET['oID']);
            
    $status zen_db_prepare_input($_POST['status']);

            
    $check_status $db->Execute("select customers_name, customers_email_address, orders_status,
              date_purchased from " 
    TABLE_ORDERS "
              where orders_id = '" 
    . (int)$oID "'");

                
    $notify_comments '';

                
    //send emails
                
    $message =
                
    EMAIL_TEXT_ORDER_NUMBER ' ' $oID "\n\n" .
                
    //EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" .
                
    EMAIL_TEXT_DATE_ORDERED ' ' zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
                
    strip_tags($notify_comments) .
                
    EMAIL_TEXT_STATUS_UPDATED sprintf(EMAIL_TEXT_STATUS_LABEL$orders_status_array[$status] ) .
                
    EMAIL_TEXT_STATUS_PLEASE_REPLY;

                
    $html_msg['EMAIL_CUSTOMERS_NAME']    = $check_status->fields['customers_name'];
                
    $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER ' ' $oID;
                
    //$html_msg['EMAIL_TEXT_INVOICE_URL']  = '<a href="' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') .'">'.str_replace(':','',EMAIL_TEXT_INVOICE_URL).'</a>';
                
    $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED ' ' zen_date_long($check_status->fields['date_purchased']);
                
    $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
                
    $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\n',''EMAIL_TEXT_STATUS_UPDATED);
                
    $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\n',''sprintf(EMAIL_TEXT_STATUS_LABEL$orders_status_array[$status] ));
                
    $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
                
    $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\n',''EMAIL_TEXT_STATUS_PLEASE_REPLY);

                
    zen_mail($check_status->fields['customers_name'], $check_status->fields['customers_email_address'], EMAIL_TEXT_SUBJECT ' #' $oID$messageSTORE_NAMEEMAIL_FROM$html_msg'order_status');
                
    $customer_notified '1';

                
    //send extra emails
                
    if (SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_STATUS == '1' and SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO != '') {
                  
    zen_mail(''SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TOSEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_SUBJECT ' ' EMAIL_TEXT_SUBJECT ' #' $oID$messageSTORE_NAMEEMAIL_FROM$html_msg'order_status_extra');
                }

            if (
    $oID) {
              
    $db->Execute("update " TABLE_ORDERS "
                set orders_status = '" 
    zen_db_input($status) . "', last_modified = now()
                where orders_id = '" 
    . (int)$oID "'");
              
    $db->Execute("insert into " TABLE_ORDERS_STATUS_HISTORY "
                (orders_id, orders_status_id, date_added, customer_notified, comments)
                values ('" 
    . (int)$oID "',
                  '" 
    zen_db_input($status) . "',
                  now(),
              '0', '')"
    );
            }
            
            
    zen_redirect(zen_href_link(FILENAME_ORDERSzen_get_all_get_params(array('action')) . '''NONSSL'));
            break; 
            
    // eof quick status update 

  7. #27
    Join Date
    Oct 2008
    Posts
    591
    Plugin Contributions
    0

    Default Re: Quick status update

    I tried to run it with super order
    Without success .

  8. #28
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Quick status update

    Search down in orders.php for 'update_order'. This has the email logic; copy that back to the 'quick_status_update' case.
    I assume you mean ALL the code, including the payment transaction feedback and the download timings...the previous post has ignored that.

    I have used this, and it is working ok (including the message bar, which the original contribution code does not include)
    PHP Code:
          // bof quick status update 
          
    case 'quick_status_update':
            
    $oID zen_db_prepare_input($_GET['oID']);
            
    $status zen_db_prepare_input($_POST['status']);
            
            
    $check_status $db->Execute("select customers_name, customers_email_address, orders_status,
                                          date_purchased from " 
    TABLE_ORDERS "
                                          where orders_id = '" 
    . (int)$oID "'");
            
            if (
    $check_status->fields['orders_status'] != $status) {
              
    $db->Execute("update " TABLE_ORDERS "
                            set orders_status = '" 
    zen_db_input($status) . "', last_modified = now()
                            where orders_id = '" 
    . (int)$oID "'");

              
    $customer_notified '0';
    //          if (isset($_POST['notify']) && ($_POST['notify'] == '1')) {

                
    $notify_comments '';
    /*            if (isset($_POST['notify_comments']) && ($_POST['notify_comments'] == 'on') && zen_not_null($comments)) {
                  $notify_comments = EMAIL_TEXT_COMMENTS_UPDATE . $comments . "\n\n";
                }*/
                //send emails
                
    $message STORE_NAME "\n" EMAIL_SEPARATOR "\n" //steve
                
    EMAIL_TEXT_ORDER_NUMBER ' ' $oID "\n\n" .
                
    EMAIL_TEXT_INVOICE_URL ' ' zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO'order_id=' $oID'SSL') . "\n\n" .
                
    EMAIL_TEXT_DATE_ORDERED ' ' zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
                
    strip_tags($notify_comments) .
                
    EMAIL_TEXT_STATUS_UPDATED sprintf(EMAIL_TEXT_STATUS_LABEL$orders_status_array[$status] ) .
                
    EMAIL_TEXT_STATUS_PLEASE_REPLY;

                
    $html_msg['EMAIL_CUSTOMERS_NAME']    = $check_status->fields['customers_name'];
                
    $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER ' ' $oID;
                
    $html_msg['EMAIL_TEXT_INVOICE_URL']  = '<a href="' zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO'order_id=' $oID'SSL') .'">'.str_replace(':','',EMAIL_TEXT_INVOICE_URL).'</a>';
                
    $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED ' ' zen_date_long($check_status->fields['date_purchased']);
                
    $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
                
    $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\n',''EMAIL_TEXT_STATUS_UPDATED);
                
    $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\n',''sprintf(EMAIL_TEXT_STATUS_LABEL$orders_status_array[$status] ));
                
    $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
                
    $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\n',''EMAIL_TEXT_STATUS_PLEASE_REPLY);
                
    $html_msg['EMAIL_PAYPAL_TRANSID'] = '';

                
    zen_mail($check_status->fields['customers_name'], $check_status->fields['customers_email_address'], EMAIL_TEXT_SUBJECT ' #' $oID$messageSTORE_NAMEEMAIL_FROM$html_msg'order_status');
                
    $customer_notified '1';

                
    // PayPal Trans ID, if any
                
    $sql "select txn_id, parent_txn_id from " TABLE_PAYPAL " where order_id = :orderID order by last_modified DESC, date_added DESC, parent_txn_id DESC, paypal_ipn_id DESC ";
                
    $sql $db->bindVars($sql':orderID'$oID'integer');
                
    $result $db->Execute($sql);
                if (
    $result->RecordCount() > 0) {
                  
    $message .= "\n\n" ' PayPal Trans ID: ' $result->fields['txn_id'];
                  
    $html_msg['EMAIL_PAYPAL_TRANSID'] = $result->fields['txn_id'];
                }

                
    //send extra emails
                
    if (SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_STATUS == '1' and SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO != '') {
                  
    zen_mail(''SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TOSEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_SUBJECT ' ' EMAIL_TEXT_SUBJECT ' #' $oID$messageSTORE_NAMEEMAIL_FROM$html_msg'order_status_extra');
                }
              } elseif (isset(
    $_POST['notify']) && ($_POST['notify'] == '-1')) {
                
    // hide comment
                
    $customer_notified '-1';
              }

              
    $order_updated true;
            
    //}
              
    $db->Execute("insert into " TABLE_ORDERS_STATUS_HISTORY "
                          (orders_id, orders_status_id, date_added, customer_notified, comments)
                          values ('" 
    . (int)$oID "',
                          '" 
    zen_db_input($status) . "',
                          now(),
                          '1',
                          '')"
    );
              
    $order_updated true;

            
    // trigger any appropriate updates which should be sent back to the payment gateway:
            
    $order = new order((int)$oID);
            if (
    $order->info['payment_module_code']) {
              if (
    file_exists(DIR_FS_CATALOG_MODULES 'payment/' $order->info['payment_module_code'] . '.php')) {
                require_once(
    DIR_FS_CATALOG_MODULES 'payment/' $order->info['payment_module_code'] . '.php');
                require_once(
    DIR_FS_CATALOG_LANGUAGES $_SESSION['language'] . '/modules/payment/' $order->info['payment_module_code'] . '.php');
                
    $module = new $order->info['payment_module_code'];
                if (
    method_exists($module'_doStatusUpdate')) {
                  
    $response $module->_doStatusUpdate($oID$status$comments$customer_notified$check_status->fields['orders_status']);
                }
              }
            }

            if (
    $order_updated == true) {
              if (
    $status == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) {

                
    // adjust download_maxdays based on current date
                
    $chk_downloads_query "SELECT opd.*, op.products_id from " TABLE_ORDERS_PRODUCTS_DOWNLOAD " opd, " TABLE_ORDERS_PRODUCTS " op
                                        WHERE op.orders_id='" 
    . (int)$oID "'
                                        and opd.orders_products_id = op.orders_products_id"
    ;
                
    $chk_downloads $db->Execute($chk_downloads_query);

                while (!
    $chk_downloads->EOF) {
                  
    $chk_products_download_time_query "SELECT pa.products_attributes_id, pa.products_id, pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount
                                                        from " 
    TABLE_PRODUCTS_ATTRIBUTES " pa, " TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD " pad
                                                        WHERE pa.products_attributes_id = pad.products_attributes_id
                                                        and pad.products_attributes_filename = '" 
    $chk_downloads->fields['orders_products_filename'] . "'
                                                        and pa.products_id = '" 
    $chk_downloads->fields['products_id'] . "'";

                  
    $chk_products_download_time $db->Execute($chk_products_download_time_query);

                  if (
    $chk_products_download_time->EOF) {
                    
    $zc_max_days = (DOWNLOAD_MAX_DAYS == zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s'time())) + DOWNLOAD_MAX_DAYS);
                    
    $update_downloads_query "update " TABLE_ORDERS_PRODUCTS_DOWNLOAD " set download_maxdays='" $zc_max_days "', download_count='" DOWNLOAD_MAX_COUNT "' where orders_id='" . (int)$oID "' and orders_products_download_id='" $_GET['download_reset_on'] . "'";
                  } else {
                    
    $zc_max_days = ($chk_products_download_time->fields['products_attributes_maxdays'] == zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s'time())) + $chk_products_download_time->fields['products_attributes_maxdays']);
                    
    $update_downloads_query "update " TABLE_ORDERS_PRODUCTS_DOWNLOAD " set download_maxdays='" $zc_max_days "', download_count='" $chk_products_download_time->fields['products_attributes_maxcount'] . "' where orders_id='" . (int)$oID "' and orders_products_download_id='" $chk_downloads->fields['orders_products_download_id'] . "'";
                  }

                  
    $db->Execute($update_downloads_query);

                  
    $chk_downloads->MoveNext();
                }
              }
              
    $messageStack->add_session(SUCCESS_ORDER_UPDATED'success');
            } else {
              
    $messageStack->add_session(WARNING_ORDER_NOT_UPDATED'warning');
            }             
            
    //}
            
    zen_redirect(zen_href_link(FILENAME_ORDERSzen_get_all_get_params(array('action')) . '''NONSSL'));
          break; 
          
    // eof quick status update 
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  9. #29
    Join Date
    Oct 2008
    Posts
    591
    Plugin Contributions
    0

    Default Re: Quick status update

    need merge orders.php with super_orders.php ?
    It's not work.

  10. #30
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,696
    Plugin Contributions
    123

    Default Re: Quick status update

    I only did it for orders, not super orders.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. v154 Change Email Subject of Status Update Messages To Show Assigned Status
    By ShopVille in forum Managing Customers and Orders
    Replies: 12
    Last Post: 27 Oct 2015, 02:43 PM
  2. Quick Updates addon?
    By computel in forum Upgrading to 1.5.x
    Replies: 3
    Last Post: 17 May 2012, 05:52 PM
  3. Change Email Subject of Status Update Messages e.g. Order Update XXXX
    By apemusic in forum Managing Customers and Orders
    Replies: 4
    Last Post: 13 Oct 2010, 08:42 AM
  4. Quick way to update ORDER STATUS?
    By gizmo_girl in forum Managing Customers and Orders
    Replies: 4
    Last Post: 5 Mar 2008, 01:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR