Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Vendor_Auto_E-mail (In_Development)


blucollarguy

Recommended Posts

Oh one other problem I'm having: I added the first vendor just fine. All the rest throw this error (even if I fill in all the fields with real values instead of "fdasf" or blanks!):

1062 - Duplicate entry '0-1' for key 1

insert into vendors_info (vendors_url, vendors_id, languages_id) values ('fdasf', '', '1')

[TEP STOP]

 

The vendor information seems to get added to the database just fine, though.

 

Any idea what could be causing this?

Go to line 67 of the original vendors.php file (or near there, if you have modified it) and find the following line:

          $insert_sql_data = array('vendors_id' => $vendors_id,
                                  'languages_id' => $language_id);

 

Replace $vendors_id with $vID so it looks like this:

          $insert_sql_data = array('vendors_id' => $vID,
                                  'languages_id' => $language_id);

Link to comment
Share on other sites

  • Replies 129
  • Created
  • Last Reply

Top Posters In This Topic

The updated release of VA_Email has been uploaded and is ready for download. v1.3 has many bug fixes, and a few usability mods. Still no fix for the attributes issue. Let me know what you think.

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: [email protected]

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!

Link to comment
Share on other sites

  • 3 weeks later...
Hi Craig -

 

Where are you with the "attributes" part of this project? I may have some time available soon to assist if necessary.

 

Thanks,

 

- James

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

The Arts Coop - Art for Everyone!

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

Hey James, I have worked on on it a bit. I keep getting sidetracked. If you get the time and would like to help, let me know. Send me an email through a PM and I will see if I can get some stuff together to show you exactly where to work with the code if you are not sure about it. I, along with everyone else, would greatly appreciate anything you can offer. Thanks, 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: [email protected]

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!

Link to comment
Share on other sites

Hi,

First of all, thanks for the work on this contribution. I've been looking for something like this that I am adapting to my own needs. I've got it installed, and testing. Placed an order and the email to vendor does not get sent. I added a vendor with my own email address during testing.

 

I am not sure how to fix. Thanks!

 

Steve

Link to comment
Share on other sites

:thumbsup: This topic can be found in it's entirety: http://www.oscommerce.com/forums/index.php?sho...=0entry469895

But to summarize, James found a fix fot the issue of sending an email for each product in the list, or instance, 3 prods from Vendor A in the order, Vendor gets 3 emails, all are the same, with all the correct information, but 3 are sent. Well here is the fix, replace "OREDER BY" with "GROUP BY" in the vendor query in the catalog/admin/orders.php file on or about line 27, it should look just like this when you are done:

$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");

 

You can simply replace the entire query, or of course just replace "'ORDER BY" with "GROUP BY" as I did in the edited query above. And then, everyone thank James for his efforts on this. I will need to recruit James for several other mods I am working on that we are all in need of. Thanks again James, great job. :thumbsup: thumbsup.gif

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: [email protected]

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!

Link to comment
Share on other sites

Hi,

First of all, thanks for the work on this contribution. I've been looking for something like this that I am adapting to my own needs.  I've got it installed, and testing.  Placed an order and the email to vendor does not get sent.  I added a vendor with my own email address during testing. 

 

I am not sure how to fix.  Thanks!

 

Steve

Steve, your welcome. And it's hard to say what exactly could be wrong. Double check the install. All of the email portion of this mod get's done in the catalog/admin/orders.php file. Assuming you set "send vendor emails" to "1", and there is an email address for that Vendor, and the product is attached to the Vendor(throuigh the add/edit product screen), and the order is being updated to the default order status, "processing". which is order_status_id #2 in the database. The orders.php file is the only spot where there can be a problem. There is a lot of code to be placed at the top of the file, and then there is a couple of lines to be added at around line 100(Status Check), double check that all is there. Good luck, 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: [email protected]

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!

Link to comment
Share on other sites

Hi,

First of all, thanks for the work on this contribution. I've been looking for something like this that I am adapting to my own needs.  I've got it installed, and testing.  Placed an order and the email to vendor does not get sent.  I added a vendor with my own email address during testing. 

 

I am not sure how to fix.  Thanks!

 

Steve

If you keep having problems Steve, download the updated files from the Contributions section, I have just uploaded another update. I found a few small things while looking at some other sruff that may be messing with you.

 

Also, anyone who has been dissappointed that you could not use easypopulate to update your prods, I have uploaded a modified version for Vendor Email support. Check it out. 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: [email protected]

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!

Link to comment
Share on other sites

If you keep having problems Steve, download the updated files from the Contributions section, I have just uploaded another update. I found a few small things while looking at some other sruff that may be messing with you.

 

Craig,

I'm still having problems when i update the order status to 2, it does not send the email. here is my admin/orders.php file...maybe you can have a look to see if i'm missing something. Note, I don't use customers_apt so i removed that. I don't get any errors, just no email being sent.

 

A bug i found is when updating an existing vendor, changing the email status from 1 to 0 or 0 to 1, and clicking update...adds a duplicate vendor to the table.

 

I appreciate any advice. Looking forward to making this work.

 

Steve

 

<?php
/*
 $Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $

 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 customers_company, customers_name, customers_street_address, customers_city, customers_state, customers_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"); //dgm changed to GROUP BY for vendor email

 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['customers_company'] .'<br>' .
   $delivery_address_list['customers_name'] .'<br>' .
   $delivery_address_list['customers_street_address'] . '<br>' .
   $delivery_address_list['customers_city'] .'<br>' .
   $delivery_address_list['customers_state'] . ' ' . $delivery_address_list['customers_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; ?>">
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 





 <title><?php echo TITLE ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=650,height=500,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
<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'); ?>

Link to comment
Share on other sites

Craig,

I'm still having problems when i update the order status to 2, it does not send the email.  here is my admin/orders.php file...maybe you can have a look to see if i'm missing something.  Note, I don't use customers_apt so i removed that.  I don't get any errors, just no email being sent. 

 

A bug i found is when updating an existing vendor, changing the email status from 1 to 0 or 0 to 1, and clicking update...adds a duplicate vendor to the table.   

 

I appreciate any advice.  Looking forward to making this work. 

 

Steve

Ok Steve I will take a look and see what's up. You got one of the files with the "apt" in it so you may have some more of my dev stuff. I will look into it. Craig :)

PS Anyone else having this problem?

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: [email protected]

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!

Link to comment
Share on other sites

Hi,

Terrific contribution!

 

Stylistically, which file do I modify to change the look and layout of the email that gets sent to vendor? Is it supposed to have all the info about the order (where the recipient's address is typed) running together on one line or each piece of info on it's own separate, line? As it is now, there's no space even between the info fields... Is that from my web-based email program not showing it as it is for everyone else? I've not seen any inquiries about it, hence my wondering...

 

Thank you!

Link to comment
Share on other sites

Hi,

Terrific contribution! 

 

Stylistically, which file do I modify to change the look and layout of the email that gets sent to vendor?  Is it supposed to have all the info about the order (where the recipient's address is typed) running together on one line or each piece of info on it's own separate, line?  As it is now, there's no space even between the info fields...  Is that from my web-based email program not showing it as it is for everyone else?  I've not seen any inquiries about it, hence my wondering...

 

Thank you!

This is from your email not going out as html. Set up html email and it will be formatted properly. If you want to change the layout after you see how it looks in html, all formatting is done in the script that was added to the orders.php file. I have not setup an easy way of changing this, so it is all done with code. Take a look and see, 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: [email protected]

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!

Link to comment
Share on other sites

  • 4 weeks later...

Hey there. I just finished getting this contrib all set up. BUT.... I am getting this error:

 

Parse error: parse error, unexpected $ in /admin/includes/functions/general.php on line 1338

 

Here is the code:

 

// make sure no duplicate category IDs exist which could lock the server in a loop
   $tmp_array = array();
   $n = sizeof($cPath_array);
   for ($i=0; $i<$n; $i++) {
     if (!in_array($cPath_array[$i], $tmp_array)) {
       $tmp_array[] = $cPath_array[$i];
     }
   }

   return $tmp_array;
 }
?>

 

 

PLEASE HELP... I have looked for hours trying to find a thread that might already cover this....

 

Thx.

Link to comment
Share on other sites

Hey there. I just finished getting this contrib all set up. BUT.... I am getting this error:

 

Parse error: parse error, unexpected $ in /admin/includes/functions/general.php on line 1338

 

Here is the code:

 

// make sure no duplicate category IDs exist which could lock the server in a loop
   $tmp_array = array();
   $n = sizeof($cPath_array);
   for ($i=0; $i<$n; $i++) {
     if (!in_array($cPath_array[$i], $tmp_array)) {
       $tmp_array[] = $cPath_array[$i];
     }
   }

   return $tmp_array;
 }
?>

PLEASE HELP... I have looked for hours trying to find a thread that might already cover this....

 

Thx.

 

The only real possibility here is that you missed a closing bracket. " } " This often happens during copy and paste. Double check the 3 blocks of code that are added to the functions/general.php file. Be sure the there is a close bracket at the end of the 2 new functions that are added and at the end of the new copy email function if you installed it. That is most likely the problem. If you cannot find it, email me your general.php file and I can try to find it when I have the time, no guarrantees when I can do it, but I will help you. 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: [email protected]

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!

Link to comment
Share on other sites

HEY! It's working! Thx for the quick reply, that is exactly what it was. However, the instruction file that came with the contribution was missing a }. Somehow? I may have resaved it or something, but might want to check that out on the newest revisions install document. I think the code is missing that } on the install instructions.

***next is the copy email function, it uses the "SEND_EXTRA_ORDER_EMAILS_TO" area in the main configuration page in the admin. This will GLOBALLY send a copy of EVERY EMAIL that is sent from the store, so if you are using some type of mass mailing from your store, you might want to remove anything in this field BEFORE sending such mailings as you will receive a copy of each individual email sent, or don't make this change, still in admin/includes/functions/general.php make the following changes:
*** find the following code:

  $message->build_message();
   $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
   and add the following:
   //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

Link to comment
Share on other sites

HEY! It's working! Thx for the quick reply, that is exactly what it was. However, the instruction file that came with the contribution was missing a }. Somehow? I may have resaved it or something, but might want to check that out on the newest revisions install document. I think the code is missing that } on the install instructions.

***next is the copy email function, it uses the "SEND_EXTRA_ORDER_EMAILS_TO" area in the main configuration page in the admin. This will GLOBALLY send a copy of EVERY EMAIL that is sent from the store, so if you are using some type of mass mailing from your store, you might want to remove anything in this field BEFORE sending such mailings as you will receive a copy of each individual email sent, or don't make this change, still in admin/includes/functions/general.php make the following changes:
*** find the following code:

  $message->build_message();
   $message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);
   and add the following:
   //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

Glad you got it.

It does seem to be missing, I will take care of that for the next update.

Happy Thanksgiving all, 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: [email protected]

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!

Link to comment
Share on other sites

  • 3 weeks later...

Just a quick add-on to this great mod: my client wanted the vendor emails to be sent at *checkout* time, not when they were processed in admin... I've hacked together this code which seems to do the trick, after installing via the instructions add the code below to checkout_process.php after the "send emails to other people" block.

 

This also fixes the attributes query as they were not coming through correctly in on my system. Remember to backup, etc ;)

 

//vendors email begin
// 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 " . TABLE_ORDERS . " where orders_id='" . $insert_id ."'");
 $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='" . $insert_id . "' 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 " . TABLE_VENDORS . " v, " . TABLE_ORDERS_PRODUCTS . " o, " . TABLE_PRODUCTS . " p where p.vendors_id=v.vendors_id and o.products_id=p.products_id and o.orders_id='" . $insert_id . "' and v.vendors_send_email=1 GROUP BY vendors_id");
 while ($vendors_email_list= tep_db_fetch_array($vendors_email_query))  {
   $order_number='" . $insert_id . "';
   $the_email=$vendors_email_list['vendors_email'];
   $the_name=$vendors_email_list['vendors_name'];
   $the_contact=$vendors_email_list['vendors_contact'];
   $email=  $the_contact . '  <br>' . $the_name . '<br>' . $the_email . '<br>' .
   $vendors_email_list['vendor_street'] .'<br>' .
   $vendors_email_list['vendor_city'] .', ' .
   $vendors_email_list['vendor_state'] .' ' .
   $vendors_email_list['vendors_zipcode'] . ' ' . $vendors_email_list['vendor_country'] . '<br>' . "\n" . EMAIL_SEPARATOR . "\n" . 'Special Comments or Instructions:  ' . $vendors_email_list['vendor_add_info'] .'' . "\n" . EMAIL_SEPARATOR . "\n" . 'From: ' . STORE_OWNER . "\n" . STORE_NAME_ADDRESS . "\n" . 'Accnt #: ' . $vendors_email_list['account_number'] . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .  EMAIL_SEPARATOR . "\n" . '<br>';

// Get all the products to be included in the email
   $vendors_email_products_query = tep_db_query("select distinct o.orders_id, o.orders_products_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 " . TABLE_VENDORS . " v, " . TABLE_ORDERS_PRODUCTS . " o, " . TABLE_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='" . $insert_id . "' order by o.products_name");
   $email = $email . '<table width="75%" border=1 cellspacing="0" cellpadding="3">
   <tr><td>Qty:</td><td>Product Name:</td><td>Item Code/Number:</td><td>Product Model:</td><td>Per Unit Price:</td><td>Item Comments: </td></tr>';
   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'] . '<br>';
     }
     $email = $email . '<tr><td> ' . $vendors_email_products['products_quantity'] .
     '</td><td> ' . $vendors_email_products['products_name'] . '<br>' . $product_attribs .
     '</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>';
   }
   $email = $email . '</table><br>';
//send the email
   tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id ,  $email .  '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS) ;
  }
//vendors_email end

 

You also need to add

 

define('TABLE_VENDORS', 'vendors');

 

to catalog/includes/database_tables.php

 

Many thanks to blucollarguy for this great mod :D

Link to comment
Share on other sites

Just a quick add-on to this great mod: my client wanted the vendor emails to be sent at *checkout* time, not when they were processed in admin... I've hacked together this code which seems to do the trick, after installing via the instructions add the code below to checkout_process.php after the "send emails to other people" block.

 

This also fixes the attributes query as they were not coming through correctly in on my system. Remember to backup, etc ;)

 

//vendors email begin
// 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 " . TABLE_ORDERS . " where orders_id='" . $insert_id ."'");
 $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='" . $insert_id . "' 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 " . TABLE_VENDORS . " v, " . TABLE_ORDERS_PRODUCTS . " o, " . TABLE_PRODUCTS . " p where p.vendors_id=v.vendors_id and o.products_id=p.products_id and o.orders_id='" . $insert_id . "' and v.vendors_send_email=1 GROUP BY vendors_id");
 while ($vendors_email_list= tep_db_fetch_array($vendors_email_query))  {
   $order_number='" . $insert_id . "';
   $the_email=$vendors_email_list['vendors_email'];
   $the_name=$vendors_email_list['vendors_name'];
   $the_contact=$vendors_email_list['vendors_contact'];
   $email=  $the_contact . '  <br>' . $the_name . '<br>' . $the_email . '<br>' .
   $vendors_email_list['vendor_street'] .'<br>' .
   $vendors_email_list['vendor_city'] .', ' .
   $vendors_email_list['vendor_state'] .' ' .
   $vendors_email_list['vendors_zipcode'] . ' ' . $vendors_email_list['vendor_country'] . '<br>' . "\n" . EMAIL_SEPARATOR . "\n" . 'Special Comments or Instructions:  ' . $vendors_email_list['vendor_add_info'] .'' . "\n" . EMAIL_SEPARATOR . "\n" . 'From: ' . STORE_OWNER . "\n" . STORE_NAME_ADDRESS . "\n" . 'Accnt #: ' . $vendors_email_list['account_number'] . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .  EMAIL_SEPARATOR . "\n" . '<br>';

// Get all the products to be included in the email
   $vendors_email_products_query = tep_db_query("select distinct o.orders_id, o.orders_products_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 " . TABLE_VENDORS . " v, " . TABLE_ORDERS_PRODUCTS . " o, " . TABLE_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='" . $insert_id . "' order by o.products_name");
   $email = $email . '<table width="75%" border=1 cellspacing="0" cellpadding="3">
   <tr><td>Qty:</td><td>Product Name:</td><td>Item Code/Number:</td><td>Product Model:</td><td>Per Unit Price:</td><td>Item Comments: </td></tr>';
   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'] . '<br>';
     }
     $email = $email . '<tr><td> ' . $vendors_email_products['products_quantity'] .
     '</td><td> ' . $vendors_email_products['products_name'] . '<br>' . $product_attribs .
     '</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>';
   }
   $email = $email . '</table><br>';
//send the email
   tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id ,  $email .  '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
  }
//vendors_email end

 

You also need to add

 

define('TABLE_VENDORS', 'vendors');

 

to catalog/includes/database_tables.php

 

Many thanks to blucollarguy for this great mod :D

 

Thanks for sharing your hack with us "Rich", glad you got it working the way you need. A note about when the email is sent. You could have changed this by changing the status check. It is currently "2" which is "processing" for the default osC setup, if you changed it to "1" it would send the email as soon as the customer clicked past the "confirmation" page. This emails the Vendor BEFORE payment confirmation. However, I'm glad you did not do it that way Rich, your hack may have fixed the "attribute" problem for everyone. I will see what I can do with your code to integrate and improve what I've got. The next release will include a "status" dropdown to select which status to send the email. I have been busy working on the "shipping" addon for Vendors so I will try to get out a cleaned up release within the next several days. I also want to clean up the "Vendors" page, it is beginning to get rather bloated while I integrate the shipping info as well. Thanks again Rich, I will inclulde your mod and credit with the next release, 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: [email protected]

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!

Link to comment
Share on other sites

  • 4 weeks later...

Hey guys nice contribution am having the same problem gone back and forth trying to look at my order.php file but am still not able to get the vendor emails when someone purchases an item , i installed the contribution and assigned a new testing vendor with my own email address made a test purchase but no receipt of the vendor email any help please

 

 

Ok Steve I will take a look and see what's up. You got one of the files with the "apt" in it so you may have some more of my dev stuff. I will look into it. Craig :)

PS Anyone else having this problem?

Edited by illadelph
Link to comment
Share on other sites

Hey guys nice contribution am having the same problem gone back and forth trying to look at my order.php file but am still not able to get the vendor emails when someone purchases an item , i installed the contribution and assigned a new testing vendor with my own email address made a test purchase but no receipt of the vendor email any help please

 

Ok Steve I will take a look and see what's up. You got one of the files with the "apt" in it so you may have some more of my dev stuff. I will look into it. Craig :)

PS Anyone else having this problem?

Link to comment
Share on other sites

Hey guys nice contribution am having the same problem gone back and forth trying to look at my order.php file but am still not able to get the vendor emails when someone purchases an item , i installed the contribution and assigned a new testing vendor with my own email address made a test purchase but no receipt of the vendor email any help please

I think I know what the problem is. I will try to get an updated package uploaded to the contrib section tonight. My apologees to everyone here, especially Steve. I have been very busy working on many other things including another Vendor feature, true Multi-Vendor Shipping. I will make myself take some time tonight and get an update for the Vendors Auto Email. I will get back later, 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: [email protected]

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!

Link to comment
Share on other sites

New Update has been uploaded.

:thumbsup: Hopefully this will fix most of the problems that have shown up recently.:thumbsup:

This is what I had referred to earlier, I am just updating some bugs that have been brought up here in the forums. Full package. Thanks to the many people who have come forward with issues, fixes, and cool hacks. This is not a major update, the attribute issue is still an issue(not fixed yet), so if you have been having any problems getting this working, be sure to use this package. I test installed this package on a stock osCommerce MS2 2.2., and had no errors.

 

Good luck and I will be in touch soon with more, 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: [email protected]

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!

Link to comment
Share on other sites

Thanks for the update but for some reason it is still not working on mine please advise if i can send you some copies of my files for you to take a look at and possibly alert me of anything i may have left out

 

Thanks

 

New Update has been uploaded.

:thumbsup: Hopefully this will fix most of the problems that have shown up recently.:thumbsup:

This is what I had referred to earlier, I am just updating some bugs that have been brought up here in the forums. Full package. Thanks to the many people who have come forward with issues, fixes, and cool hacks. This is not a major update, the attribute issue is still an issue(not fixed yet), so if you have been having any problems getting this working, be sure to use this package. I test installed this package on a stock osCommerce MS2 2.2., and had no errors.

 

Good luck and I will be in touch soon with more, Craig :)

Link to comment
Share on other sites

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

 

New Update has been uploaded.

:thumbsup: Hopefully this will fix most of the problems that have shown up recently.:thumbsup:

This is what I had referred to earlier, I am just updating some bugs that have been brought up here in the forums. Full package. Thanks to the many people who have come forward with issues, fixes, and cool hacks. This is not a major update, the attribute issue is still an issue(not fixed yet), so if you have been having any problems getting this working, be sure to use this package. I test installed this package on a stock osCommerce MS2 2.2., and had no errors.

 

Good luck and I will be in touch soon with more, Craig :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...