Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

Rick: I think I see what you are trying to do. Craig wrote this part, so I'm not as familiar with it as I should be. Bear with me here....

 

Most of the code for new orders has been moved out to vendor_order_info.php. If you look in there, the variable for quantity is

$order->products[$l]['orders_products'][$i]['qty']

and the variable for product name is

$order->products[$l]['orders_products'][$i]['name']

In the above variables, $l is the vendor id and $i is the product id. I'm assuming that you have a loop already to step through the products. You'll need another loop outside that one to step through the vendors, using something like 

  for ($l=0, $m=sizeof($order->products); $l<$m; $l++) {

If I didn't understand what you are trying to do, please let me know and I'll try again.

 

Regards

Jim

 

Thanks Jim, that's exactly what I was after.

 

Rick Knight

Share this post


Link to post
Share on other sites

Well, it's been pretty quite here lately. I guess no one is finding any bugs to report. I haven't found any. Today I modified my Easypopulate and Margin Report mods to work with this. So far so good. I amy try it on my live server this weekend, especially if no one is finding any problems.

 

Craig and Jim, EXCELLENT JOB.

 

Thanks,

Rick Knight

Share this post


Link to post
Share on other sites

We actually did get a bug report, but it's pretty tame: unneeded extra code and some extra files. Good to know that nothing too serious has been found. I'm working on the instructions, merging what I have done with a complete set from James. We're looking at a final release fairly soon. Unless, of course, somebody finds some bugs.

 

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

A question about customer orders related to MVS, how is a store owner supposed to know when a vendor has shipped their items. In Admin > customers > orders > edit

there is a place to mark an order as pending,processed or delivered

 

how is a store own supposed to keep track of which orders have been shipped (completely) esp when dealing with orders taht are going out from more than one vendor ? this also leads me to another question, ill post in the general area

 

thanks

Share this post


Link to post
Share on other sites

That is something that you will have to arrange with your vendor. osCommerce will send you an email telling you that the order has been received. You can choose to have an email sent to the vendor directly from your store, or you can choose to contact the vendor and place the order yourself. Whichever way you choose, you will then have to work with your vendor to track orders and then pass information on to your customer as needed.

 

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
Well, it's been pretty quite here lately. I guess no one is finding any bugs to report. I haven't found any. Today I modified my Easypopulate and Margin Report mods to work with this. So far so good. I amy try it on my live server this weekend, especially if no one is finding any problems.

 

Craig and Jim, EXCELLENT JOB.

 

Thanks,

Rick Knight

Let us all know how it goes! I'm curious.

 

Also, are there instructions on what to modify in easy populate?

Share this post


Link to post
Share on other sites
Let us all know how it goes!  I'm curious.

 

Also, are there instructions on what to modify in easy populate?

Sorry for the late reply to the activity this week, been very busy. I wanted to mention that there is a version of EasyPopulate already available that handles Vendors, see the VendorAutoEmail contrib that started all this for me. I also have a modified version of MarginReport that I will include with the next release, when I get time to put the package together. If there is any interest, I will also include some file export functions I use for my accounting software, let me know if anyone is interested, Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

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

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

OK. After several attempt to break something, anything, with this mod and not being able to, I decided to install it to my live store. I just finnished up with the install and some prelim testing, and everything is working and working very well. I too modified my Easypopulate and Margin report contribs to work with this, but that was relaltivly simple. It looks like some work is needed to make this work with the RMA contrib, so I'll see what I can there (any input very welcome).

 

So far, so good. Thanks guys.

 

Craig, I would like to see your Easypopulate and Margin report contribs.

 

Thanks again,

Rick Knight

Share this post


Link to post
Share on other sites
OK. After several attempt to break something, anything, with this mod and not being able to, I decided to install it to my live store. I just finnished up with the install and some prelim testing, and everything is working and working very well. I too modified my Easypopulate and Margin report contribs to work with this, but that was relaltivly simple. It looks like some work is needed to make this work with the RMA contrib, so I'll see what I can there (any input very welcome).

 

So far, so good. Thanks guys.

 

Craig, I would like to see your Easypopulate and Margin report contribs.

 

Thanks again,

Rick Knight

Sounds great Rick! We found a few minor things but nothing major.

I will probably include my versions of these contribs with the next release. The EP is already available via the EP contrib page and the Vendor Auto Email download, it may need some updating along with the email functionality for the Vendors. I would also appreciate any mods you do, if your willing to contribute them, you have been a great help during this project. I hope to have a complete FINAL release this week.

Craig :)

Edited by blucollarguy

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

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

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

Possible bug:

 

If you are using any shipping module that requires weight as an input, please check that your module is using the correct value. The default is $shipping_weight, which is the total for the entire order. This should be changed to $cart->vendor_shipping[$vendors_id]['weight'] to get the weight for the specific vendor. You will probably also need to add $cart to the globals list for the method you are in. I'm still investigating this, so I may end up finding a better way to do the job. Stay tuned....

 

Regards

Jim

 

(Edited: I can't type. Bleah.)

Edited by kymation

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

Share this post


Link to post
Share on other sites

If anybody is using the UPS module, here are some changes to fix the shipping weight (and a few other things.) Find the following (line 106):

    function quote($method = '', $module = '', $vendors_id = '1') {
     global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes;

and change it to this:

    function quote($method = '', $module = '', $vendors_id = '1') {
     global $HTTP_POST_VARS, $order, $cart, $shipping_num_boxes;

     $shipping_weight = $cart->vendor_shipping[$vendors_id]['weight'];

Next, find this (line 122):

      $country_name = tep_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
//MVS Start
     $vendors_data_query = tep_db_query("select handling_charge, 
                                                handling_per_box, 
                                                vendors_zipcode 
                                         from " . TABLE_VENDORS . " 
                                         where vendors_id = '" . (int)$vendors_id . "'"
                                       );
     $vendors_data = tep_db_fetch_array($vendors_data_query);

and change it to this:

//MVS Start
     $vendors_data_query = tep_db_query("select handling_charge, 
                                                vendor_country,
                                                handling_per_box, 
                                                vendors_zipcode 
                                         from " . TABLE_VENDORS . " 
                                         where vendors_id = '" . (int)$vendors_id . "'"
                                       );
     $vendors_data = tep_db_fetch_array($vendors_data_query);
     $country_name = tep_get_countries($vendors_data['vendor_country'], true);

Then find this (line 133):

//MVS - changed $this->_upsOrigin(....
     $this->_upsOrigin($vendors_data['vendors_zipcode'], $country_name['countries_iso_code_2']);
     $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']);
     $this->_upsRate(MODULE_SHIPPING_UPS_PICKUP);
     $this->_upsContainer(MODULE_SHIPPING_UPS_PACKAGE);
     $this->_upsWeight($shipping_weight);
     $this->_upsRescom(MODULE_SHIPPING_UPS_RES);

and change it to this:

      $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']);
//MVS Start
     $this->_upsOrigin($vendors_data['vendors_zipcode'], $country_name['countries_iso_code_2']);
     $this->_upsRate(constant('MODULE_SHIPPING_UPS_PICKUP_' . $vendors_id));
     $this->_upsContainer(constant('MODULE_SHIPPING_UPS_PACKAGE_' . $vendors_id));
     $this->_upsRescom(constant('MODULE_SHIPPING_UPS_RES_' . $vendors_id));
//MVS end
     $this->_upsWeight($shipping_weight);

My module now appears to be giving correct quotes. I suggest that anybody who is planning to use UPS should run some test orders with both the modified and unmodified versions to confirm that they give the same quotes with the same products. You should add some products from another vendor to the order on the modified store to verify this. If anybody is still getting incorrect quotes with this module, please let me know.

 

I assume that any other module that uses weight-based quotes will need similar mods. That includes FedEx and USPS, plus any others that I've forgotten.

 

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've installed mvs_0.9rc2.1 on fairly clean new install of osc MS2.

 

I'm getting this error after I click "confirm" on the Order Confirmation page:

 

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

 

This is the email text after the "include":

1 x Test Blue Jacket (TEST-BLUE-JA) = $95.00

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/patriot/catalog/checkout_process.php:262) in /usr/www/users/patriot/catalog/includes/functions/general.php on line 29

 

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

 

Any ideas ????

 

Thanks.

Jeff.

Share this post


Link to post
Share on other sites
I've installed mvs_0.9rc2.1 on fairly clean new install of osc MS2.

 

I'm getting this error after I click "confirm" on the Order Confirmation page:

 

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

 

This is the email text after the "include":

1 x Test Blue Jacket (TEST-BLUE-JA) = $95.00

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/patriot/catalog/checkout_process.php:262) in /usr/www/users/patriot/catalog/includes/functions/general.php on line 29

 

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

 

Any ideas  ????

 

Thanks.

Jeff.

 

 

NOTE -- here is what line 262 in checkout_process.php looks like:

 

echo 'This is the email text after the "include":<br>' . $products_ordered . '<br>';

 

 

Looks like some debug code to me.

 

Is that supposed to be there ??

 

Thx.

Share this post


Link to post
Share on other sites

That line is in the tep_redirect() function. It sounds like you have something that is trying to print something in your checkout_process.php. I would check through that file for any print or echo statements. You could also have a function or method in there that does direct output. If you are having trouble finding the problem, I would comment out the redirect near the bottom of checkout_process.php, then go through the checkout process again and see if something shows up on that page.

 

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

That line in your second message looks to be the problem. No, that should not be in there. It looks like a test version of the code was accidentally put into the distribution.

 

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
NOTE -- here is what line 262 in checkout_process.php looks like:

 

    echo  'This is the email text after the "include":<br>' . $products_ordered . '<br>';

Looks like some debug code to me. 

 

Is that supposed to be there ??

 

Thx.

Jim is right, I accidently left that in, it was my debugging code. Simply remove it and all should be fine. I will be sure to remove all such code from the final release, need to do a lot of cleaning up. Sorry about that 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: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites
Jim is right, I accidently left that in, it was my debugging code. Simply remove it and all should be fine. I will be sure to remove all such code from the final release, need to do a lot of cleaning up. Sorry about that all, Craig :)

 

 

OK.. great.

 

Now that's fixed, but I am not getting any vendor e-mails at all -- only the customer order confirmation e-mail.

 

What am I missing ??

 

Thx again.

Share this post


Link to post
Share on other sites
OK.. great.

 

Now that's fixed, but I am not getting any vendor e-mails at all -- only the customer order confirmation e-mail.

 

What am I missing ??

 

Thx again.

 

 

FYI --- here is the section from checkout_process that refers to vendor e-mails:

 

 

 

if (SELECT_VENDOR_EMAIL_OPTION == 'true') {

$order_id = $insert_id;

require(DIR_WS_INCLUDES . 'vendor_order_data.php');

 

// require(DIR_WS_INCLUDES . 'vendor_order_info.php');

 

}

 

 

NOTE in this file the commented line -- is it supposed to be commented out ??

 

Thx.

Share this post


Link to post
Share on other sites
FYI ---  here is the section from checkout_process that refers to vendor e-mails:

    if (SELECT_VENDOR_EMAIL_OPTION == 'true') {

  $order_id = $insert_id;

      require(DIR_WS_INCLUDES . 'vendor_order_data.php');

 

              // require(DIR_WS_INCLUDES . 'vendor_order_info.php');

 

  }

NOTE  in this file the commented line -- is it supposed to be commented out ??

 

Thx.

 

 

Maybe a better question to ask is - which file has the code that actually sends the e-mail to the vendor ?

 

Thx again.

Jeff.

Share this post


Link to post
Share on other sites

I believe that the email string is built in includes/vendor_order_data.php, and the email is actually sent from checkout_process.php. You'll probably have to follow it through both files to find out where it's going wrong.

 

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,

 

Yea I was having problems also but thought I just didn't have the proper "UPS Pickup Method" set properly.

 

I made the corrections to the ups mod from your earlier post and seems to be getting the proper shipping amounts now. :thumbsup:

 

But now I've noticed something else, 1 vendor I use has a 1.99 Handling Fee, so I set the fee in admin under the proper vendor in ups, but it's not applying the fee durning the checkout process. :(

 

Regards,

James

Share this post


Link to post
Share on other sites

The UPS module gets the handling charges for the vendor in this code:

      $vendors_data_query = tep_db_query("select handling_charge, 
                                                handling_per_box, 
                                                vendors_zipcode 
                                         from " . TABLE_VENDORS . " 
                                         where vendors_id = '" . (int)$vendors_id . "'"
                                       );
     $vendors_data = tep_db_fetch_array($vendors_data_query);

and then applies them a bit further down:

        $handling_charge = $vendors_data['handling_charge'];
       $handling_per_box = $vendors_data['handling_per_box'];
       if ($handling_charge > $handling_per_box*$shipping_num_boxes) {
         $handling = $handling_charge;
       } else {
         $handling = $handling_per_box*$shipping_num_boxes;
       }

and adds them into the total cost here:

          $methods[] = array('id' => $type,
                            'title' => $this->types[$type],
                            'cost' => ($cost * $shipping_num_boxes) + $handling);

If you put a few Print statements in there, you should be able to track the values and see where it's getting lost.

 

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,

 

I figured it out... lol... If you set the fee in the "Vendor Admin" It works great! I guess it's just a little confusing for the "Handling Fee" being in the ups module as well.

 

Maybe a good idea to remove the printed section "Handling Fee" Option in the ups mod so others won't get confused.

 

I looked but couln't figure how to remove it.

 

Regards,

James

Share this post


Link to post
Share on other sites

Hey Jim,

 

Forget my previous post, I have now found out in order to set the "Handling Fee" I must set it in both the "Vendor Admin" and also in the "UPS" mod as well. :'( Sorry for the Brain Fart!

 

Thanks,

James

Share this post


Link to post
Share on other sites
OK.. great.

 

Now that's fixed, but I am not getting any vendor e-mails at all -- only the customer order confirmation e-mail.

 

What am I missing ??

 

Thx again.

The Vendor email code is in admin/orders.php. And to start with the easy part, did you enable "send vendor emails" from the main Vendor page? If so, the next thing to check is the order status. This implementation sends the email to the Vendor when the order is updated to "processing" or what is status id number 2 in the db. If you look through the "admin/orders.php" file you will see the bulk of the code for the email at the top portion of the file, and then a little lowere, the "check status" block. This will be updated in future releases to be able to select which status to send the email, and to bypass this as well since many of the newer payment modules don't call the this page to update the status which prevents the check from running. You can see the thread on Vendors Auto Email for more on the email portion, instructions on using the email portion will also be included in the next release. There is a workaround posted there as well, if your status does not get updated from the "admin/orders.php" file. You can also download the Vendor email contrib to read the instructions and get specific instrucions on that part, a link to it is in my signature. Good luck and enjoy! Craig :)


Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

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

Multi Vendor Shipping V1.1 Demo Admin

login: webmaster@blucollarsales.com

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Share this post


Link to post
Share on other sites

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

×