Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

Dear Forum

 

I have tested MVS on my oscommerce 2.3 and ran into a problem: If I buy only a virtual product (weight = 0) I have to pay the shipping costs.

 

Is there already a solution which works also with mixed products?

 

It would be great if someone could give me a hint!

 

luke

Share this post


Link to post
Share on other sites

Hi,

this is the new code of Admin/vendor_email_send.php

now I can send email to vendor, tested in Xampp not in live store.

<?php
/*
 $Id: vendor_email_send.php,v 1.0 2005/05/12 22:50:52 hpdl Exp $
 for use with Vendors_Auto_Email and MVS by Craig Garrison Sr.(craig@blucollarsales.com) and Jim Keebaugh
 $Loc: /catalog/admin/ $
 $Mod: MVS V1.2 2009/02/28 JCK/CWG $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2006 osCommerce
 Released under the GNU General Public License
*/
 require ('includes/application_top.php');
 //MVS inzio passaggio dati
   if (isset ($_GET['vID']) && $_GET['vID'] != '') { 
 $vID = (int) $_GET['vID'];
 }
   if (isset ($_GET['oID']) && $_GET['oID'] != '') { 
 $oID = (int) $_GET['oID'];
 }

   if (isset ($_GET['vOS']) && $_GET['vOS'] != '') { 
 $vOS = (int) $_GET['vOS'];
 }
   //MVS fine passaggio dati


 $debug = 'no';
 $debug_preview = 'no';
 $debug_arrive = 'no';
 $debug_sent = 'no';
 $vendors_id = $vID;
 $oID = $oID;
 $vendor_order_sent = $vOS;


 if ($debug == 'yes') {
   echo 'The vendor post data: ' . $vendors_id . ' ' . $oID . ' ' . $vendor_order_sent . '<br>';
 }
 $error = false;

   if (isset ($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send_vendor_email')) {
$action = ("send_vendor_email");  //aggiunto
   //  $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
   $email = stripslashes($HTTP_POST_VARS['email']);
   $the_email = stripslashes($HTTP_POST_VARS['the_email']);
   $the_contact = stripslashes($HTTP_POST_VARS['the_contact']);
$oID = stripslashes($HTTP_POST_VARS['order_number']);
   $the_name = stripslashes($HTTP_POST_VARS['the_name']);
   $vendors_id = $HTTP_POST_VARS['vID'];


   if ($debug_sent == 'yes') {
  echo 'All the posted data is here: <br>' . (int) $vendors_id . '<br>' . $the_email . '<br>' . $the_contact . '<br>' . $oID . '<br>' . $the_name . '<br>' . $email;
  echo 'All the action: <br>' . $action;
   }
   if ($action == 'send_vendor_email') {
  if (tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID, $email . '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS) ) $vendor_order_sent = ("yes");
  $vendor_order_sent = true ;

  if ( $vendor_order_sent == true) {
    tep_db_query ("update " . TABLE_ORDERS_SHIPPING . " set vendor_order_sent = 'yes' where orders_id = '" . (int) $oID . "'");
  } else {
    tep_db_query ("update " . TABLE_ORDERS_SHIPPING . " set vendor_order_sent = 'no' where orders_id = '" . (int) $oID . "'  and vendors_id = '" . (int) $vendors_id . "'");
  }	 
  $messageStack->add('success', 'Email Sent');
  tep_redirect(tep_href_link(FILENAME_VENDORS_EMAIL_SEND, 'action=success' . '&oID=' . $oID . '&contact=' . $the_contact));
   } else {
  $error = true;
  $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
   }
 }

 require(DIR_WS_INCLUDES . 'template_top.php');
 require_once (DIR_WS_INCLUDES . 'header.php');
?>
<!-- header_eof //-->
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <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="left"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vID=' . $vendors_id) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></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">
<?php
 $index2 = 0;
 //let's get the Vendors and
 //find out what shipping methods the customer chose
//  $vendor_data_query = tep_db_query("select 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, v.vendors_status_send, os.shipping_module, os.shipping_method, os.shipping_cost, os.shipping_tax, os.vendor_order_sent from " . TABLE_VENDORS . " v,  " . TABLE_ORDERS_SHIPPING . " os where v.vendors_id=os.vendors_id and v.vendors_id='" . $vendors_id . "' and os.orders_id='" . (int) $oID . "'");
 $vendor_data_query = tep_db_query("select 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, v.vendors_status_send, os.shipping_module, os.shipping_method, os.shipping_cost, os.shipping_tax, os.vendor_order_sent from " . TABLE_VENDORS . " v,  " . TABLE_ORDERS_SHIPPING . " os where v.vendors_id=os.vendors_id and v.vendors_id='" . $vendors_id . "' and os.orders_id='" . (int) $oID . "'");
 while ($vendor_order = tep_db_fetch_array($vendor_data_query)) {
   $vendor_products[$index2] = array (
  'Vid' => $vendor_order['vendors_id'],
  'Vname' => $vendor_order['vendors_name'],
  'Vemail' => $vendor_order['vendors_email'],
  'Vcontact' => $vendor_order['vendors_contact'],
  'Vaccount' => $vendor_order['account_number'],
  'Vstreet' => $vendor_order['vendor_street'],
  'Vcity' => $vendor_order['vendor_city'],
  'Vstate' => $vendor_order['vendor_state'],
  'Vzipcode' => $vendor_order['vendors_zipcode'],
  'Vcountry' => $vendor_order['vendor_country'],
  'Vaccount' => $vendor_order['account_number'],
  'Vinstructions' => $vendor_order['vendor_add_info'],
  'Vmodule' => $vendor_order['shipping_module'],
//   'Vmodule' => $vendor_order['shipping_module'],
  'Vmethod' => $vendor_order['shipping_method']
   );

   if ($debug == 'yes') {
  echo 'The vendor query: ' . $vendor_order['vendors_id'] . '<br>';
   }
   $index = 0;
   $vendor_orders_products_query = tep_db_query("select o.orders_id, o.orders_products_id, o.products_model, o.products_id, o.products_quantity, o.products_name, p.vendors_id,  p.vendors_prod_comments, p.vendors_prod_id, p.vendors_product_price from " . TABLE_ORDERS_PRODUCTS . " o, " . TABLE_PRODUCTS . " p where p.vendors_id='" . (int) $vendors_id . "' and o.products_id=p.products_id and o.orders_id='" . $oID . "' order by o.products_name");
   while ($vendor_orders_products = tep_db_fetch_array($vendor_orders_products_query)) {
  $vendor_products[$index2]['vendor_orders_products'][$index] = array (
    'Pqty' => $vendor_orders_products['products_quantity'],
    'Pname' => $vendor_orders_products['products_name'],
    'Pmodel' => $vendor_orders_products['products_model'],
    'Pprice' => $vendor_orders_products['products_price'],
    'Pvendor_name' => $vendor_orders_products['vendors_name'],
    'Pcomments' => $vendor_orders_products['vendors_prod_comments'],
    'PVprod_id' => $vendor_orders_products['vendors_prod_id'],
    'PVprod_price' => $vendor_orders_products['vendors_product_price'],
    'spacer' => '-'
  );
  if ($debug == 'yes') {
    echo 'The products query: ' . $vendor_orders_products['products_name'] . '<br>';
  }
  $subindex = 0;
  $vendor_attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $oID . "' and orders_products_id = '" . (int) $vendor_orders_products['orders_products_id'] . "'");
  if (tep_db_num_rows($vendor_attributes_query)) {
    while ($vendor_attributes = tep_db_fetch_array($vendor_attributes_query)) {
	  $vendor_products[$index2]['vendor_orders_products'][$index]['vendor_attributes'][$subindex] = array (
	    'option' => $vendor_attributes['products_options'],
	    'value' => $vendor_attributes['products_options_values'],
	    'prefix' => $vendor_attributes['price_prefix'],
	    'price' => $vendor_attributes['options_values_price']
	  );
	  $subindex++;
    }
  }
  $index++;
   }
   $index2++;
   // let's build the email
   // 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='" . $oID . "'");
   $vendor_delivery_address_list = tep_db_fetch_array($delivery_address_query);
   if ($debug == 'yes') {
  echo 'The number of vendors: ' . sizeof($vendor_products) . '<br>';
   }
   $email = '';
   for ($l = 0, $m = sizeof($vendor_products); $l < $m; $l++) {
  $vendor_country = tep_get_country_name($vendor_products[$l]['Vcountry']);
  $order_number = $oID;
  $vendors_id = $vendors_id;
  $the_email = $vendor_products[$l]['Vemail'];
  $the_name = $vendor_products[$l]['Vname'];
  $the_contact = $vendor_products[$l]['Vcontact'];
  $email = '<b>To: ' . $the_contact . '  <br>' . $the_name . '<br>' . $the_email . '<br>' .
  $vendor_products[$l]['Vstreet'] . '<br>' .
  $vendor_products[$l]['Vcity'] . ', ' .
  $vendor_products[$l]['Vstate'] . '  ' .
  $vendor_products[$l]['Vzipcode'] . ' ' . $vendor_country . '<br>' . '<br>' . EMAIL_SEPARATOR . '<br>' . 'Special Comments or Instructions:  ' . $vendor_products[$l]['Vinstructions'] . '<br>' . '<br>' . EMAIL_SEPARATOR . '<br>' . 'From: ' . STORE_OWNER . '<br>' . STORE_NAME_ADDRESS . '<br>' . 'Accnt #: ' . $vendor_products[$l]['Vaccount'] . '<br>' . EMAIL_SEPARATOR . '<br>' . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . '<br>' . EMAIL_SEPARATOR . '<br>' . '<br>' . EMAIL_SEPARATOR . '<br> Shipping Method: ' . $vendor_products[$l]['Vmodule'] . ' -- ' . $vendor_products[$l]['Vmethod'] . '<br>' . EMAIL_SEPARATOR . '<br>' . '<br>Dropship deliver to:<br>' .
  $vendor_delivery_address_list['delivery_company'] . '<br>' .
  $vendor_delivery_address_list['delivery_name'] . '<br>' .
  $vendor_delivery_address_list['delivery_street_address'] . '<br>' .
  $vendor_delivery_address_list['delivery_city'] . ', ' .
  $vendor_delivery_address_list['delivery_state'] . ' ' . $vendor_delivery_address_list['delivery_postcode'] . '<br><br>';
  $email .= '<table width="100%" 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>';
  for ($i = 0, $n = sizeof($vendor_products[$l]['vendor_orders_products']); $i < $n; $i++) {
    $product_attribs = '';
    if (isset ($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) && (sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) > 0)) {
	  $product_attribs .= '   <i>Options<br>';
	  for ($j = 0, $k = sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']); $j < $k; $j++) {
	    $product_attribs .= '   ' . $vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes'][$j]['option'] . ': ' . $vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes'][$j]['value'] . '<br>';
	  }
    }
    $email .= '<tr><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] .
			  '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pname'] . '<br>' . $product_attribs .
			  '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_id'] .
			  '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['Pmodel'] .
			  '</td><td> ' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] . '</td><td>' .
    $vendor_products[$l]['vendor_orders_products'][$i]['Pcomments'] . '</b></td></tr>';
  }
   }
   $email = $email . '</table><br><HR><br>';
   /*
  tep_mail($the_name, $the_email, EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID ,  $email .  '<br>', STORE_NAME, STORE_OWNER_EMAIL_ADDRESS)  ;
   $vendor_order_sent = 'yes';

   tep_db_query("update " . TABLE_ORDERS_SHIPPING . " set order_sent = '" . tep_db_input($vendor_order_sent) . "' where orders_id = '" . (int)$oID . "'  and vendors_id = '" . (int)$vendors_id . "'");
  */
   if ($debug == 'yes') {
  echo 'The $email(including headers:<br>Vendor Email Addy' . $the_email . '<br>Vendor Name' . $the_name . '<br>Vendor Contact' . $the_contact . '<br>Body--<br>' . $email . '<br>';
   }
 }
 if ($HTTP_GET_VARS['action'] == 'success') {
?>
	    </td>
	  </tr>
	  <tr>
	    <td class="main"><?php echo '<b>Congratulations!  The email has been sent to <big>' . $contact . ' </b></big><br>For order number <b>' . $oID . '</b>';?></td>
	    <td class="pageHeading" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_VENDORS) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>
<?php
 } elseif ($HTTP_GET_VARS['action'] == 'preview') {

?>
	    </td>
	  </tr>
	  <tr><?php echo tep_draw_form('mail', FILENAME_VENDORS_EMAIL_SEND, 'action=send_vendor_email'); ?>
	    <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
		  <tr>
		    <td class="main"><?php echo 'The email will look like this: <br>'; ?></td>
		    <td align="center"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS_EMAIL_SEND, '&vID=' . $vID . '&oID=' . $oID . '&vOS=' . $vOS) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vID=' . $vendors_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>'; ?></td>
		  </tr>
		  <tr>
		    <td colspan="3"><?php echo tep_draw_separator(); ?></td>
		  </tr>
<?php if ($debug == 'yes') { ?>
		  <tr>
		    <td colspan="3"><?php echo $order_number . $the_email . $the_name . $the_contact; ?></td>
		  </tr>
<?php
 }
 $email = stripslashes($HTTP_POST_VARS['email']);
 echo '<tr><td><br>' . $email . '</tr>';
?>
		  <tr>
		    <td colspan="3"><?php echo tep_draw_separator(); ?></td>
		  </tr>
		  <tr>
		    <td class="main"><br><br>  <?php echo tep_draw_hidden_field ('email', $email);?>
			  <?php echo tep_draw_hidden_field('order_number', stripslashes($order_number));?>
			  <?php echo tep_draw_hidden_field('the_email',  stripslashes($the_email));?>
			  <?php echo tep_draw_hidden_field('the_name', stripslashes($the_name));?>
			  <?php echo tep_draw_hidden_field('the_contact', stripslashes($the_contact));?>
			  <?php echo tep_draw_hidden_field('vID', stripslashes($vID));?></td>
		  </tr>
		  <tr>
		    <td align="right"><?php echo tep_image_submit('button_send_mail.gif', IMAGE_SEND_EMAIL); ?></td>
		  </tr>
	    </table></td>
	  </tr>
    </table></form></td>
  <tr>
<?php } else { ?>
  <tr><?php echo tep_draw_form('mail', FILENAME_VENDORS_EMAIL_SEND, 'action=preview' . '&vID=' . $vendors_id . '&oID=' . $oID . '&vOS=' . $vOS); ?>
    <td><table border="0" width="100%" cellpadding="0" cellspacing="2">
	  <tr>
	    <td class="main"><?php echo 'The body of the email will look like this, this is what your Vendor will see when they open the email: <br>';?></td>
	    <td align="center"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vID=' . $vendors_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a></td>'; ?></td>
	  </tr>
	  <tr>
	    <td colspan="3"><?php echo tep_draw_separator(); ?></td>
	  </tr>
<?php  echo '<tr><td><br>' . stripslashes($email); ?></td></tr>
	  <tr>
	    <td class="main"><?php echo 'You may edit the email here: <br><br>'; ?></td>
	  </tr>
	  <tr>
	    <td colspan="3"><?php echo tep_draw_separator(); ?></td>
	  </tr>
	  <tr>
	    <td class="main"><br><br><p>***** Please note that the email is formatted with HTML. You can <b>ONLY</b> edit the <b>BODY</b> of the email here. You <b>CANNOT</b> edit the address the email will go to. <br><br>***** You may edit the HTML or just the text within the tags. Be sure to maintain  the HTML tags, if you are not sure what to change and what not to, don't mess it up, do a little research and find out the basics of HTML.</p><br>  <?php echo tep_draw_textarea_field('email', 'soft', '120', '25', stripslashes($email)); ?></td>
	  </tr>
	  <tr>
	    <td align="right"><?php echo tep_draw_hidden_field('vID', $vID);?>
		  <?php echo tep_draw_hidden_field('oID', $oID);?>
		  <?php echo tep_draw_hidden_field('vOS', $vOS);?>
		  <?php echo tep_image_submit('button_preview.gif', IMAGE_PREVIEW); ?></td>
	  </tr>
    </table></td>
  </tr>
   </table></form></td>
<?php
 }
?>
<!-- body_text_eof //-->
 </tr>
</table>
<?php
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Share this post


Link to post
Share on other sites

@---luke--- Set all of your virtual products to a vendor, then set up the Flat module to a cost of $0 for that vendor.

 

@@marcochiana Thanks for the code.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

There is no code to connect more than one vendor to a product, and the database configuration would not allow this. That would mean a new database table and a fairly large change to the code. It could be done, but it would not be easy.

 

I don't recommend using osCommerce 2.2 at this time. There are too many problems with that old code, and too great a likelihood that it will stop working the next time your host updates something. It's not that hard to get this working on a 2.3.3.4 install, and the result is much nicer, not to mention more secure.

 

Regards

Jim

 

Thanks for the response! I was hoping the 1:1 -> many:1 change would be trivial. add a table, change the vendor dropdown on product edit to checkboxes and change the insert/alter queries and voila! Shame that it isn't. :) Any ideas on where I should start looking to attempt the change? I really like the work you've done, and don't want to change contribs if I don't have to.

 

Moving to 2.3.x at this time isn't possible, as there are too many features that don't have 2.3 support yet (our payment method being one of them), and I have taken the steps necessary to secure 2.2 and make it PCI compliant. We're the host, so there's no risk of an unexpected update messing anything up.


--

Douglas Hurst

Owner/Developer

Wildcard Web Development

Share this post


Link to post
Share on other sites

You'll need to remove vendors_id from the products table and store it in a new table linked to the products_id. You then need to change the SQL that retrieves the vendors_id. That value is used pretty much everywhere, so there are a lot of changes to make. You will also need some logic to decide which value to use when there is more than one vendor for a product.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thanks for the quick reply Jim! Looks like I have a long road ahead of me, and only a day to do it. lol. Thanks for the tips. Wouldn't it be possible to leave vendors_id in products table and change the type to a varchar or something, insert as string, and then pull vendor ids from the vendors table (or something like that, SQL isn't my strong suit)?


--

Douglas Hurst

Owner/Developer

Wildcard Web Development

Share this post


Link to post
Share on other sites

You can do that, but it's harder to manage. Updates would need to read the string, separate the values, then look for duplicates.

 

Extracting the values would take some logic as well, and you have to do that in a lot of places. You would also need to separate out the SQL to get values from the vendors table, since that table can no longer be joined to the products table on vendors_id.

 

It's your choice which way works the best for you.

 

Doing all of this in a day? I wouldn't take that on, and I know the code as well as anyone. Good luck with that.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I was thinking of something like using substring_index, but yeah, you're right. That would be too messy. ~sigh~ Clients make me cry. lol I didn't count on them wanting multiple possible vendors for the same product# (oem is oem, after all).

 

I know it would be messy, but could I accomplish the same thing with multiple copies of the same product, each with a different vendor attached? Or would that still leave me with no way to determine which product/vendor combination was being used (short of having unique names from the products that only admin can see somehow)?


--

Douglas Hurst

Owner/Developer

Wildcard Web Development

Share this post


Link to post
Share on other sites

You could, but now you have to remember to change all copies of a product and not just one of them when updating information/prices. There would also be no way to change the vendor after the customer orders, since the product ordered is entered in the orders_products table. You would also risk getting a duplicate page penalty from Google, unless you took extra steps to define one of those identical product descriptions as the master. And what would the customer think of multiple identical products?

 

Probably not a good idea.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Ah, indeed. And part of the client's reasoning is that they'd like to be able to change the dropship vendor on the order AFTER it has been placed by the customer (effectively item substitution, but just changing the vendor). They're not even concerned with inventory control or sales tracking per product (they're tracking by member id only) so that doesn't matter as far as orders_products goes.

 

Thanks for all your help/feedback/ideas. I guess I'm just going to go back to bashing my head into my monitor until something spills out. :)


--

Douglas Hurst

Owner/Developer

Wildcard Web Development

Share this post


Link to post
Share on other sites

I think I've got it all set! I gave up on the complex notion of multiple vendors per product, and just enabled modifying the vendor for a specific item in a specific order. The only problem now is that it works great if I choose a vendor what was present when the order was created, but since the order process itself creates the shipping entry for the order, if I select a vendor that wasn't part of the original order, it just disappears from the order when I view it. So, this says to me that I must manually insert the shipping for that vendor into the order data, but I'm not sure how to do that or where to start looking other than checkout_shipping. Any thoughts?


--

Douglas Hurst

Owner/Developer

Wildcard Web Development

Share this post


Link to post
Share on other sites

All of the order data is saved to the database in checkout_process.php. If you change the vendor after that, you need to update the same database tables. Look at everywhere that vendors_id is saved in checkout_process.php and update those tables.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

ARGH! I've looked through the checkout_process code and various other places, and I can't get the shipping to set. I can't even figure out how to get the available shipping method data for the selected vendor. Everything I try results in an empty shipping data array or a blank page due to an inappropriate function call for new shipping. How would one go about getting the shipping data for a vendor? I tried using the code between the //MVS tags from the mods I did when I installed MVS, but no luck. The file seems to get a variable "$shipping" from somewhere that seems to have data already in it, but I can't figure out where. :(


--

Douglas Hurst

Owner/Developer

Wildcard Web Development

Share this post


Link to post
Share on other sites

The data is generated in includes/modules/vendors_shipping.php, which is used on the checkout_shipping.php page. The $shipping data is then carried in the session through the rest of the checkout process.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hmm. So including vendors_shipping.php SHOULD generate that data for me?


--

Douglas Hurst

Owner/Developer

Wildcard Web Development

Share this post


Link to post
Share on other sites

Well, that's where the customer selects the shipping method. I don't know how much of that code you can use, but it's probably a good starting point.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim

On the way to implement the MVS in my 2.3.3 Version of OsCommerce:

 

I've got a problem with the account_history_info.php file. When I look on a specific order the order information like products name, quantity, total isn't showing up.

 

In the vendor_order_info.php file there is a variable like "$product_data['orders_products'][$i]['name'];" which isn't defined.

 

Can you have a look at this file and the vendor_order_data.php where this variables gets defined. In my database there are all information...

 

I have learned a lot about php in the weeks ago but those big array structure is killing me ;)

 

Regards

luke

Share this post


Link to post
Share on other sites

Not right now. I have to save a client from himself.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

You could probably make it work by merging the changes to checkout_shipping.php. However, you should be able to do that with just MVS. Assign all of your free shipping products to one vendor, then set up the free shipping module for that vendor.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thanks for quick reply. I would prefer the checkout shipping mod, but the MVS method will be easier as I am not PHP expert. Works good for now.

Share this post


Link to post
Share on other sites

For International buyers will benefit with MVS method utilizing free shipping vendor. Have you a work around for this? Maybe if state not equal to US then redirect to standard shipping?

Share this post


Link to post
Share on other sites

Most shipping modules have a Zone setting. Set up your Free Shipping module for the US Zone and another (pay) module for the rest of the countries you ship to. Or use the MZMT module (the MVS version of course) and set up one zone for the US with a shipping table of 0:0 and another for the rest of the world using whatever shipping table pleases you.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim

On the way to implement the MVS in my 2.3.3 Version of OsCommerce:

 

I've got a problem with the account_history_info.php file. When I look on a specific order the order information like products name, quantity, total isn't showing up.

 

In the vendor_order_info.php file there is a variable like "$product_data['orders_products'][$i]['name'];" which isn't defined.

 

Can you have a look at this file and the vendor_order_data.php where this variables gets defined. In my database there are all information...

 

I have learned a lot about php in the weeks ago but those big array structure is killing me ;)

 

Regards

luke

 

 

the problem, I think, is the value of the variable $order_id

To solve this problem add at beginning of vendor_order_data.php this code

   if (isset ($_GET['order_id']) && $_GET['order_id'] != '') { 
 $order_id = (int) $_GET['order_id'];
 }

 

Regards

Share this post


Link to post
Share on other sites

the problem, I think, is the value of the variable $order_id

To solve this problem add at beginning of vendor_order_data.php this code

if (isset ($_GET['order_id']) && $_GET['order_id'] != '') {
$order_id = (int) $_GET['order_id'];
}

 

Regards

 

Hope you saved Your client. Thank you for your replay. But the $_GET['order_id'] I had already changed to (int) $_GET['order_id'] and that didn't fix it. Only some data like the Shipping Module and the Shippingdestination and the weight appeared after this changes but not the model number, amount and prizes.

 

I have the same problem in the admin/orders.php file where the shipping method, shipping cost, model number, and all prizes of a single product aren't displayed. When i turn the debug mode on, nothing else happens.

 

The Table "vendors" and "orders_shipping" are filled with the data.

 

I have also a vendors_info table which is empty maybe there's the falut?

 

Best Regards

Edited by ---luke---

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

×