Jump to content
Sign in to follow this  
blucollarguy

Vendor_Auto_E-mail (In_Development)

Recommended Posts

Now for some reason when i place a test order and it is in default proccessing stage i don't get any vendor emails BUT when i update it to delivered i get a copy of the update that is sent out to the customer .... any help BC

To illadelph and Steve:

Sorry for the late reply to your earlier post as well illadelph , been busy. I still don't have any clue why it isn't working in general, but this one is simple. You are getting a copy of every email that is sent from your store. This is the send a copy function you installed with VAE(Vendors Auto Email). You can undo this by going to admin/includes/functions/general.php and find this that you added during the install

//vendors_email start: works to send copy of EVERY EMAIL SENT FROM STORE
//  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
    $message->send('', SEND_EXTRA_ORDER_EMAILS_TO, $from_email_name, $from_email_address, $email_subject);

      //vendors_email end

comment out this

$message->send('', SEND_EXTRA_ORDER_EMAILS_TO, $from_email_name, $from_email_address, $email_subject);

by adding double slashes in FRONT of this line of text. It should look like this afterwards

//vendors_email start: works to send copy of EVERY EMAIL SENT FROM STORE
//  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
 //   $message->send('', SEND_EXTRA_ORDER_EMAILS_TO, $from_email_name, $from_email_address, $email_subject);

      //vendors_email end

That should get rid of the extra emails. I am still at a loss as to why this is not working for you. There is nothing I can think of that should be preventing this mod from working. With this latest release, I literally used the instructions to install it on a brand new clean install of osCommerce 2.2 MS2, updated some of the instructrions, and did a test Vendor, a product, and a purchase. Got everything I was supposed to get. You are getting no errors anywhere, right? Just no emails? Steve said he still had the same issue. Did you use the orders.php file included with the contrib, or do the editing? The only thing I can think of is maybe an error at some point in the orders.php file. If you edited yours, post it for me and I will test it myself. Steve, same goes for you. I will let you know if I think of anything else. Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

illadelph, I just realised that you referred to

default proccessing stage i don't get any vendor emails BUT
"Default processing stage" being what in your store? The email will only go out AFTER the order_status is updated to whatever you are calling "payment accepted", which in a stock osC is "Processing". The key here is the status number. VAE looks for order_status number 2 If you have made any changes to your order_status setup, you will need to use the number that corresponds to what ever order_status you want to use. I plan on adding a mod to change for each individual Vendor, giving one the power to select a different status for each Vendor if they want, or setting a default status for all emails. Any help? Craig :) Edited by blucollarguy

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Ok folks, I think I've discovered this bug of the email not giong out for some people. I just updated to the latest PayPal IPN and my emails no longer go out when the order get's posted back and the status is updated. I don't have a solution yet but if your isn't working, do this test, place an order but stop at the final payment screen at your processor, you must go past "checkout confirmation" for the order to be entered into the database as an actual order. Then go to your orders page and manually update it to "processing" and see if your email goes out. If it does then this is the problem. If it still does not go out, then obviously something else is the issue. I will try to create a mod for this that does not depend the "orders.php" file being called, which it does now, so that it will not matter what payment gateway your using. I'll be in touch. Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

blucollarguy well when i place the order and i go to the prder admin it is in the second stage ie proccessing already but no email is received okay here is a copy of my order.php and am using 2checkout as my payment gateway

 

<?php
/*
 $Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $
 including Vendors_Auto_Email by Craig Garrison Sr. (craig@blucollarsales.com)
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
//vendors email begin
 function vendors_email($oID) {
// Get the delivery address
 $delivery_address_query = tep_db_query("select distinct delivery_company, delivery_name, delivery_street_address, delivery_city, delivery_state, delivery_postcode from orders where orders_id='" . $oID ."'");
 $delivery_address_list = tep_db_fetch_array($delivery_address_query);


   //find out what shipping methods the customer chose
 $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $oID . "' and class = 'ot_shipping'");
     $shipping_method = tep_db_fetch_array($shipping_method_query);

$vendors_email_query = tep_db_query("select distinct o.orders_id, v.vendors_id, v.vendors_name, v.vendors_email, v.vendors_contact, v.vendor_add_info, v.vendor_street, v.vendor_city, v.vendor_state, v.vendors_zipcode, v.vendor_country, v.account_number, o.products_id, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and o.products_id=p.products_id and o.orders_id='" . $oID . "' and v.vendors_send_email=1 GROUP BY vendors_id");
 while ($vendors_email_list= tep_db_fetch_array($vendors_email_query))  {
   $order_number='" . $oID . "';
   $the_email=$vendors_email_list['vendors_email'];
   $the_name=$vendors_email_list['vendors_name'];
   $the_contact=$vendors_email_list['vendors_contact'];
   $email=  'To: <b>' . $the_contact . '  <br>' . $the_name . '<br>' . $the_email . '<br>' .
   $vendors_email_list['vendor_street'] .'<br>' .
   $vendors_email_list['vendor_city'] .', <b>' .
   $vendors_email_list['vendor_state'] .' <b>' .
   $vendors_email_list['vendors_zipcode'] . ' <b>' . $vendors_email_list['vendor_country'] . '<br>' . "\n" . EMAIL_SEPARATOR . "\n" . 'Special Comments or Instructions:  <b>' . $vendors_email_list['vendor_add_info'] .'<b>' . "\n" . EMAIL_SEPARATOR . "\n" . 'From: <b>' . STORE_OWNER . "\n" . STORE_NAME_ADDRESS . "\n" . 'Accnt #: <b>' . $vendors_email_list['account_number'] . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" .  EMAIL_SEPARATOR . "\n" . '</b><br><br>Shipping Metthod:<br>' .  $shipping_method['title'] . '<br>' . '</b><br>Dropship deliver to:<br>' .
   $delivery_address_list['delivery_company'] .'<br>' .
   $delivery_address_list['delivery_name'] .'<br>' .
   $delivery_address_list['delivery_street_address'] .'<br>' .
   $delivery_address_list['delivery_city'] .'<br>' .
   $delivery_address_list['delivery_state'] . ' ' . $delivery_address_list['delivery_postcode'] . '<br>';


// Get all the products to be included in the email
   $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id,  p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' order by o.products_name");

   $email = $email .
   '<table width="75%" border=1 cellspacing="0" cellpadding="3">
   <tr><td>Qty:</td><td>Productname:</td><td>Item Code/Number:</td><td>Productmodel:</td><td>Per Unit Price:</td><td>Item Comments: </td></tr>';
   while ($vendors_email_products= tep_db_fetch_array($vendors_email_products_query)) {
     $email = $email . '<tr><td>' . $vendors_email_products['products_quantity'] . '</td><td>' . $vendors_email_products['products_name'] . '</td><td>' . $vendors_email_products['vendors_prod_id'] .
'</td><td>' . $vendors_email_products['products_model'] .
'</td><td>' . $vendors_email_products['vendors_product_price'] . '</td><td>' .
        $vendors_email_products['vendors_prod_comments'] . '</td></tr>';

     $current_products_id=$vendors_email_products['products_id'];
     $vendors_email_products_attributes_query = tep_db_query("select distinct p.vendors_id, opa.products_options_values from orders_products_attributes opa, orders o, products p where opa.orders_id='" .  $oID . "' and opa.orders_products_id='" . $current_products_id . "' and p.vendors_id='" . $vendors_email_products['vendors_id']. "' GROUP BY vendors_id");
     while ($vendors_email_products_attributes= tep_db_fetch_array($vendors_email_products_attributes_query)) {
       $email_message = $email_message . '<tr><td> </td><td colspan=3>'. $vendors_email_products_attributes['products_options_values'] .'</td></tr>';
    }

//  $email= $email .  '<br>' . $email_message;

   }
   $email = $email . '</table><br><HR><br>';

//send the email
tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID ,  $email .  '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS) ;
 }
return true;
}
//vendors_email end, but there is more to do, keep looking

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $orders_statuses = array();
 $orders_status_array = array();
 $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");
 while ($orders_status = tep_db_fetch_array($orders_status_query)) {
   $orders_statuses[] = array('id' => $orders_status['orders_status_id'],
                              'text' => $orders_status['orders_status_name']);
   $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
 }

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if (tep_not_null($action)) {
 switch ($action) {
   case 'update_order':
     $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
     $status = tep_db_prepare_input($HTTP_POST_VARS['status']);
     $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

     $order_updated = false;
     $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
     $check_status = tep_db_fetch_array($check_status_query);

     if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {
         tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
        //Vendors email check status begin
        if ($status == 2) {
          vendors_email($oID);
        }
        //Vendors email check status end  This is the last mod to make, your done

         $customer_notified = '0';
         if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) {
           $notify_comments = '';
           if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {
             $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";
           }

           $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

           tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

           $customer_notified = '1';
         }

         tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "')");

         $order_updated = true;
       }

       if ($order_updated == true) {
        $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
       } else {
         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
       }

       tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));
       break;
     case 'deleteconfirm':
       $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

       tep_remove_order($oID, $HTTP_POST_VARS['restock']);

       tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));
       break;
   }
 }

 if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {
   $oID = tep_db_prepare_input($HTTP_GET_VARS['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');
   }
 }

 include(DIR_WS_CLASSES . 'order.php');
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php
 require(DIR_WS_INCLUDES . 'header.php');
?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if (($action == 'edit') && ($order_exists == true)) {
   $order = new order($oID);
?>
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
           <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td colspan="3"><?php echo tep_draw_separator(); ?></td>
         </tr>
         <tr>
           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
               <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
             </tr>
             <tr>
               <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
             </tr>
             <tr>
               <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td>
               <td class="main"><?php echo $order->customer['telephone']; ?></td>
             </tr>
             <tr>
               <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td>
               <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>
             </tr>
           </table></td>
           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>
               <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>
             </tr>
           </table></td>
           <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>
               <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
           <td class="main"><?php echo $order->info['payment_method']; ?></td>
         </tr>
<?php
   if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {
?>
         <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td>
           <td class="main"><?php echo $order->info['cc_type']; ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td>
           <td class="main"><?php echo $order->info['cc_owner']; ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td>
           <td class="main"><?php echo $order->info['cc_number']; ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td>
           <td class="main"><?php echo $order->info['cc_expires']; ?></td>
         </tr>
<?php
   }
?>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr class="dataTableHeadingRow">
           <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
           <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>
           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>
           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>
           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>
           <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>
         </tr>
<?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'] . ' 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> <i> - ' . $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 '</i></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"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .
          '            <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";
     echo '          </tr>' . "\n";
   }
?>
         <tr>
           <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">
<?php
   for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
     echo '              <tr>' . "\n" .
          '                <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .
          '                <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .
          '              </tr>' . "\n";
   }
?>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><table border="1" cellspacing="0" cellpadding="5">
         <tr>
           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>
           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>
           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>
           <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
         </tr>
<?php
   $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments 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="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="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .
            '            <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .
            '          </tr>' . "\n";
     }
   } else {
       echo '          <tr>' . "\n" .
            '            <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
            '          </tr>' . "\n";
   }
?>
       </table></td>
     </tr>
     <tr>
       <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
     </tr>
     <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?>
       <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" cellspacing="0" cellpadding="2">
         <tr>
           <td><table border="0" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>
             </tr>
             <tr>
               <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>
               <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>
             </tr>
           </table></td>
           <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>
         </tr>
       </table></td>
     </form></tr>
     <tr>
       <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
     </tr>
<?php
 } else {
?>
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
           <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>
               <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>
             </form></tr>
             <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>
               <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>
             </form></tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr class="dataTableHeadingRow">
               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>
               <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
             </tr>
<?php
   if (isset($HTTP_GET_VARS['cID'])) {
     $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
     $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_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($HTTP_GET_VARS['status'])) {
     $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
     $orders_query_raw = "select o.orders_id, o.customers_name, 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.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($HTTP_GET_VARS['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($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['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(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
     } else {
       echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
     }
?>
               <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></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 tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
             </tr>
<?php
   }
?>
             <tr>
               <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
                 <tr>
                   <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td>
                   <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td>
                 </tr>
               </table></td>
             </tr>
           </table></td>
<?php
 $heading = array();
 $contents = array();

 switch ($action) {
   case 'delete':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>');

     $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm'));
     $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
     $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
   default:
     if (isset($oInfo) && is_object($oInfo)) {
       $heading[] = array('text' => '<b>[' . $oInfo->orders_id . ']  ' . tep_datetime_short($oInfo->date_purchased) . '</b>');

       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');
       $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));
       if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified));
       $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' '  . $oInfo->payment_method);
     }
     break;
 }

 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
   echo '            <td width="25%" valign="top">' . "\n";

   $box = new box;
   echo $box->infoBox($heading, $contents);

   echo '            </td>' . "\n";
 }
?>
         </tr>
       </table></td>
     </tr>
<?php
 }
?>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Ok folks, I think I've discovered this bug of the email not giong out for some people. I just updated to the latest PayPal IPN and my emails no longer go out when the order get's posted back and the status is updated. I don't have a solution yet but if your isn't working, do this test, place an order but stop at the final payment screen at your processor, you must go past "checkout confirmation" for the order to be entered into the database as an actual order. Then go to your orders page and manually update it to "processing" and see if your email goes out. If it does then this is the problem. If it still does not go out, then obviously something else is the issue. I will try to create a mod for this that does not depend the "orders.php" file being called, which it does now, so that it will not matter what payment gateway your using. I'll be in touch. Craig :)

Share this post


Link to post
Share on other sites

Ok illadelph try this:

go to the order and change the status to something other than "processing". Then, update it back to "processing" and see if it sends the email. If it does, then the issue is at least related to what I had posted earlier. Your orders.php file looks right, It sends an email from my test shop when I loaded it. If you did not actually complete the order(all the way through the payment process and get redirected back to "checkout_success" and the status was already "processing", then you must have your "default" status as "processing", which bypasses the function of the way I wrote this mod. You can deal with this by either changing your "default" status, or changing the number used to decide when to send the email. In the orders.php file it is set to "2" which is "processing" in a standard osC install. It is this code:

//Vendors email check status begin
       if ($status == 2) {
         vendors_email($oID);
       }
       //Vendors email check status end  This is the last mod to make, your done

The number reperesents "processing", if you are not using a gateway that calls the orders.php file to update the status, then the orders.php file does not know to send the email. An earlier post here

showed a hack to send the email at the time the order was placed, not waiting until the order was updated. You can try this as well and see if it works. I will be working on a different way of checking the status so it will still go out only after the payment has been verified. Good luck, Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Hey blucollarguy it finnally worked when i used the hack BUT the vendor email is not showing up properly ie i knowu said one should set there email client in html format which i have with outlook but still the email looks like this ;

 

Jim Bellows? Vendor namevendoremail@yahoo.com151 wayne Road #3New brunswick, PA 19000 USA

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

Special Comments or Instructions:? This email is an automatic

notification that your product was purchased from our Online Catalog

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

From: Tha Gifty

Tel:?  111.111.1111

? ? ? 

? ? ? ?

Tha Gift

125 East Main

Philadelphia , PA

Accnt #: 0000101172005

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

Order Number: 155

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

 

?  Qty:Product Name:Item Code/Number:Product Model:Per Unit Price:Item

Comments:  1 the rivers  eamusic7878 15.0000 1 the rivars thealbums2005 hiphopid 15.0000Our Credit card proccessor requires

to perform a fraud check on the order before charging the credit card

used in the purchase this takes between 2hrs - 2 days soon as the

purchase passes the fraud review stage the customers credit card will be

charged the entire amount.

If you have any questions please forward all your inquiries to

sales desk for an immediate resolution.

 

Thank You

 

the other stuff i added on the vendor info page on the product page and on the vendor page but seems like i need to edit some file to get this right what section of the order.php do i need to edit

Edited by illadelph

Share this post


Link to post
Share on other sites
Hey blucollarguy it finnally worked when i used the hack BUT the vendor email is not showing up properly ie i knowu said one should set there email client in html format which i have with outlook but still the email looks like this ;

the other stuff i added on the vendor info page on the product page and on the vendor page but seems like i need to edit some file to get this right what section of the order.php do i need to edit

Your seeing it this way because it was not sent as HTML. Check that your email to your cusotmers is in HTML, if not you will need to install one of the many HTML email contributions to get it working right. Glad that got it to send the email though, I am still working on a better workaround for this issue. Good luck with the HTMl email, Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Most of my products are from vendors who will drop ship for me.

 

If a customer orders products from one of my vendors, no problem.

 

But, if customer orders products from multiple vendors of mine, could this contrib be used to email each drop shipping vendor only the products I have associated with them, along with the customer's shipping info from the order?

 

That would be very handy.


Rik Rasmussen

Share this post


Link to post
Share on other sites
Most of my products are from vendors who will drop ship for me.

 

If a customer orders products from one of my vendors, no problem.

 

But, if customer orders products from multiple vendors of mine, could this contrib be used to email each drop shipping vendor only the products I have associated with them, along with the customer's shipping info from the order?

 

That would be very handy.

If I understand your situation correctly, yes, that is exactly what this does. For each order placed, the products assigned to Vendor A are grouped together to be emailed to Vendor A. I there are also products from Vendors B and C in the order, then Vendor B will get an email for his products only, and Vendor C will get an email for his products only. Each email is Vendor specific. Only products for that particular Vendor. Give it a try. Craig :)

Edited by blucollarguy

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Works like a charm blucollarguy :) Thx alot

 

Your seeing it this way because it was not sent as HTML. Check that your email to your cusotmers is in HTML, if not you will need to install one of the many HTML email contributions to get it working right. Glad that got it to send the email though, I am still working on a better workaround for this issue. Good luck with the HTMl email, Craig :)

Share this post


Link to post
Share on other sites
Works like a charm blucollarguy :) Thx alot

Glad it's working for you illadelph, hope you get as much use out of it as I have. Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

I've read through some of this topic - but one question - does this email the vendors in the checkout_process.php, or from a status change in the order admin?

Share this post


Link to post
Share on other sites
I've read through some of this topic - but one question - does this email the vendors in the checkout_process.php, or from a status change in the order admin?

I originally wrote this to function from the "admin/orders.php" file, most payment moules at the time called this file to update the status of the order from "pending" to "processing" or what ever equivelent to payment accepted, however many of the payment modules have gone away from calling this file to do the update and are simply updating the database directly. This means a change is needed. I have not released a new version yet to deal with this as I have not worked out all the details of as many of the newer version of payment modules. For now, if you have trouble getting the emails, you can use this "hack" from an earleir post to bypass the "orders.php" file, scroll down to Post 68 from this link. this will send the email at the time the purchase takes place. What I am trying to work out is running the status check from checkout_process or checkout_success and give us the options of what status is used to determine when the email goes out. I may actually get this particular update done today, so keep an eye out for the announcement. Good luck, and I hope you get some use out of this mod. Craig :)

Edited by blucollarguy

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Thanks. We only do software at our store, so any purchase is immediately processed and done with. We actually do not use the normal Order Status' from OSCommerce, but instead use "Paid", "Voided", "Refunded", and "Chargeback". So for us - the order is not even put into the system unless its paid and processed. I'll try to follow that post and see what I can figure out.

Share this post


Link to post
Share on other sites
Thanks. We only do software at our store, so any purchase is immediately processed and done with. We actually do not use the normal Order Status' from OSCommerce, but instead use "Paid", "Voided", "Refunded", and "Chargeback". So for us - the order is not even put into the system unless its paid and processed. I'll try to follow that post and see what I can figure out.

Setting up the email function at checkout_process would be ideal for you then. From there the email goes as soon as the order is placed so you would have your email immediately upon order completion. Should work for you very nicely. Good luck, Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Hi All, This would work great for me but I'm having problems with the categories.php due to running "Advanced Category Admin". Does anyone have a workaround for this?

 

Thanks in advance, James

Share this post


Link to post
Share on other sites
Hi All, This would work great for me but I'm having problems with the categories.php due to running "Advanced Category Admin". Does anyone have a workaround for this?

 

Thanks in advance, James

Well James, I can probably help you out, but I am not familiar with that mod, can you piont me to it? I will do some reasearch and see what I can come up with. Just a little note as well, I will be releasing a major update to this contribution that will include Multi-Vendor Shipping functionality, as well as a few other Vendor related mods, VERY soon. You may want to look into what I've been working on:

Multi-Vendor Shipping

And see if you think it will help you as well, Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Thanks Craig for the fast reply, the mod is here ACA

 

And Yes I've been looking into Multi-Vendor Shipping as well but would have the same problem using ACA as well. I'm no php programmer and have a hard time when it comes to the categories.php after a few mod's have been installed.

 

Thanks Again, James

Share this post


Link to post
Share on other sites

Hello Craig,

 

Nice job on the mod, its working as well as it can using paypal. Quick question and I'm sure this is an easier one than what I have read in this entire thread :)

 

Q1: I would like to add the "Customers" First Name, Last Name and Email Address to VAE sent out.

 

We are selling software, and the information in the email will be parsed by the software company and entered into their database. So when the customer follows the instructions in the email, all the info will be present and they can obtain the KEY to unlock and install.

 

Q2: Is there a mod out there that will allow me to send per product instructions?

 

 

Best Regards,

Robert

Share this post


Link to post
Share on other sites

Hello,

 

I figured out my own question, here it is below for others info.

 

FIND:

  $delivery_address_list = tep_db_fetch_array($delivery_address_query);

 

AFTER ADD:

//Get Customer Details for this order
 $customers_info_query = tep_db_query("select distinct customers_name, customers_email_address from orders where orders_id='" . $oID ."'");
 $customers_info = tep_db_fetch_array($customers_info_query);

 

FIND:

// Get all the products to be included in the email
   $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id,  p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' order by o.products_name");

 

REPLACE WITH:

//Get all the products to be included in the email
 $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id,  p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id, c.customers_name, c.customers_email_address FROM vendors v, orders_products o, products p, orders c where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' and c.customers_name='" . $customers_info['customers_name'] . "' and c.customers_email_address='" . $customers_info['customers_email_address'] . "' order by o.products_name");

 

 

The above is based on the most resent release near the date of this post.

Share this post


Link to post
Share on other sites
Hello,

 

I figured out my own question, here it is below for others info.

 

FIND:

  $delivery_address_list = tep_db_fetch_array($delivery_address_query);

 

AFTER ADD:

//Get Customer Details for this order
 $customers_info_query = tep_db_query("select distinct customers_name, customers_email_address from orders where orders_id='" . $oID ."'");
 $customers_info = tep_db_fetch_array($customers_info_query);

 

FIND:

// Get all the products to be included in the email
   $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id,  p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' order by o.products_name");

 

REPLACE WITH:

//Get all the products to be included in the email
 $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id,  p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id, c.customers_name, c.customers_email_address FROM vendors v, orders_products o, products p, orders c where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' and c.customers_name='" . $customers_info['customers_name'] . "' and c.customers_email_address='" . $customers_info['customers_email_address'] . "' order by o.products_name");

The above is based on the most resent release near the date of this post.

Sorry for not getting back to you Robert, been very wrapped up with many different things. Glad you were able to find the spots to do the edits. Nice work, and keep up the efforts, Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites
Q2: Is there a mod out there that will allow me to send per product instructions?

Best Regards,

Robert

This would probably be best done with something of the "Vendor Instructions" included in VAE, except send it to the customer instead of the Vendor. I'm not sure if there is anything else (another mod) that already does this, but it wuold not be a hard mod. In categories.php, you can see this being used for the vendor emails, one could easily adapt this field to send to the customer instead. Good luck and let me know how things go, or if I can help with anything else, and again, sorry I did not get back to you before, I'm usually better about supporting my mods, just been very busy.

 

Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Hi Craig,

 

No Problem on the reply delay! I totally understand how it is to be busy, believe me. Thanks for the tips in the right direction, after many hours of Trial and Error I finally have it all worked out the way I need for sending customers and vendors emails at the same time.

 

In /admin/orders.php I created another Function that duplicated this one

//vendors email begin
 function vendors_email($oID)

 

New function is named

//vendors email begin
 function customers_email($oID)

 

Then I poked around in the categories.php page and duplicated the Vendors Info Text box, and added a new field to the database.

 

So now when somone orders a download and the "status" is updated, it will send them "notes" or "instructions" on how to activate the software with the vendor, or the time to wait for the vendor to send the KEY to them. Its worked out quite nicely with your mod. Great Job!

 

Q: I now only have one problem with PayPal, and I've read posts about this just a few steps back. When PayPal returns the order, the status is updated to "2" but the emails won't go out. Is there a work around for this without having to manually go in and change the status from 2 to 1 and back to 2 again?

 

I appreciate the response! Thanks.

Share this post


Link to post
Share on other sites
Hi Craig,

 

No Problem on the reply delay! I totally understand how it is to be busy, believe me. Thanks for the tips in the right direction, after many hours of Trial and Error I finally have it all worked out the way I need for sending customers and vendors emails at the same time.

 

In /admin/orders.php I created another Function that duplicated this one

//vendors email begin
 function vendors_email($oID)

 

New function is named

//vendors email begin
 function customers_email($oID)

 

Then I poked around in the categories.php page and duplicated the Vendors Info Text box, and added a new field to the database.

 

So now when somone orders a download and the "status" is updated, it will send them "notes" or "instructions" on how to activate the software with the vendor, or the time to wait for the vendor to send the KEY to them. Its worked out quite nicely with your mod. Great Job!

 

Q: I now only have one problem with PayPal, and I've read posts about this just a few steps back. When PayPal returns the order, the status is updated to "2" but the emails won't go out. Is there a work around for this without having to manually go in and change the status from 2 to 1 and back to 2 again?

 

I appreciate the response! Thanks.

 

At this point, the only final workaround is This POST, I will be updating this to better handle the many changes from the PayPal module and others, soon. I am working on MultiVendor Shipping, VAEmail has been integrated into that, and they will become one contribution. I hope to have one last update for VAEmail as a standalone mod within a week or 2 to deal with this problem, after that, all support will go through MVS. The draw back to this workaround is in the case of customers not completing the order once leaving the store and going to PayPal. This is what I need to fix yet. Glad you got things working, good luck, Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Hello,

 

I have a vendor that wants me to make a simple HTTP post to their site about the order details. I'm not very good with PHP, and this does seem simple since all the info that needs to be posted is in the //Vendors Email block.

 

Since this is only for a single vendor, would it be some type of ELSE statement IF vendor ID = X ? Below is the example of the post I would be trying to make for 2 different products from the same vendor.

 

http://www.somewhere.com/cgi-bin/store.cgi?order_number=001;product_codes=MODELNUMBER01,MODELNUMBER02;p_name=CUSTOMERNAME;p
_email=CUSTOMEREMAIL

 

Here is the code that I currently have in ORDERS.PHP. Craig any help you can provide is greatly apprieciatated. Once this is all setup and working like a charm, I won't forget about that donate button on your site ;)

 

//vendors email begin

   function vendors_email($oID)
  {
//Get the delivery address
 $delivery_address_query = tep_db_query("select distinct delivery_company, delivery_name, delivery_street_address, delivery_city, delivery_state, delivery_postcode from orders where orders_id='" . $oID ."'");
 $delivery_address_list = tep_db_fetch_array($delivery_address_query);

//Get Customer Details for this order
 $customers_info_query = tep_db_query("select distinct customers_name, customers_email_address from orders where orders_id='" . $oID ."'");
 $customers_info = tep_db_fetch_array($customers_info_query);

//find out what shipping methods the customer chose
 $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $oID . "' and class = 'ot_shipping'");
 $shipping_method = tep_db_fetch_array($shipping_method_query);

//vendors email query
 $vendors_email_query = tep_db_query("select distinct o.orders_id, v.vendors_id, v.vendors_name, v.vendors_email, v.vendors_contact, v.vendor_add_info, v.vendor_street, v.vendor_city, v.vendor_state, v.vendors_zipcode, v.vendor_country, v.account_number, o.products_id, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and o.products_id=p.products_id and o.orders_id='" . $oID . "' and v.vendors_send_email=1 GROUP BY vendors_id");
   while ($vendors_email_list= tep_db_fetch_array($vendors_email_query))
 {
   $order_number='" . $oID . "';
   $the_email=$vendors_email_list['vendors_email'];
   $the_name=$vendors_email_list['vendors_name'];
   $the_contact=$vendors_email_list['vendors_contact'];
   $email=  'To: ' . $the_contact . "\n" .
   $the_name . "\n" . 
   $the_email . "\n" . 
   $vendors_email_list['vendor_street'] . "\n" .
   $vendors_email_list['vendor_city'] .' ' .
   $vendors_email_list['vendor_state'] .' ' .
   $vendors_email_list['vendors_zipcode'] . "\n" . 
   $vendors_email_list['vendor_country'] . "\n" . "\n" . EMAIL_SEPARATOR . "\n" . 
   'Special Comments or Instructions:  ' . $vendors_email_list['vendor_add_info'] . "\n" . EMAIL_SEPARATOR . "\n" . "\n" . 
   'From: ' . STORE_OWNER . "\n" . 
   STORE_NAME_ADDRESS . "\n" . 
   'Account #: ' . $vendors_email_list['account_number'] . "\n" . "\n" . EMAIL_SEPARATOR . "\n" .  EMAIL_TEXT_ORDER_NUMBER . 
   'FSADDONS00' . $oID . "\n" .  EMAIL_SEPARATOR . "\n" . "\n" . 
   'Shipping Method (If Applicable):  ' .  $shipping_method['title'] . "\n" . "\n" .
   'Dropship deliver to (If Applicable):  ' . "\n" .
   $delivery_address_list['delivery_company'] . "\n" .
   $delivery_address_list['delivery_name'] . "\n" .
   $delivery_address_list['delivery_street_address'] . "\n" .
   $delivery_address_list['delivery_city'] . ' ' . $delivery_address_list['delivery_state'] . ' ' . $delivery_address_list['delivery_postcode'] . "\n" . "\n";

//Get all the products to be included in the email
 $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id,  p.vendors_prod_comments, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id, c.customers_name, c.customers_email_address FROM vendors v, orders_products o, products p, orders c where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' and c.customers_name='" . $customers_info['customers_name'] . "' and c.customers_email_address='" . $customers_info['customers_email_address'] . "' order by o.products_name");

   $email = $email . "\n";
   while ($vendors_email_products= tep_db_fetch_array($vendors_email_products_query))	{
   $product_attribs ='';
   $vendors_email_products_attrib_query = tep_db_query("SELECT products_options, products_options_values FROM " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " WHERE 1 AND orders_products_id = '" . $vendors_email_products['orders_products_id'] . "'");
   while ($vendors_email_products_attribs = tep_db_fetch_array($vendors_email_products_attrib_query)) {
   $product_attribs .= $vendors_email_products_attribs['products_options'] . ': ' .  $vendors_email_products_attribs['products_options_values'] . "\n";
   }
    $email = $email . 'ITEMS ORDERED:' . "\n" . "\n" . EMAIL_SEPARATOR . "\n" . 'Order Number:  ' . 'FSADDONS00' . $oID . "\n" .
    'Qty:  ' . $vendors_email_products['products_quantity'] . "\n" .
    'Product Name:  ' . $vendors_email_products['products_name'] .  "\n" . 
    'Product Attributes:  ' . $product_attribs . "\n" .
    'Product ID:  ' . $vendors_email_products['vendors_prod_id'] . "\n" .
    'Product Model:  ' . $vendors_email_products['products_model'] . "\n" .
    'Payout Due:  $' . $vendors_email_products['vendors_product_price'] . "\n" .
    'Customers Name:  ' . $vendors_email_products['customers_name'] . "\n" . 
    'Customers Email:  ' . $vendors_email_products['customers_email_address'] . "\n" . "\n" .
    'Product Comments:  ' . $vendors_email_products['vendors_prod_comments'] . "\n" . EMAIL_SEPARATOR . "\n";
}
  $email = $email . '';
tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID ,  $email .  '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);

 }
return true;
}
//vendors_email end, but there is more to do, keep looking



//customer_email begin
 function customers_email($oID)
{
//Get the delivery address
 $delivery_address_query = tep_db_query("select distinct delivery_company, delivery_name, delivery_street_address, delivery_city, delivery_state, delivery_postcode from orders where orders_id='" . $oID ."'");
 $delivery_address_list = tep_db_fetch_array($delivery_address_query);

//Get Customer Details for this order
 $customers_info_query = tep_db_query("select distinct customers_name, customers_email_address from orders where orders_id='" . $oID ."'");
 $customers_info = tep_db_fetch_array($customers_info_query);

//find out what shipping methods the customer chose
 $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id='" . $oID . "' and class = 'ot_shipping'");
 $shipping_method = tep_db_fetch_array($shipping_method_query);

//vendors email query
 $vendors_email_query = tep_db_query("select distinct o.orders_id, v.vendors_id, v.vendors_name, v.vendors_email, v.vendors_contact, v.vendor_add_info, v.vendor_street, v.vendor_city, v.vendor_state, v.vendors_zipcode, v.vendor_country, v.account_number, o.products_id, o.orders_products_id FROM vendors v, orders_products o, products p where p.vendors_id=v.vendors_id and o.products_id=p.products_id and o.orders_id='" . $oID . "' and v.vendors_send_email=1 GROUP BY vendors_id");
   while ($vendors_email_list= tep_db_fetch_array($vendors_email_query))
 {
   $order_number='" . $oID . "';
   $the_email=$customers_info['customers_email_address'];
   $the_name=$customers_info['customers_name'];
   $email=  'Hello ' . $the_name . '!' . "\n" . "\n" .
"Thank you for ordering from FSAddOns.com! Below you will find important information about your purchase, please read carefully and if you have any questions don't hesitate to email us by replying to this message." . "\n" . "\n" .
"If you have ordered a Downloadable Product, Instructions for registering that product with the Author are below. Not all products purchased require a registration key to be activated or installed. If your product does not, this info will also be noted below." . "\n" . "\n" .
"If you have ordered a Product which requires shipping, we ship within 24 hours Monday thru Friday, and will provide tracking number information after your product has been shipped by the chosen method during purchase." . "\n" . "\n" .
"Thank You for Visiting http://www.fsaddons.com!" . "\n" . "\n" .
"-FSAddOns Staff" ."\n" .  "\n" .
"\n" . EMAIL_SEPARATOR . "\n" .  EMAIL_TEXT_ORDER_NUMBER . ' ' . 'FSADDONS00' . 
$oID . "\n" .  EMAIL_SEPARATOR . "\n" . "\n" . 'Shipping Method (If Applicable):' . "\n" .  
$shipping_method['title'] . "\n" . "\n" . 'Deliver To (If Applicable):' .
   $delivery_address_list['delivery_company'] . "\n" .
   $delivery_address_list['delivery_name'] . "\n" .
   $delivery_address_list['delivery_street_address'] . "\n" .
   $delivery_address_list['delivery_city'] . ' ' . 
$delivery_address_list['delivery_state'] . ' ' . 
$delivery_address_list['delivery_postcode'] . "\n" . "\n";

//Get all the products to be included in the email
 $vendors_email_products_query = tep_db_query("select distinct o.orders_id, v.vendors_id, p.vendors_prod_customer, o.products_name, p.vendors_prod_id, o.products_model, o.products_id, o.products_quantity, p.vendors_product_price, o.orders_products_id, c.customers_name, c.customers_email_address FROM vendors v, orders_products o, products p, orders c where p.vendors_id=v.vendors_id and v.vendors_id='" . $vendors_email_list['vendors_id'] . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' and c.customers_name='" . $customers_info['customers_name'] . "' and c.customers_email_address='" . $customers_info['customers_email_address'] . "' order by o.products_name");

   while ($vendors_email_products= tep_db_fetch_array($vendors_email_products_query))
 {
   $email = $email . "\n" . 
   EMAIL_SEPARATOR . "\n" . "\n" .
'Quantity: ' . $vendors_email_products['products_quantity'] . "\n" . "\n" .
'Product: ' . $vendors_email_products['products_name'] . "\n" . "\n" .
'Registration Instructions (If Applicable): ' . $vendors_email_products['vendors_prod_customer'] . "\n" . "\n" .
"\n" . EMAIL_SEPARATOR . "\n";

   $vendors_email_products_attributes_query = tep_db_query("select distinct p.vendors_id, opa.products_options_values from orders_products_attributes opa, orders o, products p where opa.orders_id='" .  $oID . "' and opa.orders_products_id='" . $current_products_id . "' and p.vendors_id='" . $vendors_email_products['vendors_id']. "' GROUP BY vendors_id");
   while ($vendors_email_products_attributes= tep_db_fetch_array($vendors_email_products_attributes_query)) {
   $email_message = $email_message . ' ' . $vendors_email_products_attributes['products_options_values'] .' ';
 }

   }
   $email = $email . '';

//send the email
tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID ,  $email .  ' ', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);

 }
return true;
}
//customer_email end

Edited by CageHound

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×