Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

admin orders onclick change


Kevin.Dallas

Recommended Posts

need help with onclick, the way phpmyadmin works for example, on raw you can double click and edit info no submit button it updates the raw

<p id="demo">Double-click me.</p>

<script>
document.getElementById("demo").addEventListener("dblclick", myFunction);

function myFunction() {
  document.getElementById("demo").innerHTML = "I was double-clicked!";
}
</script>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
        $tracking_id = tep_db_prepare_input($_GET['cID']);
        tep_db_query("update from " . TABLE_ORDERS . " where tracking_id = '" . (int)$tracking_id . "'");
        tep_redirect(tep_href_link('orders.php', tep_get_all_get_params(array('cID', 'action'))));
        break;

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

<?php echo tep_draw_form('entry_tracking', 'orders.php', tep_get_all_get_params(array('action')) . 'oID=' . $orders['orders_id'] . 'action=update_order'); ?>
<input class="form-control form-control-sm" value="<?php echo $orders['tracking_id']; ?>" type="text" name="entry_tracking" maxlength="32">

 

 

 

order_edit.jpg

Link to comment
Share on other sites

<?php
    if (isset($_GET['cID'])) {
      $cID = tep_db_prepare_input($_GET['cID']);
      $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.tracking_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
    } elseif (isset($_GET['status']) && is_numeric($_GET['status']) && ($_GET['status'] > 0)) {
      $status = tep_db_prepare_input($_GET['status']);
      $orders_query_raw = "select o.orders_id, o.customers_name, o.tracking_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
    } else {
      $orders_query_raw = "select o.orders_id, o.customers_name, o.tracking_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
    }
    $orders_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
    $orders_query = tep_db_query($orders_query_raw);
    while ($orders = tep_db_fetch_array($orders_query)) {
    if ((!isset($_GET['oID']) || (isset($_GET['oID']) && ($_GET['oID'] == $orders['orders_id']))) && !isset($oInfo)) {
        $oInfo = new objectInfo($orders);
      }
      if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
        echo '<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('orders.php', tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
      } else {
        echo '<tr>' . "\n";
      }
?>
                <td class="dataTableContent"><?php echo '<a href="' . tep_href_link('orders.php', tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . '<i class="fa fa-search" aria-hidden="true"></i>' . '<span style="color:#000">&nbsp;' . $orders['customers_name']; ?></span></a></td>
                <td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td>
                <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td>
                <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
                <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo '<i class="fa fa-chevron-circle-right" aria-hidden="true"></i>'; } else { echo '<a href="' . tep_href_link('orders.php', tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . '<i class="fa fa-info-circle" aria-hidden="true"></i>' . '</a>'; } ?>&nbsp;</td>


<td class="dataTableContent" align="right">

<div id=demo><?php echo $orders['tracking_id']; ?><div>


<script type="text/javascript">

document.getElementById("demo").addEventListener("dblclick", crazy);

function crazy() {
  document.getElementById("demo").innerHTML = "<input class=form-control form-control-sm value=<?php echo $orders['tracking_id']; ?> type=text name=entry_tracking maxlength=32>";
}

</script>

</td>

              </tr>
<?php
    }
?>

Link to comment
Share on other sites

Hi Kevin,

What is your objective - what are you trying to achieve?

Regards,

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

On 10/16/2019 at 6:01 PM, peterpil19 said:

Hi Kevin,

What is your objective - what are you trying to achieve?

Regards,

Peter

Hello Peter, i have this raw in orders called tracking_id by dbclicking on input i would like to put tracking# like the way phpmyadmin is, by double clicking opening the input field and changing anything you like

 

in admin section that is i am using OSC edge

Link to comment
Share on other sites

Understood.

I'm unable to assist on the coding front, perhaps someone with greater knowledge can.

May I suggest this excellent add on by @Demitry which achieves the tracking functionality (but not the update field on input you are perhaps seeking).  I installed it myself this week.  It works perfectly, it is very simple, with some very basic core-code changes, which are appropriately commented by the author so you can easily reverse them later should you choose to uninstall: https://apps.oscommerce.com/S5MrB&order-tracking-for-bs

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

6 minutes ago, peterpil19 said:

Understood.

I'm unable to assist on the coding front, perhaps someone with greater knowledge can.

May I suggest this excellent add on by @Demitry which achieves the tracking functionality (but not the update field on input you are perhaps seeking).  I installed it myself this week.  It works perfectly, it is very simple, with some very basic core-code changes, which are appropriately commented by the author so you can easily reverse them later should you choose to uninstall: https://apps.oscommerce.com/S5MrB&order-tracking-for-bs

Peter

first I would like to thank you for taking your time and trying to implement the input section,  any way i can update the field, by clicking 

<?php echo tep_draw_form('entry_tracking', 'orders.php', tep_get_all_get_params(array('action')) . 'oID=' . $orders['orders_id'] . 'action=update_order'); ?>
<input class="form-control form-control-sm" value="<?php echo $orders['tracking_id']; ?>" type="text" name="entry_tracking" maxlength="32">

 

this is admin orders.php 

 

Link to comment
Share on other sites

@Kevin.Dallas

Kevin, as I understand it,.. I think what you're looking for is the ability to edit the tracking number after you've submitted it via Order Status Update.

Unfortunately my addon that Peter mentioned does not do this. You can enter it via the input field and it will be stored in the database for that particular Order Status Update, but to alter it after it was submitted with the Update button on that page, means having to go into the database.

I suggest contacting the author of the addon you're using to see if they can do this for you. What I think you need is to have the tracking number field in the Order Status Update section be an input-box that displays the tracking number saved in the database and can then be edited using onChange event.

Sorry I cannot be of more help.

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

@Kevin.Dallas

One more thing about the usability of creating a feature like this. I assume that you need to make changes once in a while to a tracking number due to an initial data-entry error.

With your solution,.. changing it in the Order History Update section/log will not send an email to the customer to notify them of the correction. And, it will not date/time stamp that correction for your own records, so that you can go back and see when you made this change.

Of course, you could hire a developer to have these features added as well, but why? All you have to do is post another Order Update with the correct tracking number and add a note saying that this is the correct tracking number so, please discard the one sent in the last update.

This will record in your Order History Update section/log and it will send an email to the customer notifying them of the change. Better record keeping, no need to get into the database, and no need to pay a developer. Problem solved!

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

On 10/19/2019 at 5:21 PM, Demitry said:

@Kevin.Dallas

One more thing about the usability of creating a feature like this. I assume that you need to make changes once in a while to a tracking number due to an initial data-entry error.

 

With your solution,.. changing it in the Order History Update section/log will not send an email to the customer to notify them of the correction. And, it will not date/time stamp that correction for your own records, so that you can go back and see when you made this change.

 

Of course, you could hire a developer to have these features added as well, but why? All you have to do is post another Order Update with the correct tracking number and add a note saying that this is the correct tracking number so, please discard the one sent in the last update.

 

This will record in your Order History Update section/log and it will send an email to the customer notifying them of the change. Better record keeping, no need to get into the database, and no need to pay a developer. Problem solved!

 

Good day, i am trying to edit the field i have a raw setup already called it tracking_id in  orders, in admin panel orders.php

 

$orders_query_raw = "select o.orders_id, o.customers_name, o.tracking_id, o.payment_method, o.date_purchased, o

 

<td class="dataTableContent" align="right" id="trackedit" contentEditable="true">

<div ><?php echo $orders['tracking_id']; ?><div>
<td class="smallText" valign="top"><?php echo tep_draw_button(IMAGE_UPDATE, 'disk', null, 'primary'); ?></td>

</td>

Untitled.jpg

Link to comment
Share on other sites

On 10/18/2019 at 5:18 PM, kgtee said:

Are you missing a "submit" button or an onclick () function?

html_output.php                                        DOESN'T"T WORK

////
// Output a form order '.$orders['tracking_id'].'
  function tep_draw_orders($name, $action, $parameters = '', $method = 'post', $params = '') {

    $form = '<form name="' . tep_output_string($name) . '" action="';
    if (tep_not_null($parameters)) {
      $form .= tep_href_link($action, $parameters);
    } else {
      $form .= tep_href_link($action);
    }
    $form .= '" method="' . tep_output_string($method) . '"';
    if (tep_not_null($params)) {
      $form .= ' ' . $params;
    }
    $form .= '>';

    return $form;
  }

 

----------------------------------------------------------------------------------------------------

orders.php

<?php echo tep_draw_orders('orders', 'orders.php', '', 'get'); ?>
                  <?php echo tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?>
                  <?php echo tep_hide_session_id(); ?>
</form>

Link to comment
Share on other sites

On 10/18/2019 at 5:41 PM, Demitry said:

@Kevin.Dallas

Kevin, as I understand it,.. I think what you're looking for is the ability to edit the tracking number after you've submitted it via Order Status Update.

Unfortunately my addon that Peter mentioned does not do this. You can enter it via the input field and it will be stored in the database for that particular Order Status Update, but to alter it after it was submitted with the Update button on that page, means having to go into the database.

I suggest contacting the author of the addon you're using to see if they can do this for you. What I think you need is to have the tracking number field in the Order Status Update section be an input-box that displays the tracking number saved in the database and can then be edited using onChange event.

Sorry I cannot be of more help.

 

 

i am building this addon, i try your addon there is a issue with a sql on checkout you have to null the value and add a tracking_no varchar(225) utf8_unicode_ci Yes NULL also edit the checkout_process.php                           'tracking_no' => $order->info['tracking_no'], 

 

i fixed it now it works at my end

Link to comment
Share on other sites

2 hours ago, Kevin.Dallas said:

i am building this addon, i try your addon there is a issue with a sql on checkout you have to null the value and add a tracking_no varchar(225) utf8_unicode_ci Yes NULL also edit the checkout_process.php                           'tracking_no' => $order->info['tracking_no'], 

 

i fixed it now it works at my end

Hi Kevin,

I don't experience any issues in checkout with @Demitry's add on,  what are you experiencing?

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

Quote

i try your addon there is a issue with a sql on checkout you have to null the value and add a tracking_no varchar(225) utf8_unicode_ci Yes NULL also edit the checkout_process.php                           'tracking_no' => $order->info['tracking_no'],

i fixed it now it works at my end

Thanks Peter, I was just going to ask you if you've had any issues with it. And, I have nothing in the error log as well.

The utf8_unicode_ci  in the orders_history_status table is something I did miss, but it works fine. I'll change it on the next update.

As far as adding tracking related code to the checkout_process.php file, ..again, I'm not sure why that would be needed. The tracking number is not issued or processed during checkout.

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

16 hours ago, peterpil19 said:

Hi Kevin,

I don't experience any issues in checkout with @Demitry's add on,  what are you experiencing?

Peter

good day, Peter and Demitry

wonderful you guys got it fixed, other then that it works good, i am still strangling on my function script on edit and update, what comes to customer notification that's simple

Link to comment
Share on other sites

On 10/21/2019 at 5:11 PM, peterpil19 said:

Hi Kevin,

I don't experience any issues in checkout with @Demitry's add on,  what are you experiencing?

Peter

hello Peter, 

I was wondering if you can help me out, on Demitry's addon alot of changes, i convert the sendmail to html but i am having issue with product & prices not showing in the body here is the code

$check_status_query = tep_db_query("select customers_name, customers_email_address, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_address_format_id, orders_status, date_purchased from " . orders . " where orders_id = '" . (int)$oID . "'");
$check_status = tep_db_fetch_array($check_status_query);
 

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$_GET['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);
 

    $email_order = $html_email;

            tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT . '- Order #' . tep_db_input($oID), nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 

 

 

 


<?php
    for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
      echo '      <tr class="dataTableRow">' . "\n" .
   '<td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
   '<td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
      if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
  echo '<br /><nobr><small>&nbsp; - ' . $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 '</small></nobr>';
}
      }
      echo '</td>' . "\n" .
   '<td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</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"><strong>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .

      echo '      </tr>' . "\n";
    }
?>

 

 

 

Link to comment
Share on other sites

Hi Kevin,

Sorry, I'm a little unclear.

Are you asking about Demitry's module or your original question?

The code above looks like it is from admin / orders and I cannot see the core code changes from Demitry's module.

Peter

CE PHOENIX SUPPORTER

Support the Project, go PRO and get access to certified add ons

Full-time I am a C-suite executive of a large retail company in Australia. In my spare time, I enjoying learning about web-design.

Download the latest version of CE Phoenix from gitHub here

Link to comment
Share on other sites

      echo '</td>' . "\n" .
   '<td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</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"><strong>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .

      echo '      </tr>' . "\n";

For one thing you have two echo statements and the first one is not closed with a semicolon. My development software is showing two other syntax errors in this block that I compared to my code and could not find. So, I replaced those two lines and the errors went away. Try this for that same block I posted above.

      echo '</td>' . "\n" .
   '<td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</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"><strong>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" . 
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n" .
   '<td class="dataTableContent" align="right" valign="top"><strong>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</strong></td>' . "\n";

      echo '      </tr>' . "\n";

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

On 10/21/2019 at 5:11 PM, peterpil19 said:

Hi Kevin,

I don't experience any issues in checkout with @Demitry's add on,  what are you experiencing?

Peter

Good day, Peter & Demitry

here is the code.

-----------------------------------------------------------------------

 

$order_updated = false;
$check_status_query = tep_db_query("select customers_name, customers_email_address, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_address_format_id, orders_status, date_purchased from " . orders . " where orders_id = '" . (int)$oID . "'");
$check_status = tep_db_fetch_array($check_status_query);


// lets start with the email confirmation

$category_query = tep_db_query("select cd.categories_prntinfo, cd.categories_prntimg, cd.categories_name, c.categories_image, cd.categories_description from " . categories . " c, " . categories_description . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);


$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . products . " p, " . products_description . " pd where p.products_id = '" . (int)$_GET['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);


// lets start with the email confirmation


// lets start with the email confirmation
if (EMAIL_USE_HTML == 'true') {
    require(DIR_FS_CATALOG . 'admin/includes/modules/htmlEmails/order_html.php');
    $email_order = $html_email;
}
if ((($check_status['orders_status'] != $status) || tep_not_null($comments) || tep_not_null($tracking_arr[$numkey]['number'])) && ($track_id_failed == 0)) {

  tep_db_query("update " . orders . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
  $customer_notified = '0';
  if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) {
    $notify_comments = '';
    if (isset($_POST['notify_comments']) && ($_POST['notify_comments'] == 'on')) {
      $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
    }


    $email_order = $html_email;


    tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT . '- Order #' . tep_db_input($oID), nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

    $customer_notified = '1';
  }

  tep_db_query("insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments, tracking_no, tracking_module_id) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "', '" . tep_db_input($tracking_arr[$numkey]['number']) . "', '" . tep_db_input($tracking_arr[$numkey]['id']) . "')");

  $order_updated = true;
}

-------------------------------------------admin/includes/modules/htmlEmails/order_html.php---------------------------

 

<?php


$ArrayLNTargets = array("\r\n", "\n\r", "\n", "\r", "\t"); 

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . products . " p, " . products_description . " pd where p.products_id = '" . (int)$_GET['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);


$html_email = '

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="hello">
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="assets/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Your order has been shipped and is on its way.</title>
<style>
<!--
 /* Font Definitions */
 @font-face
    {font-family:Helvetica;
    panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
    {font-family:"Cambria Math";
    panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
    {font-family:Calibri;
    panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
    {font-family:Tahoma;
    panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin:0in;
    margin-bottom:.0001pt;
    font-size:12.0pt;
    font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
    {mso-style-priority:99;
    color:blue;
    text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
    {mso-style-priority:99;
    color:purple;
    text-decoration:underline;}
p
    {mso-style-priority:99;
    margin:0in;
    margin-bottom:.0001pt;
    font-size:12.0pt;
    font-family:"Times New Roman","serif";}
p.readmsgbody, li.readmsgbody, div.readmsgbody
    {mso-style-name:readmsgbody;
    margin:0in;
    margin-bottom:.0001pt;
    font-size:12.0pt;
    font-family:"Times New Roman","serif";}
p.externalclass, li.externalclass, div.externalclass
    {mso-style-name:externalclass;
    margin:0in;
    margin-bottom:.0001pt;
    font-size:12.0pt;
    font-family:"Times New Roman","serif";}
p.track-link, li.track-link, div.track-link
    {mso-style-name:track-link;
    margin:0in;
    margin-bottom:.0001pt;
    text-align:center;
    border:none;
    padding:0in;
    font-size:10.0pt;
    font-family:"Helvetica","sans-serif";
    color:#252525;}
p.icon-cell, li.icon-cell, div.icon-cell
    {mso-style-name:icon-cell;
    margin:0in;
    margin-bottom:.0001pt;
    text-align:center;
    font-size:12.0pt;
    font-family:"Times New Roman","serif";}
p.site-name-cell, li.site-name-cell, div.site-name-cell
    {mso-style-name:site-name-cell;
    margin:0in;
    margin-bottom:.0001pt;
    text-align:center;
    font-size:12.0pt;
    font-family:"Times New Roman","serif";}
p.title-cell, li.title-cell, div.title-cell
    {mso-style-name:title-cell;
    margin:0in;
    margin-bottom:.0001pt;
    text-align:center;
    line-height:0%;
    font-size:21.0pt;
    font-family:"Helvetica","sans-serif";
    color:#252525;}
p.description-cell, li.description-cell, div.description-cell
    {mso-style-name:description-cell;
    margin:0in;
    margin-bottom:.0001pt;
    text-align:center;
    font-size:15.0pt;
    font-family:"Helvetica","sans-serif";
    color:#252525;}
p.order-details-label, li.order-details-label, div.order-details-label
    {mso-style-name:order-details-label;
    margin:0in;
    margin-bottom:.0001pt;
    text-align:right;
    font-size:12.0pt;
    font-family:"Helvetica","sans-serif";
    color:#252525;}
p.order-details-value, li.order-details-value, div.order-details-value
    {mso-style-name:order-details-value;
    margin:0in;
    margin-bottom:.0001pt;
    font-size:12.0pt;
    font-family:"Helvetica","sans-serif";
    color:#252525;}
p.store-name, li.store-name, div.store-name
    {mso-style-name:store-name;
    margin:0in;
    margin-bottom:.0001pt;
    text-align:center;
    font-size:15.0pt;
    font-family:"Helvetica","sans-serif";
    color:#252525;
    letter-spacing:1.5pt;
    font-weight:bold;}
span.order-details-label1
    {mso-style-name:order-details-label1;
    font-family:"Helvetica","sans-serif";
    color:#252525;
    letter-spacing:0pt;
    font-weight:normal;
    font-style:normal;}
span.order-details-value1
    {mso-style-name:order-details-value1;
    font-family:"Helvetica","sans-serif";
    color:#252525;
    letter-spacing:0pt;
    font-weight:normal;
    font-style:normal;}
span.EmailStyle30
    {mso-style-type:personal-reply;
    font-family:"Calibri","sans-serif";
    color:#1F497D;}
.MsoChpDefault
    {mso-style-type:export-only;
    font-size:10.0pt;}
@page Section1
    {size:8.5in 11.0in;
    margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
    {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div align=center>
<table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 width=660 style="width:530.0pt;background:white;border-collapse:collapse;border:none">
 <tr>
  <td valign=top style="border:solid #6F6F6F 1.0pt;padding:0in 37.5pt 0in 37.5pt">
  <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
   style="width:100.0%;border-collapse:collapse">
   <tr>
    <td valign=top style="padding:37.5pt 0in 22.5pt 0in">
    <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
     width="100%" style="width:100.0%;border-collapse:collapse">
     <tr>
      <td valign=top style="padding:0in 0in 0in 0in">
      <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
       width="100%" style="width:100.0%;border-collapse:collapse">
       <tr>
        <td valign=top style="padding:0in 0in 11.25pt 0in; height: 75px;">
        <div>
        <p class=MsoNormal align=center style="text-align:center"><span style="font-family:"Arial","sans-serif"">
<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '" style="text-decoration:none; color:white;"><font size="+4" style="margin-left:0.3em; text-decoration:none; color:black;">'.STORE_NAME.'

 

        


'.$product['products_description'].'
'.$product['products_id'].'


        </font></a>
        <o:p></o:p></span></p>
        </div>
        </td>
       </tr>

       </tr>
       <tr>
        <td valign=top style="padding:0in 0in 0in 0in">
        <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
         width="100%" style="width:100.0%;border-collapse:collapse">
         <tr>
          <td valign=top style="width:38%; padding:0in 18.75pt 0in 0in">
          <p class=MsoNormal><span class=order-details-label1>Order No.</span><span
          style="font-family:"Arial","sans-serif";color:#6F6F6F"> </span><span class=order-details-value1>'.tep_db_input($oID).'</span><span style="font-family:"Arial","sans-serif";color:#6F6F6F"> <o:p></o:p></span></p>
          </td>
          <td width="50%" valign=top style="width:50.0%;padding:0in 0in 0in 18.75pt">
          <p class=MsoNormal><span class=order-details-label1>Placed on</span><span
          style="font-family:"Arial","sans-serif";color:#6F6F6F"> </span><span
          class=order-details-value1>'.tep_date_long($check_status['date_purchased']).'</span><span style="font-family:
          "Arial","sans-serif";color:#6F6F6F"> <o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
          <td colspan=2 valign=top style="border:none;border-bottom:solid #DADADA 1.0pt;
          padding:18.75pt 0in 0in 0in"></td>
         </tr>
         <tr>
          <td colspan=2 valign=top style="padding:0in 0in 18.75pt 0in"></td>
         </tr>
         <tr>
          <td valign=top style="width:38%; padding:0in 18.75pt 0in 0in">
          <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style="width:145%; border-collapse:collapse">
           <tr>
            <td valign=top style="padding:0in 0in 0in 0in">
            <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style="width:125%; border-collapse:collapse">
             <tr>
              <td valign=top style="padding:0in 0in 15.0pt 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                Shipping to <o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                '.$check_status['customers_name'].'<o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                '.$check_status['customers_company'].'<o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                '.$check_status['customers_street_address'].'<o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                '.$check_status['customers_suburb'].'<o:p></o:p></span></p>
              </td>
             </tr>

             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                '.$check_status['customers_city'].', '.$check_status['customers_state'].' '.$check_status['customers_postcode'].'<o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                '.$check_status['customers_country'].'<o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in"><br>
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                <i class="fa fa-phone" aria-hidden="true"></i>'.$check_status['customers_email_address'].'<o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                <i class="fa fa-envelope-o" aria-hidden="true"></i>'.$check_status['customers_telephone'].'<o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                '.$check_status['address_format_id'].'<o:p></o:p></span></p>
              </td>
             </tr>
              </td>
             </tr>

             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif""> 
                <o:p></o:p></span></p>
              </td>
             </tr>
            </table>
            </td>
           </tr>
          </table>
          </td>
          <td style="padding:0in 0in 0in 0in">'. $orders_status_array[$status] .'</td>
           <td style="padding:0in 0in 0in 0in">'. $order->info['payment_method'] .'</td>
         </tr>
        </table>
        </td>
       </tr>
      </table>
      </td>
     </tr>
    </table>
    </td>
   </tr>
   <tr>
    <td valign=top style="border-top:solid #6F6F6F 1.0pt;border-left:none;
    border-bottom:solid #6F6F6F 1.0pt;border-right:none;padding:22.5pt 0in 22.5pt 0in">
    <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
     width="100%" style="width:100.0%;border-collapse:collapse">
     <tr>
      <td valign=top style="padding:0in 0in 0in 0in">
      <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
       width="100%" style="width:100.0%;border-collapse:collapse">
       <tr>
        <td valign=top style="padding:0in 0in 0in 0in">
        <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
        Shipped Items <o:p></o:p></span></p>
        </td>
       </tr>
       <tr>
        <td valign=top style="padding:0in 0in 22.5pt 0in">
        <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
         width="100%" style="width:100.0%;border-collapse:collapse">
         <tr>
          <td colspan=3 valign=top style="padding:22.5pt 0in 0in 0in"></td>
         </tr>
         <tr>
          <td valign=top style="padding:0in 0in 0in 0in">
          <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
           width="100%" style="width:100.0%;border-collapse:collapse">
           <tr style="height:75.0pt">
            <td width=100 valign=top style="width:75.0pt;padding:0in 15.0pt 0in 0in;
            height:75.0pt">
            <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">images<o:p></o:p></span></p>
            </td>
            <td valign=top style="padding:0in 15.0pt 0in 0in;height:75.0pt">
            <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
             width="100%" style="width:100.0%;border-collapse:collapse">
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">

                <o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                info: <o:p></o:p></span></p>
              </td>
             </tr>
             <tr>
              <td valign=top style="padding:0in 0in 0in 0in">
              <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
                Price: <o:p></o:p></span></p>
              </td>
             </tr>
            </table>
            </td>
           </tr>
          </table>
          </td>
          <td width=80 valign=top style="width:60.0pt;padding:0in 0in 0in 0in">
          <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
            Qty: 
            <o:p></o:p></span></p>
          </td>
          <td width=80 valign=top style="width:60.0pt;padding:0in 0in 0in 0in">
          <p class=MsoNormal align=right style="text-align:right"><span
          style="font-family:"Arial","sans-serif"">$<o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
          
          <td width=80 valign=top style="width:60.0pt;padding:0in 0in 0in 0in">
          &nbsp;</td>
          <td width=80 valign=top style="width:60.0pt;padding:0in 0in 0in 0in">
          &nbsp;</td>
         </tr>
         <tr style="height:22.5pt">
          <td valign=top style="padding:0in 0in 22.5pt 0in;height:22.5pt;
          display:flex;align-items: center">
          <p class=MsoNormal style="word-break:break-all"><span
          style="font-family:"Arial","sans-serif"">'.sprintf($tracking_arr[$i]['tracking_module_name'] ).' Tracking #: 
            '.$tracking_arr[$numkey]['number'].'<o:p></o:p></span></p>
          </td>
          <td valign=top style="padding:0in 0in 22.5pt 0in;height:22.5pt"></td>
          <td valign=top style="padding:0in 0in 22.5pt 0in;height:22.5pt">
          <p class=MsoNormal align=right style="text-align:right"><span style="font-family:"Arial","sans-serif"">
          <a href="https://track.aftership.com/usps/'.$tracking_arr[$numkey]['number'].'">

                <span style="font-size:10.0pt;font-family:&quot;Helvetica&quot;,&quot;sans-serif&quot;;color:#252525;border:solid #ADADAD 1.0pt;padding:8.0pt;text-decoration:none;text-underline:none">Track Shipment</span></a>


             <o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
          <td colspan=3 valign=top style="border:none;border-bottom:solid #DADADA 1.0pt;
          padding:0in 0in 0in 0in"></td>
         </tr>
        </table>
        </td>
       </tr>
       <tr>
        <td valign=top style="padding:22.5pt 0in 0in 0in">
        <div align=right>
        <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
         style="border-collapse:collapse">
         <tr>
          <td valign=top style="padding:0in 18.75pt 6.0pt 0in">
          <p class=MsoNormal><span style="font-family:"Helvetica","sans-serif";
          color:#121212">Subtotal<o:p></o:p></span></p>
          </td>
          <td valign=top style="padding:0in 0in 6.0pt 22.5pt">
          <p class=MsoNormal align=right style="text-align:right"><span
          style="font-family:"Helvetica","sans-serif";color:#121212">$<o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
          <td valign=top style="padding:0in 18.75pt 6.0pt 0in">
          <p class=MsoNormal><span style="font-family:"Helvetica","sans-serif";
          color:#121212">Shipping<o:p></o:p></span></p>
          </td>
          <td valign=top style="padding:0in 0in 6.0pt 22.5pt">
          <p class=MsoNormal align=right style="text-align:right"><span
          style="font-family:"Helvetica","sans-serif";color:#121212">$ <o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
          <td valign=top style="padding:0in 18.75pt 6.0pt 0in">
          <p class=MsoNormal><span style="font-family:"Helvetica","sans-serif";
          color:#121212">Tax<o:p></o:p></span></p>
          </td>
          <td valign=top style="padding:0in 0in 6.0pt 22.5pt">
          <p class=MsoNormal align=right style="text-align:right"><span
          style="font-family:"Helvetica","sans-serif";color:#121212">$ <o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
          <td colspan=2 valign=top style="border:none;border-bottom:solid #DADADA 1.0pt;
          padding:0in 0in 0in 0in"></td>
         </tr>
         <tr>
          <td valign=top style="padding:7.5pt 18.75pt 0in 0in">
          <p class=MsoNormal><span style="font-family:"Helvetica","sans-serif";
          color:#121212">Total<o:p></o:p></span></p>
          </td>
          <td valign=top style="padding:7.5pt 0in 0in 22.5pt">
          <p class=MsoNormal align=right style="text-align:right"><span
          style="font-family:"Helvetica","sans-serif";color:#121212">$<o:p></o:p></span></p>
          </td>
         </tr>
        </table>
        </div>
        </td>
       </tr>
      </table>
      </td>
     </tr>
    </table>
    </td>
   </tr>
   <tr style="height:130.5pt">
    <td valign=top style="padding:22.5pt 0in 45.0pt 0in;height:130.5pt">
    <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
     width="100%" style="width:100.0%;border-collapse:collapse">
     <tr>
      <td valign=top style="padding:0in 0in 0in 0in">
      <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
       width="100%" style="width:100.0%;border-collapse:collapse">
       <tr>
        <td valign=top style="padding:0in 0in 22.5pt 0in">
        <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
         width="100%" style="width:100.0%;border-collapse:collapse">
         <tr>
          <td valign=top style="padding:0in 0in 15.0pt 0in">
          <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">Need 
            Assistance? </span></p>
          </td>
         </tr>
         <tr>
          <td valign=top style="padding:0in 0in 0in 0in">
          <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
            We&#39;ll do everything we can to make sure you love your experience 
            with us.<o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
          <td valign=top style="padding:0in 0in 0in 0in">
          <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">
            Email us: <span style="color:black">[email protected]</span><o:p></o:p></span></p>
          </td>
         </tr>
        </table>
        </td>
       </tr>
       <tr>
        <td valign=top style="padding:0in 0in 0in 0in">
        <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
         width="100%" style="width:100.0%;border-collapse:collapse">
         <tr>
          <td valign=top style="padding:0in 0in 15.0pt 0in">
          <p class=MsoNormal><span style="font-family:"Arial","sans-serif"">This 
            email was sent by <span style="color:black">hello.</span><o:p></o:p></span></p>
          </td>
         </tr>
         <tr>
         </tr>
        </table>
        </td>
       </tr>
      </table>
      </td>
     </tr>
    </table>
    </td>
   </tr>
  </table>
  </td>
 </tr>
</table>

</div>

<p class=MsoNormal style="line-height:18.75pt"><span lang=EN style="font-family:
"Arial","sans-serif";color:#343434"><img border=0 width=1 height=1 id="_x0000_i1031"src=""><o:p></o:p></span></p>

</div>

<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">

</div>

</body>

</html>

Untitled.jpg

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...