21 replies [Last post]
JAScarb's picture
Offline
Joined: 03/08/2010
Juice: 31
Was this information Helpful?

Hi

Quick question, wondering if anyone can point me to a relevant resource. First time Ubercart setup.

If my client uses multiple drop shipping companies, how do I set that up so that in an order containing multiple items each drop shipper gets their part of the order?

Cheers
J

Uberchic's picture
Offline
Administrator
Joined: 08/29/2008
Juice: 754
Re: Multiple drop shippers

My first impulse would be to try and use Conditional Actions, but I think that's going to take a bit of work to set up, but I'm not sure how else you'd accomplish that.

JAScarb's picture
Offline
Joined: 03/08/2010
Juice: 31
Re: Re: Multiple drop shippers

Thanks, OK, so I'm guessing I'll need to set a supplier for each product which doesn't get displayed so that later I can implement a conditional action.

Does Ubercart place orders with drop shippers anyway, or is that left as a manual task?

J

Uberchic's picture
Offline
Administrator
Joined: 08/29/2008
Juice: 754
Re: Re: Re: Multiple drop shippers

Ubercart uses conditional actions to send emails, print invoices, configure specific shipping rules, etc. So, as far as sending orders somewhere, you can configure conditional actions to send the order emails wherever you want.

Or, are you talking about integrating with a drop shipper's order api? That would probably take a custom module.

JAScarb's picture
Offline
Joined: 03/08/2010
Juice: 31
Re: Re: Re: Re: Multiple drop shippers

Thanks, that helps. I was just wondering aloud .. whether it turns out to be an email or an API call, before I start throwing loads of products into the database I ought to set up a 'supplier' field for each of my products so that later any conditional action would know which drop shipper to choose.

Thanks for your help, I think I'm happy for now Smiling

Cheers
J

kennyb's picture
Offline
Joined: 03/11/2010
Juice: 14
Re: Re: Re: Re: Re: Multiple drop shippers

I'm just starting setting up ubercart for drop shipping purposes too. I want to be able to have the order emailed on to the appropriate supplier whenever an order is made (so that they can then package and ship that order to the customer). As you say, looks like a 'supplier' field will be needed for each product along with some conditional logic attached to the order being placed.

Anyway, be great if you can let me know what you do and how you get on with it!

Cheers.

JAScarb's picture
Offline
Joined: 03/08/2010
Juice: 31
Re: Re: Re: Re: Re: Re: Multiple drop shippers

So .. adding a custom field means using the CCK to add an additional field to the product node type by the sounds of it .. will post progress.

kennyb's picture
Offline
Joined: 03/11/2010
Juice: 14
Re: Re: Re: Re: Re: Re: Re: Multiple drop shippers

Just wondering whether we're re-inventing the wheel here...
http://drupal.org/project/uc_manufacturer
http://www.ubercart.org/docs/user/304/manufacturer_settings
Though the above are for Drupal 5 - I'm on Drupal 6 / Ubercart 2

Actually finding hard to believe there aren't lots of ubercart users out there doing this already - would be good to hear from them...

JAScarb's picture
Offline
Joined: 03/08/2010
Juice: 31
Re: Re: Re: Re: Re: Re: Re: Re: Multiple drop shippers

OK, I put in a request to see if Ubercart Manufacturer is being developed for Ubercart 2.2

It's probably a really simple thing to implement, we probably don't need a module, I haven't got my head around it yet.

rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Re: Multiple drop shippers

Since Ubercart 2 was released some time ago I've been very interested in the documentation for being able to split up admin emails to send to their respected manufacture or drop shipper with ONLY their items attached. If Ubercart could do this that would be the Amazon type fulfillment I'm looking for. I wonder if http://drupal.org/project/ubercart_marketplace does this already?

For example:

Product 1 is from Manufacturer A
Product 2 is from Manufacturer B

If a customer purchased both products in the same order the items in the emails would be split up and sent to their manufacturer with ONLY their items. I'm not really interested or relying on splitting shipping costs per product at this point so to get it to work with 1 shipping cost would be better then nothing.

Any direction?

kennyb's picture
Offline
Joined: 03/11/2010
Juice: 14
Re: Re: Multiple drop shippers

earlier I asked Turgrid of UC Marketplace fame:
"
I'm in the process of setting up an ubercart online shop where the products will all be drop shipped by various different distributors / suppliers. That is, once someone buys something from the site and I've taken payment I want the order for the product to get emailed across to the correct supplier. The supplier will then package and ship that product direct to the customer.

If the customer buys multiple products, I need an email to go to each of the suppliers for those products.

My question is this - is there support for this in ubercart or in ubercart marketplace already? I'm using drupal 6 / ubercart 2 just now...
"

To which I was informed: "Ubercart Marketplace supports exactly what it sounds like you are interested in."

I'm looking into marketplace at the moment - my concern is it seems mainly geared towards multiple sellers rather than a single seller using multiple suppliers.

JAScarb's picture
Offline
Joined: 03/08/2010
Juice: 31
Re: Re: Re: Multiple drop shippers

Bit scared of that. Lots of changes to enable multiple sellers (which we don't need, and which will add-in dependence on maintenance of that code in the future and so increased upgrade difficulties) to provide us multiple drop-shipping capability which isn't the key point of that module.

I kinda just want to tag products with a manufacturers code and then have a conditional action. Doesn't seem like it'll be too hard to code.

Remember I said that and be sure to hit me with it later.

J

kennyb's picture
Offline
Joined: 03/11/2010
Juice: 14
Re: Re: Re: Re: Multiple drop shippers

I tried installing ubercart marketplace to see whether it would work for me and after playing about with it for a while decided it wasn't the right route. Fundamentally its aimed at 'marketplace' features and multiple sellers rather than single seller with multiple suppliers sending products out to customers.

Where I'm at now is:
I've added two new content types - Supplier and Manufacturer. The Supplier type has two extra field at the moment - email address and contact name.
I've added two cck fields to the Product content type and made them node reference cck fields - one links to a Supplier, the other links to a Manufacturer.

So each Product is now linked to a Supplier - ultimately I'm hoping I can attach some custom code to a conditional action that will forward an order instruction on to the appropriate supplier. Any help with the custom code greatly appreciated!

kennyb's picture
Offline
Joined: 03/11/2010
Juice: 14
Rough Solution for Ubercart Drop Shipping

So, I have a rough solution to this (on Drupal 6 / ubercart 2):

What it does: allows products to be associated with various different suppliers and for those suppliers to be sent order notifications and packing slips when an order is made. Each supplier is only notified of the products which they supply.

- I've created a new content type Supplier with 2 main fields - email and contact_name
- I've added a cck node reference field called field_supplier to the Product content type and made it a required field linked to a node of type supplier
so each product is associated with a Supplier using a cck node reference field

Then I've added a conditional action predicate called "Email order to supplier on full payment"
Trigger is "order receives a payment"
The condition is to check the order balance is zero
The action is the custom code in the file attached which needs to be pasted into the action. I'm well aware is probably a bit of a hack, but I haven't time for anything other than 'get it working'! The custom code creates a packing slip containing the products in the order belonging to each supplier, then emails each supplier involved in the order. The templates for the email and the packing slip are attached. Note that you'll need to create the packing slip directory somewhere and make sure the path to it is right (search for "file_put_contents" in the custom code file). Think I also needed to make this directory writeable by the apache user.
The supplierNotification and supplierPackingSlip template files need to be put in the ubercart/uc_order/templates directory and you'll have to get rid of the _txt extensions - the file extensions should be .itpl.php

I'd love to see this form the basis for an ubercart dropship module but haven't the time to do it myself just now. Hope this helps some folk though...

AttachmentSize
supplierNotification.itpl_.php_.txt 1 KB
supplierPackingSlip.itpl_.php_.txt 4.98 KB
customCode.txt 3.8 KB
rennsix's picture
Offline
Uber Donor
Joined: 09/11/2008
Juice: 89
Re: Rough Solution for Ubercart Drop Shipping

Thanks Kennyb! I've followed your guide and can say I have had great success Smiling

Because I feel documentation is important, I've cleared up a few of your steps.

View attachment. I'm open to modifications so we can make this as clear as possible for the whole community.

Thanks,
Colin

AttachmentSize
uc_dropship_drupal6_uc2_2.pdf 1.47 MB
kennyb's picture
Offline
Joined: 03/11/2010
Juice: 14
Nice! Just a couple of notes

Nice!

Just a couple of notes after reading through your doc:
- my shop/packingSlips directory is owned by user apache and has permission 755 (this does work for me and its a bit scary giving it 777). No doubt there is a nicer way of doing this part and I'm sure hardcoding the full path in the code is bad practice, so apologies!
- the trigger I use for my conditional action is 'A Payment gets entered for an order' - the last thing I want is to send the email to the supplier asking them to send products out before I have received payment in full for the order. I've given it the class 'notification'.

Doc looks good though. No doubt someone well versed in drupal module development would be able to create something packaging all this up pretty easily.

carbonunity's picture
Offline
Joined: 01/23/2010
Juice: 8
Thanks for the Multiple Drop-Shippers setup instructions!

rennsix:

Thanks for the documentation! This is really great stuff guys.. the source code, notification script, supplier packing slip script, and complete instructions/directions on how to set it all up. You just can't beat it. Thanks for contributing!

Best regards,

carbonunity's picture
Offline
Joined: 01/23/2010
Juice: 8
Thanks for posting the solution for Multiple Drop-Shippers

Kennyb:

Thank you for posting your code and notifications. You've saved us a lot of time to figure this all out. Will post our results shortly. Thanks once again!

Best regards,

iamweird's picture
Offline
Joined: 07/24/2011
Juice: 3
Thanks a lot kennyb. Have to

Thanks a lot kennyb. Have to notice, you should use

<?php
$sent
= drupal_mail('uc_dropship', 'supplier_email', $supplier->field_email[0]['email'], $language, $settings, $from, TRUE);
?>

on line 38 instead of

<?php
$sent
= drupal_mail('uc_dropship', 'supplier_email', $supplier->field_email[0]['value'], $language, $settings, $from, TRUE);
?>

if you use Email CCK field in your Supplier content type instead of generic plain text field.

bancarddata's picture
Offline
Joined: 07/08/2011
Juice: 36
Re: Thanks a lot kennyb. Have to

Has anyone tried this on Drupal 7 / UC3 Beta?

timmay2's picture
Offline
Joined: 03/22/2012
Juice: 3
Solution for Drupal 7 Multiple Dropshippers

Has anyone successfully done this on Drupal 7? I have done it in Drupal 6 but Drupal 7 is giving me errors. I think it's with the custom php code. Anyone?

matteoraggi's picture
Offline
Joined: 09/10/2008
Juice: 267
Re: Solution for Drupal 7 Multiple Dropshippers

I am interested about dop ship on ubercart 3, drupal 7 too.