Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Jim, you are my hero!

 

You have no idea how badly I have been wanting a working shipping estimator for MVS!

 

Thanks for busting your brains and getting this contrib to work with MVS

 

I had tried and tried to get it to work myself, but gave up after realizing it was beyond my abilities.

You really saved the day, thanks again!

 

 

Hi Jim,

 

Hate to tell you this, but...

 

I found a bug in the ship estimator.

If you are not logged in, when you go to change address for quote, the estimator does not reset the state.

IE: I tested it first with 90210 CA US - worked like a charm

went to change address to 33186 FL US and see that the new zip is listed correctly in the ship to address, but the state stays as CA and is not changed to FL

 

this results in no UPS quotes returned.

 

looking into it and will let you know what I find

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

Hi Jim,

 

Hate to tell you this, but...

 

I found a bug in the ship estimator.

If you are not logged in, when you go to change address for quote, the estimator does not reset the state.

IE: I tested it first with 90210 CA US - worked like a charm

went to change address to 33186 FL US and see that the new zip is listed correctly in the ship to address, but the state stays as CA and is not changed to FL

 

this results in no UPS quotes returned.

 

looking into it and will let you know what I find

 

 

easy fix, you just need to unregister the shipzone

(you got it in the ship_estimator.php, but missed it in the products_ship_estimator.php

 

In products_ship_estimator.php

 

 

 

find

	  tep_session_unregister ('shipcountry');

 

change to

	  tep_session_unregister ('shipcountry');
  tep_session_unregister ('shipzone');

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

Having one last problem with MVS 1.1.

 

I have spent more time searching the forum posts for a fix than it took me to install the module. Sorry if this is addressed elsewhere.

 

On Vendor Mananger I'm seeing the following:

 

There are 1 orders for this Vendor.

This Vendor has 308 products.

Click here for Products Report

 

The products and orders are showing in the Vendor Manager as you can see above. But when you click on either Orders or Product Reports there is nothing showing. Also, no error messages are given.

 

Any help would be appreciated!

 

Joe

Link to comment
Share on other sites

Jim:

Thanks for the bug report. Yes, I did forget to clean up the unregister() functions in the products ship estimator. Oops. There are a few extra commands in there that will mess up shipping in certain (rare) cases, so I fixed those as well. I'll post an update as soon as I can get to it. Thanks again for telling me.

 

Joe:

Sorry, I don't know what is causing that. It's working for me. Try looking at the source of those blank pages. Is it truly blank, or is there some HTML in there? If it's not completely blank, you should get an idea of where the code is missing. It's just a matter of tracking down the bugs. Sorry I can't be more specific. Maybe somebody else has seen this and can remember a fix.

 

Regards

Jim

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

Link to comment
Share on other sites

Jim:

Thanks for the bug report. Yes, I did forget to clean up the unregister() functions in the products ship estimator. Oops. There are a few extra commands in there that will mess up shipping in certain (rare) cases, so I fixed those as well. I'll post an update as soon as I can get to it. Thanks again for telling me.

 

Joe:

Sorry, I don't know what is causing that. It's working for me. Try looking at the source of those blank pages. Is it truly blank, or is there some HTML in there? If it's not completely blank, you should get an idea of where the code is missing. It's just a matter of tracking down the bugs. Sorry I can't be more specific. Maybe somebody else has seen this and can remember a fix.

 

Regards

Jim

Link to comment
Share on other sites

Hi i tried the 2.1 but this does not work for me, can you tell me how to delete the table from the database?

 

"INSERT INTO `configuration` VALUES (NULL, 'Use Zones', 'SHIP_ESTIMATOR_USE_ZONES', 'true', 'Shipping modules use zones restriction - Used in Shipping Estimator', 7, 44, '2008-03-04 00:00:00', '2008-03-04 00:00:00', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');"

Link to comment
Share on other sites

Hi i tried the 2.1 but this does not work for me, can you tell me how to delete the table from the database?

 

"INSERT INTO `configuration` VALUES (NULL, 'Use Zones', 'SHIP_ESTIMATOR_USE_ZONES', 'true', 'Shipping modules use zones restriction - Used in Shipping Estimator', 7, 44, '2008-03-04 00:00:00', '2008-03-04 00:00:00', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');"

Delete the entire configuration table? I don't think that you really want to do that. If you just want to delete that one line, your database management tool should be able to handle that. It's probably the last entry in the configuration table listing.

 

Regards

Jim

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

Link to comment
Share on other sites

Hello Jim,

 

On the Vendor Manager page the information is appearing as follows for vendor 1:

 

There are 10 orders for this Vendor.

This Vendor has 302 products.

Click here for Products Report

 

When you click on either the order button or the products report you are then taken to the appropriate page for the reports.

 

Listed in the drop down is None, and then three different vendors. Each time you select one of the vendors the screen refreshes and the drop box goes back to the None. So no information appears for any of the vendors.

 

When orders are placed they are updating on the Vendor Manager page.

 

I checked the page source for products_by_vendor. If found that the ID for None is 1 and the ID for vendor 1 is also 1. Could this be the problem?

Link to comment
Share on other sites

I'm sorry in advance if this question has been asked before. I have looked all over google and this forum. I have installed oscommerce and added MVS 1.1 and all worked great. I then added the dimensions.txt shipping add-on and now when I go to checkout it doest give me any shipping Methods. Even if I select in-store pickup in the admin. There are no error messages!!! Can anyone please help me?

 

 

Thank You

jyacks

Link to comment
Share on other sites

I am creating a shopping mall and need to know as I do with this script, multiple shop paying a monthly fee, regards

 

 

Hey Guys:

 

I like where you are going, if I can be of any help I'll be happy to help out. I am very comfirtable coding in PHP.

 

Here are my thoughts after reading this whole thread.

 

1) I think it was a good idea to start talking about how it will be used (called a "Use Case") rather than what features you need to use. The Use Case will flush out the needed features (AKA requirements).

 

2) I think putting up your vision of what it will look like was another good idea. I am a software developer and I always start with a mockup and bounce it off the stake holders.

 

3) I don't use any other contributions in this context, but I want to start selling product from two vendors from two locations and I know the shipping will kill me if I don't show it to the customer and let them choose for themselves while making them aware that this is because the products they chose come from multiple vendors. I like your ascii mockup.

 

4) I like your idea of creating a vendor (or a vendor location) table and I would think that you want to add manufacturers to a vendor location instead of adding a vendor to each product. So if I have a bunch of products made by sony, rca and jvc but they all come from the same vendor (say Vendor Location A) then in an Admin page I would set the manufacturer, sony, rca and jvc to Vendor Location A and then I wouldn't have to touch the Product Page at all, assuming my products already have the manufacturer set. In the check out page I would query using the product_ids to find out which manufacturers are involved in the cart contents and how many vendor locations the whole orders has. Let's just say it has 2. Then I would get the zip codes for each of those 2 vendor locations and then I would separate the order by these 2 locations and add the weight leaving these 2 locations, then loop twice on the "Choose Shipping" page in the Checkout process, each time it would get a quote for the separated weight and the Vendor's Location as the origin and the customer's shipping address (much like it does now. You could also indicate this is going to happen in the shopping cart by displaying that there are multiple vendor locations involved in the contents of your cart.

 

Am I oversimplifying it?

 

I'll support you any way I can!!

 

Joey

Link to comment
Share on other sites

I'm sorry in advance if this question has been asked before. I have looked all over google and this forum. I have installed oscommerce and added MVS 1.1 and all worked great. I then added the dimensions.txt shipping add-on and now when I go to checkout it doest give me any shipping Methods. Even if I select in-store pickup in the admin. There are no error messages!!! Can anyone please help me?

Thank You

jyacks

I have had something similar, only I did not add any extra modules. I installed MVS on my localhost osc site and got it working, then I uploaded all file changes to my remote server (and modified the remote database) and now it all works exept that I don't get any shipping methods in the checkout. The products are even split up by vendor...but no shipping methods show. Anyone have a similar problem/fix?

 

Thanks! Keep up the great work!

 

J

Link to comment
Share on other sites

I have had something similar, only I did not add any extra modules. I installed MVS on my localhost osc site and got it working, then I uploaded all file changes to my remote server (and modified the remote database) and now it all works exept that I don't get any shipping methods in the checkout. The products are even split up by vendor...but no shipping methods show. Anyone have a similar problem/fix?

 

Thanks! Keep up the great work!

 

J

 

Are the server versions the same? and/or are the php versions the same?

You might try removing the shipping modules and reinstalling them.

Edited by jyacks
Link to comment
Share on other sites

I'm sorry in advance if this question has been asked before. I have looked all over google and this forum. I have installed oscommerce and added MVS 1.1 and all worked great. I then added the dimensions.txt shipping add-on and now when I go to checkout it doest give me any shipping Methods. Even if I select in-store pickup in the admin. There are no error messages!!! Can anyone please help me?

Thank You

jyacks

 

 

Update to my problem!!

 

I have upsxml + dimensions installed and it works good with multi-vendors is turned OFF, but as soon as I turn it ON, none of the vender's shipping modules work.

 

Any ideas on what might be happening here or how to fix it?

Edited by jyacks
Link to comment
Share on other sites

Update to my problem!!

 

I have upsxml + dimensions installed and it works good with multi-vendors is turned OFF, but as soon as I turn it ON, none of the vender's shipping modules work.

 

Any ideas on what might be happening here or how to fix it?

jyacks, UPS not too far back made a number of major changes/updates and the UPSXML module was also updated. Are you working with the new version or the one that was included in the MVS distribution?

 

I've set up the mulit-vendor shipping and it works well. One problem though; the Order comments aren't showing up on the emails that go to the vendors. any suggestions? Thanks!

gretchen2u, the "order comments" from the customer are not included in the Vendor's email the way things are set up now. One could fairly easily add them. I am not sure you would want all the comments from a customer to show to the Vendor though, I would think about that again if I were you.

 

Good luck to you both, 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

Hello,

 

I just uploaded the MSV contribution.

 

I am getting this on my www.mysite.com/catalog/administration page...it is preventing me from getting to my site administration.

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', '')

 

However, I do have access to my cpanel to change code.

 

Janet

Link to comment
Share on other sites

Hello,

 

I just uploaded the MSV contribution.

 

I am getting this on my www.mysite.com/catalog/administration page...it is preventing me from getting to my site administration.

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', '')

 

However, I do have access to my cpanel to change code.

 

Janet

Janet, you will need to double check your edits to the files concerned with MVS. If you simply uploaded the files included with MVS, then I would suggest you upload them again and make sure your FTP is uploading using "ASCII", this should be set to "automatic" in your FTP program but some will need you to set which files need to be uploaded that way.

 

 

Good luck, Craig :)

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

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

Multi Vendor Shipping V1.1 Demo Admin

login: [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

Janet, you will need to double check your edits to the files concerned with MVS. If you simply uploaded the files included with MVS, then I would suggest you upload them again and make sure your FTP is uploading using "ASCII", this should be set to "automatic" in your FTP program but some will need you to set which files need to be uploaded that way.

Good luck, Craig :)

 

I have looked...one english file was missing...but I fixed that...I am still getting the same error. I have checked all the adminstration files with no luck this morning. So maybe I could narrow my mistake down. Where is the tep_href_link function located?

 

Sorry if that sounds like a silly question. It is just that I thought tep_href_link functions were most usually in the english.php files.

 

Janet

Link to comment
Share on other sites

I have looked...one english file was missing...but I fixed that...I am still getting the same error. I have checked all the adminstration files with no luck this morning. So maybe I could narrow my mistake down. Where is the tep_href_link function located?

 

Sorry if that sounds like a silly question. It is just that I thought tep_href_link functions were most usually in the english.php files.

 

Janet

No, "tep_href_link" is defined in "includes/functions/html_output.php"

 

This is a function built to make sure sessions id's and other background data is being passed properly.

 

Check that file and see if there are any issues there, 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

I'm having trouble trying to modify my vendors email (sent in checkout_process.php) to include the following info:

 

vendor item price(s)

item subtotal

shipping charge

Total

 

I can get it to show the vendor price and calculate the prices if 2 or more of an item is ordered.

But can't seem to get it to show the shipping fee and calculate the subtotals and totals properly.

 

Below is the code for a heavily modified vendor email (lots of tables and some extra custom fields I use)

 

 

 

$email=  '<table border="1" cellspacing="0" cellpadding="10"><tr><td><table border="0" width="100%"><tr><td width="50%" valign="top"><b>' . STORE_OWNER . '</b><br>' . STORE_NAME_ADDRESS . '<br>www.thecigarhut.com</td><td width="50%" valign="top" rowspan="2"><b>Dropship Order #:</b>' . $oID . '<br><br><br><br><b>Ship To:</b><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_street_address_2'] .'<br>' .
$vendor_delivery_address_list['delivery_suburb'] .'<br>' .
$vendor_delivery_address_list['delivery_city'] .', ' .
$vendor_delivery_address_list['delivery_state'] . '   ' . $vendor_delivery_address_list['delivery_postcode'] . '<br>';
$vendor_delivery_address_list['delivery_country'] .'<br>' .
$vendor_delivery_address_list['delivery_telephone'] . '<br><br></td></tr>';
$email = $email .  '<tr><td width="50%" valign="bottom"><b>Attn: ' . $the_contact . '</b><br>' . $the_name . '<br>' .
$vendor_products[$l]['Vstreet'] . '<br>' .
$vendor_products[$l]['Vcity'] .', ' .
$vendor_products[$l]['Vstate'] .'   ' .
$vendor_products[$l]['Vzipcode'] .'<br>' . $vendor_country . '<br>' .
$vendor_products[$l]['Vtelephone'] .'<br><br></td></tr></table>';
	$email = $email . '<table border="1" cellspacing="0" cellpadding="3" bordercolor="#808080"><tr><td align="center" colspan="2">YOUR NO.</td><td align="center" colspan="2">SHIP VIA</td><td align="center" colspan="2">PROMISED DATE</td><td align="center">TERMS</td><td align="center" colspan="2">DATE</td><td align="center">PG.</td></tr><tr><td align="center" colspan="2"> </td><td align="center" colspan="2">' . $vendor_products[$l]['Vmethod'] .  ' </td><td align="center" colspan="2"> </td><td align="center">' . $vendor_products[$l]['Vinstructions'] .' </td><td align="center" colspan="2">' . strftime("%m/%d/%y") . '</td><td align="center">1</td></tr><tr><td align="center">QTY.</td><td align="center" colspan="2">ITEM NO.</td><td align="center" colspan="2">DESCRIPTION</td><td align="center">PRICE</td><td align="center">UNIT</td><td align="center">EXTENDED<br>PRICE</td><td align="center" colspan="2">TAX</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)) {


	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 = $email . '<tr><td align="center">' . $vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] .
 '</td><td align="left" colspan="2" nowrap>' . $vendor_products[$l]['vendor_orders_products'][$i]['Pmodel'] .
 '</td><td align="left" colspan="2">' . $vendor_products[$l]['vendor_orders_products'][$i]['Pname'] .
 '</td><td align="right">$' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] .
 '</td><td align="center">' . $vendor_products[$l]['vendor_orders_products'][$i]['Ppqty'] .
 '</td><td align="right">$' . ($vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] * $vendor_products[$l]['vendor_orders_products'][$i]['Pqty']) .
 '</td><td align="center" colspan="2"> ' .
 '</td></tr>';

  }
}
$email = $email . '<tr><td align="center" colspan="6"> </td><td align="left" nowrap>SALE AMOUNT<br>FREIGHT<br>TOTAL AMOUNT<br>PAID TODAY</td><td align="left" colspan="3">$SUB_TOTAL<br>$' .  $vendor_order['shipping_cost'] . '<br>$TOTAL<br>$0.00</td></tr><tr><td align="center" colspan="6">Memo: Please Reply with USPS Tracking Number</td><td align="center" colspan="4">BALANCE DUE: $TOTAL</td></tr></table></td></tr></table>';

 

The things I need the right code for are in the last line and I currently have just the following placeholders for them

$SUB_TOTAL (to add up the vendor prices for all items ordered)

$TOTAL (add together the SUB TOTAL and the SHIPPING COST)

and for some reason, the following bit

' . $vendor_order['shipping_cost'] . '

just returns a blank entry even though I have it in the query further up the page.

 

 

Anyone with any bright ideas to help would be be greatly admired and appreciated!

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

No, "tep_href_link" is defined in "includes/functions/html_output.php"

 

This is a function built to make sure sessions id's and other background data is being passed properly.

 

Check that file and see if there are any issues there, Craig :)

 

I still don't see anything...could this be because I have a bts template I am having this problem? I made all the changes necessary in the fallback folders when necessary. do you want to see my html_output.php file?

Link to comment
Share on other sites

Ok, have made great headway with my customized vendor email!!!

 

This builds a very nice html email with all kinds of extra tables and info in it like:

vendor price subtotals

shipping fee

vendor order total

 

for those who may want to do the same, here is the code in checkout_process.php

(note that I use some extra fields in my database that are included in the form)

 

 

	if (($total_weight > 0 ) && (SELECT_VENDOR_EMAIL_OPTION == 'true')){
  $order_id = $insert_id;
   require(DIR_WS_INCLUDES . 'vendor_order_data.php');
	   }
function vendors_email($vendors_id, $oID, $status, $vendor_order_sent) {
   $vendor_order_sent =  false;
  $debug='no';
  $vendor_order_sent = 'no';
$index2 = 0;
		  //let's get the Vendors
		  $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.vendors_phone1, 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 . "' and v.vendors_status_send='" . $status . "'");
	   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'],
						 'Vtelephone' => $vendor_order['vendors_phone1'],
						 'Vinstructions' => $vendor_order['vendor_add_info'],
						 'Vcost' => $vendor_order['shipping_cost'],
						 '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, p.products_qty from " . TABLE_ORDERS_PRODUCTS . " o, " . TABLE_PRODUCTS . " p where p.vendors_id='" . (int)$vendor_order['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'],
								  'Ppqty' => $vendor_orders_products['products_qty'],
								  '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' => '-');
							   //MVS end
			   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_street_address2, delivery_suburb, delivery_city, delivery_state, delivery_postcode, delivery_telephone, delivery_country 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=$vendor_products[$l]['Vid'];
$the_email=$vendor_products[$l]['Vemail'];
$the_name=$vendor_products[$l]['Vname'];
$the_contact=$vendor_products[$l]['Vcontact'];
$email=  '<table border="1" cellspacing="0" cellpadding="10"><tr><td><table border="0" width="100%"><tr><td width="50%" valign="top"><b>' . STORE_OWNER . '</b><br>' . STORE_NAME_ADDRESS . '<br>www.thecigarhut.com</td><td width="50%" valign="top" rowspan="2"><b>Dropship Order #</b>' . $oID . '<br><br><br><br><b>Ship To:</b><br>';
if (tep_not_null(($vendor_delivery_address_list['delivery_company'])) {
$email = $email . $vendor_delivery_address_list['delivery_company'] .'<br>';
}
$vendor_delivery_address_list['delivery_name'] .'<br>' .
$vendor_delivery_address_list['delivery_street_address'] .'<br>';
if (tep_not_null(($vendor_delivery_address_list['delivery_street_address_2'])) {
$email = $email . $vendor_delivery_address_list['delivery_street_address_2'] .'<br>';
}
if (tep_not_null(($vendor_delivery_address_list['delivery_suburb'])) {
$email = $email . $vendor_delivery_address_list['delivery_suburb'] .'<br>';
}
$vendor_delivery_address_list['delivery_city'] .', ' .
$vendor_delivery_address_list['delivery_state'] . '   ' . $vendor_delivery_address_list['delivery_postcode'] . '<br>' .
$vendor_delivery_address_list['delivery_country'] .'<br>' .
$vendor_delivery_address_list['delivery_telephone'] . '<br><br></td></tr>';
$email = $email .  '<tr><td width="50%" valign="bottom"><b>Attn: ' . $the_contact . '</b><br>' . $the_name . '<br>' .
$vendor_products[$l]['Vstreet'] . '<br>' .
$vendor_products[$l]['Vcity'] .', ' .
$vendor_products[$l]['Vstate'] .'   ' .
$vendor_products[$l]['Vzipcode'] .'<br>' . $vendor_country . '<br>' .
$vendor_products[$l]['Vtelephone'] .'<br><br></td></tr></table>';
	$email = $email . '<table border="1" cellspacing="0" cellpadding="3" bordercolor="#808080"><tr><td align="center" colspan="2">YOUR NO.</td><td align="center" colspan="2">SHIP VIA</td><td align="center" colspan="2">PROMISED DATE</td><td align="center">TERMS</td><td align="center" colspan="2">DATE</td><td align="center">PG.</td></tr><tr><td align="center" colspan="2"> </td><td align="center" colspan="2"><b>' . $vendor_products[$l]['Vmethod'] .  '</b></td><td align="center" colspan="2"> </td><td align="center">' . $vendor_products[$l]['Vinstructions'] .' </td><td align="center" colspan="2">' . strftime("%m/%d/%y") . '</td><td align="center">1</td></tr><tr><td align="center">QTY.</td><td align="center" colspan="2">ITEM NO.</td><td align="center" colspan="2">DESCRIPTION</td><td align="center">PRICE</td><td align="center">UNIT</td><td align="center">EXTENDED<br>PRICE</td><td align="center" colspan="2">TAX</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)) {

	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 = $email . '<tr><td align="center">' . $vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] .
 '</td><td align="left" colspan="2" nowrap>' . $vendor_products[$l]['vendor_orders_products'][$i]['Pmodel'] .
 '</td><td align="left" colspan="2">' . $vendor_products[$l]['vendor_orders_products'][$i]['Pname'] .
 '</td><td align="right">$' . $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] .
 '</td><td align="center">' . $vendor_products[$l]['vendor_orders_products'][$i]['Ppqty'] .
 '</td><td align="right">$' . ($vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] * $vendor_products[$l]['vendor_orders_products'][$i]['Pqty']) .
//	 '</td><td align="right">' . $currencies->format(($vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price'] * $vendor_products[$l]['vendor_orders_products'][$i]['Pqty']), true, $order->info['currency'], $order->info['currency_value']) .
//	 '</td><td align="right">' . $currencies->format($these_products[$l]['orders_products'][$i]['final_price'] * $these_products[$l]['orders_products'][$i]['qty'], true, $these_info['currency'], $these_info['currency_value']) . "\n\t" .
 '</td><td align="center" colspan="2"> ' .
 '</td></tr>';
	$VendorSubTotal += ($vendor_products[$l]['vendor_orders_products'][$i]['Pqty'] * $vendor_products[$l]['vendor_orders_products'][$i]['PVprod_price']);

  }
if (tep_session_is_registered('backorders')) {
$backorderinfo = $GLOBALS['backorders'];
 }

if (tep_session_is_registered('comments')) {
$custcomments = '<b>Customer Comments / Special Instructions</b><br>' . $GLOBALS['comments'];
 }
$VendorTotal = ($VendorSubTotal + $vendor_products[$l]['Vcost']);
$email = $email . '<tr><td align="left" colspan="6" valign="top">' . $custcomments . ' </td><td align="left" nowrap>SALE AMOUNT<br>FREIGHT<br>TOTAL AMOUNT<br>PAID TODAY</td><td align="left" colspan="3">$' . $VendorSubTotal . '<br>$' . $vendor_products[$l]['Vcost'] . '<br>$' . $VendorTotal . '<br>$0.00</td></tr><tr><td align="left" colspan="6"><b>Backorder Instructions:</b> ' . $backorderinfo .  '</td><td align="center" colspan="4">BALANCE DUE: $' . $VendorTotal . '</td></tr></table></td></tr></table>';

}

 if (tep_mail($the_name, $the_email, EMAIL_VENDOR_ORDER_NUMBER . '' . $oID . ' for ' . $vendor_delivery_address_list['delivery_name'] . ' from ' . STORE_OWNER,  $email .  '<br>', STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS) ) $vendor_order_sent = 'yes';

   if ( $vendor_order_sent == 'yes') {
 tep_db_query("update " . TABLE_ORDERS_SHIPPING . " set vendor_order_sent = '" . tep_db_input($vendor_order_sent) . "' where orders_id = '" . (int)$oID . "'  and vendors_id = '" . (int)$vendors_id . "'");
			   } else {
	  tep_db_query("update " . TABLE_ORDERS_SHIPPING . " set vendor_order_sent = 'no' 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>';
	   }
 }

 return true;
} //MVS end

 

 

 

All that I need to figure out now is how to add a suffix to the order number if more than one vendor is used.

(This would be only in the emails sent and not in the database.)

 

ie: customer orders items from 2 vendors,

1st vendor gets an email for Order #12345a

2nd vendor gets an email for Order #12345b

 

but if customer orders from just 1 vendor no suffix is added

 

any ideas?

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Link to comment
Share on other sites

<code snipped>

All that I need to figure out now is how to add a suffix to the order number if more than one vendor is used.

(This would be only in the emails sent and not in the database.)

 

ie: customer orders items from 2 vendors,

1st vendor gets an email for Order #12345a

2nd vendor gets an email for Order #12345b

 

but if customer orders from just 1 vendor no suffix is added

 

any ideas?

count ($cart->vendor_shipping) will give you the number of vendors in the current order. Test for that value > 1 and add your suffix. You could also just add the $vendors_id as a suffix, so you always know which vendor that order number belongs to.

 

Regards

Jim

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

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...