Ubercart Marketplace - Multiple Seller Support

Posts: 39
Joined: 03/05/2008

There has been many requests for marketplace type features. People have requested features such as multiple seller management. I had need for the same and have developed a working group of modules under the working title of Ubercart Marketplace.

Overview of the Five Current Ubercart Marketplace Modules:

  1. mp_products:
    • Adds "selling" tab to user accounts with certain permissions.
    • Adds a table of products created by seller.
    • Includes sample concept of edits to product node edit form appropriate for a marketplace seller. For example, it removes form elements sellers may find unnecessary and cryptic.
    • This module also sets up the "cost" price field to be used as the commission field and is calculated based on a set commission rate. These options are configurable under "Seller settings" in Ubercart configuration.
  2. mp_orders:
    • Adds "fulfill orders" tab to "selling" section of user accounts.
    • Adds a table of orders containing products created by seller. This module handles "dividing" up orders at checkout, so each seller only can fulfill and view the portion of a customer's order that contains the seller's products.
    • Handles seller order statuses, moving their "portion" of the order to complete when order is fulfilled.
    • Automatically completes orders when orders are nonshippable.
  3. mp_shipping:
    • Mimics functionality of uc_shipping, but allows sellers to only fulfill and ship the portion of a customer's order containing the seller's goods.
    • Adds in a packing slip feature that allows sellers to print a packing slip containing only the content of the specified package. This is for drop shipping support.
    • Adds a workflow-ng configuration that moves the whole customer order to completed when all sellers' order statuses for an order are complete.
    • This module currently only supports the "manual shipping" option (e.g. live quotes from ups and usps are not yet supported). However, this works well with the contributed order tracking module because sellers can select a carrier and tracking number for their packages that can then be tracked by the customer.
  4. mp_reports:
    • Adds reports to sellers' pages under their account. Seller reports included are: product sales, sales summary, and sales per year/month.
    • Seller reports only show the seller's products and sales and the commission they will be paid.
    • Seller reports only report sales that are from orders that the seller has completed. The seller will not get paid until they either ship the order, or the order is all nonshippable, in which case it will automatically be promoted to complete.
    • mp_reports adds two admin reports to the current uc_reports module. The first one is a seller order statuses report that lists the orders by seller that have not been completed so the store administrator can look out for slow sellers. The second lists the commission that the sellers should be paid. This is calculated from the "cost" price field mentioned above. This table is powerful in that it allows you to select the date range in which to show orders so you can pay sellers in whatever periods you wish. This report also supports exporting to a Paypal Mass Payments formatted txt file. Currently this is the envisioned method of seller payment.
  5. mp_notify:
    • This simple module allows sellers to be notified when they have an order.
    • Options for this module are configurable under "seller" tab of notification settings area in Ubercart configuration.

Concept:
Basically, this group of modules leverages current Ubercart core functionality, while limiting access so sellers can only deal with their orders and products. All seller functions are under a new "selling" tab of their user account page (user/x/selling). Seller order statuses have been created to allow management of payment--the idea is that only sellers' orders which are complete will show up in seller payment reports. This forces sellers to fulfill their orders if they want to be paid. Nonshippable orders are automatically promoted. The commission to be paid to the sellers is based on the preexisting "cost" field of the product node. This is the actual value a seller will be paid. The only method currently supported (aside from manual) to pay sellers is with the created Paypal Mass Payments file.

Usage Ideas:
Ubercart marketplace would work well with moderation modules (look on drupal.org), so sellers can not directly list products. A set of profile modules and a taxonomy setup may also be appropriate to allow sellers their own "about me" page and a view of all products by a certain seller. See how to setup roles/permissions under "Installation."

Wishlist:
Some of these features may be coming in the future. Feature requests are welcome, also.

  • "Glue" module for handling seller taxonomy and seller profiles. Think similar features to uc_manufacturers.
  • Better support for shipping fulfillment. Allow sellers to create their own accounts with shipping companies, so printing shipping labels (etc) is possible for each seller.
  • Quick menu for seller functions
  • Report graphs
  • Handle file downloads (feature for products) more intuitively due to lack of nonadmin support for product features - Added in BETA1!
  • Support for more seller payment methods, such as pay with check. Also allow sellers to choose method and/or select email address of their Paypal account. - Added in BETA2!

Installation:
See the README included in the attached .zip for additional details. Requires a small uc_shipping patch as well as a template file to be moved to the uc_orders template folder (included). To realize functionality, create a new role (and some users) and give this "seller" role the access permissions of the ubercart marketplace modules (view own reports, ship own products, etc.). Also give "seller" other permissions appropriate (such as edit own products, create products, etc. from Ubercart core).

IMPORTANT Notes:
It is important to keep in mind that this is a developer preview. Consider this BETA at best. Many Ubercart core module functions had to be ruthlessly overridden due to lack of fine-grained access control in Ubercart. I tried to alter (with hooks) what I could and the rest had to be overridden. Some of my database queries also got messy due to pulling information from many tables not set up for fine-grained seller access. If you can find a simpler way to do certain functions of Ubercart Marketplace, please help support it. I also have not gotten around to doing my own cleaning and full commenting of the code. Updates will be posted here when available. I tested these extensively, but there may still be plenty of bugs. I encourage all support, feature requests (although I am limited in time), and ideas. Also note, these modules may not satisfy everyone. I tried to make them suitable for a range of purposes, but they may not fit everyone's specific needs. Once this group of modules gets a little more underway, I will set up the appropriate projects and issue queues. Post with your thoughts.

Edit: To download, please check out the project page at drupal.org: http://drupal.org/project/ubercart_marketplace
Edit 2: Documentation: http://drupal.org/node/326102

Posts: 6997
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Don't have time to review this personally, but I will share a quick thought... unbelievable! Cool I'm highly impressed and wish you the best of luck on this project. Lots of folks have asked about just this sort of functionality, and it sounds like you've done quite a comprehensive job. I would encourage you to make a separate post that catalogs as much of the shortcomings in the core access control as possible so we can improve this in D6 and beyond. That would rock!

Posts: 1730
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Absolutely amazing. I will review this in the coming week - since this sounds almost exactly how we're going to need our "Customer Products" setup. I'll be sure to give feedback and code contributions whenever I can Smiling

--

Wanna help send me to DrupalCon Paris? Or do you just like my work? Donate via PayPal!

Posts: 6997
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

On that note... I'd recommend making this a project on Drupal.org ASAP so folks can more effectively give you feedback. Laughing out loud A project the size will quickly become unwieldy in a single forum thread. You can also make a contrib page here that links directly to your project page on Drupal.org so folks can find the project easier.

Posts: 39
Joined: 03/05/2008

Thanks for the support guys! I will make this a Drupal.org project within a few days.

I will also, as Ryan suggested, make sure I document ideas regarding the next version of Ubercart. As I look back over my code, I will write down the various access permissions and hooks I'd like to see in the future.

Posts: 39
Joined: 03/05/2008

Ubercart Marketplace is now a project at drupal.org.

Please check it out there for the latest code and to report bug reports or feature requests:
http://drupal.org/project/ubercart_marketplace

Posts: 2
Joined: 08/03/2008

Hello,
Thank you very much for your module!
Tell me, please, how to disable "Seller commission". I have independent sellers on my site and I don't need this option.
Thank you.

Posts: 39
Joined: 03/05/2008

While there is no direct way to remove it, you can choose a configuration like the following to get the same result.

Turn on "Automatically calculate commission" at admin/store/settings/seller. Also, set the Default Commission Rate to 1. This will in effect make the amount the seller should be paid equal to the sell price. This will hide the seller commission field and fill it with an appropriate amount.

Posts: 15
Joined: 10/15/2008

I really do appreciate the work you guys doing.. its priceless ! both ubercart and the market place modules are one of its kind. sorry if i sound offensive but this is what has wasted my 48 hours. just because the proper documentation wasn't available.. infact this issue dont even need a very sophisticated .doc file..

Quote:

-Make necessary backups.
-Extract Ubercart Marketplace in your sites/all/modules folder in Drupal directory.
-Place packingslip.itpl in sites/all/modules/ubercart/uc_order/templates directory.
-Patch uc_shipping module using included (non contextual) patch or adding the following two lines manually:
~line 1225 (last line of uc_shipping_package_save()): module_invoke_all('package', 'save', $package->package_id);
~line 1235 (last line of uc_shipping_package_delete()): module_invoke_all('package', 'delete', $package_id);

points 1 and 2 are absolutely clear.. the line 1225 of uc_shipping module is

Quote:

if (count($types)) {

and is no way the 'last line of uc_shipping_package_save().. the last line of the particular function is at 1229.. which states '}'

same is the case with the uc_shipping_package_delete().. if you wouldve spent just a lil 2..3 minutes more on this wonderful module you developed.. there will not be much difficulty to noobs like me. I dont know where to insert the two lines so i downloaded cygwin to patch it.. but the patch file you provided isnt working and it says.. missing header for unified diff at line 1.

please dont make web developers suicide on such minor issues.. ;(

Posts: 39
Joined: 03/05/2008

I apologize for your troubles. Unfortunately, I have not found time to write better documentation and Marketplace is still currently in BETA (although stable) state and therefore geared towards developers.

Depending on your editor, your line numbers may differ (that is why I wrote ~ approximate symbol by them).

At the very end of this function:

/**
* Save a package.
*/
function uc_shipping_package_save($package) {

place module_invoke_all('package', 'save', $package->package_id);

like so

    db_query("UPDATE {uc_packages} SET ". implode(',', $types) ." WHERE package_id = %d", $values);
  }
  module_invoke_all('package', 'save', $package->package_id);
}

Do similar for uc_shipping_package_delete() in uc_shipping.module

/**
* Delete a package.
*/
function uc_shipping_package_delete($package_id) {
  db_query("DELETE FROM {uc_packages} WHERE package_id = %d", $package_id);
  db_query("DELETE FROM {uc_packaged_products} WHERE package_id = %d", $package_id);
  drupal_set_message(t('Package @id has been deleted.', array('@id' => $package_id)));
  module_invoke_all('package', 'delete', $package_id);
}
Posts: 15
Joined: 10/15/2008

copy/paste this to readme file.. I was using zend studio which is pretty much the standard for php. Anyways I find open source projects like these provide far better support as compared to the one i pay $5000. as i said this is priceless ! Thanks once again.

Posts: 13
Joined: 10/11/2008

I didnt notice it before. But I tried to create the home page link as user/% so users would be directed to there own profile.
But insted i get sent to this random page with files and orders headers tabs. nothing else on the page except user profile.
Anyone else got anything like this.

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

This is exactly what I am looking to do with an upcoming project. Thank you for your hard work. Should I decide to take it, expect some patches/bug fixes in the next coming month or two.

Thanks again,
Jordan

Posts: 39
Joined: 03/05/2008

Thanks Jordan. I am always looking for community input and modifications to improve Marketplace. I look forward to seeing what you accomplish.

Posts: 15
Joined: 10/15/2008

I tell you what.. this module makes ubercart exceptional.. love the developers of marketplace Eye-wink

Is there any work around so that sellers can change stock, threshold of their products?

edit.. i found this --> http://drupal.org/node/279611 and it was really helpful..

Posts: 39
Joined: 03/05/2008

Thank you for your compliments of Marketplace. I worked hard to bring such power to the already great Ubercart. The patch you found for Ubercart should help you out. Good luck.

Posts: 6
Joined: 10/29/2008

hey, first of all, thanks for making an excellent module. I am using it right now for a client. I was just wondering if you were planning on updating this for drupal 6 and also...on the Tazetta site. I'm trying to figure out how to grab the "my products" view for user profiles (I am also using bio, panles, adv prof kit) and if it's possible to include the image of the product as well?

Thanks again.

Posts: 39
Joined: 03/05/2008

If I remember, that is a simple view with an argument to check the uid of the user's profile from url. Being a view, you could add a product image and in fact that's not a bad idea.

Marketplace will be updated to D6. When? I am not sure when I will get time at the moment. I am open to assistance.

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

So far my experience with marketplace has been great. I've installed it, configured it a little and setup the structure of most of my website. So far so good.

I found a small issue on a server I installed it on which has PHP warnings enabled.

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of module_invoke_all(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /home/eocean/dev/htdocs/sites/all/modules/ubercart_marketplace/mp_products/mp_products.module on line 219

Here's line 219

<?php
       
// invoke hook_list_product()
       
module_invoke_all('list_product', &$node);
?>

I believe it should be changed to

<?php
       
// invoke hook_list_product()
       
module_invoke_all('list_product', $node);
?>

This removes the pass by reference. I grepped all of market place's and ubercart's code to see if anything uses this list_product hook, but nothing turned up. Reason I'm posting this here is because I'm unsure if there's an intensional reason for doing this that I'm un-aware of....if not, it's a quick fix to resolve the warning.

Look forward to digging harder into it next week as I start to theme my site.

Thanks again,
Jordan

Posts: 39
Joined: 03/05/2008

Thanks. I actually just committed such a fix a day ago to BETA5 (along with a few other minor fixes). The hook is a new one provided by Marketplace for a potential use by modules extending its functionality.

Posts: 1730
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Turgrid,

Thought I'd let you know that rifftrax.com now uses Marketplace. When you create an account you are given an option to signup for "iriffs" which is our customer riffing feature. From there you can create products and so far it's working pretty well Smiling You can see the ones that people have created at www.rifftrax.com/iriffs

Also, I wanted to say that my "find" from a couple weeks ago was wrong. Right now the SQL queries are looking for all nodes of type 'product' when that doesn't allow for Product Classes. Classes is actually where Marketplace can shine, because it allows you to keep separate your official, main site-based releases from the customer products.

For instance our nodes for customer products are "iriff" node types as opposed to the usual Ubercart "product" node type. So if you can find a way in there to get the module working with products and product classes I think it'll be huge.

Feel free to check out the site, and sign up for iRiffs, and let me know what you think.

--

Wanna help send me to DrupalCon Paris? Or do you just like my work? Donate via PayPal!

Posts: 39
Joined: 03/05/2008

I noticed that Rifftrax was updated. Nice new look! I will sign up and check it out in more depth and share my feedback. I can't wait.

I believe I caught the error when I did the very recent update to BETA5 (which fixes a few of the other bugs floating around too). The query in discussion should check if the node type is in the array of product classes and not just product.

Thanks.

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

I'm working on little patch to allow the sellers to each keep their own "Origin" shipping sources saved. It requires another database table unfortunately (essentially the same as uc_orders).

I'll polish it up and submit tomorrow hopefully once I get the bugs worked out.

This will allow for each user to keep a list of "product origins" each time they ship an item out and use a new address.

Posts: 10
Joined: 10/29/2008

Marketplace is amazing. Thank you so much for it!

As I less-than-impressively revealed in another thread, I'm having trouble getting it to work with Product Kits.

If I try creating a Product Kit, I get a "Commission must be greater than zero." error - unless I have a sitewide base price set, then I get a "Sell price must be greater than or equal to sitewide base price of $XXX".

Should it work, and I have it misconfigured?
or
Is it not yet compatible with Product Kits?

Thanks!

Posts: 1
Joined: 11/15/2008
danroth wrote:

Marketplace is amazing.

Thanks!

yes thanks its beautiful!

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

I'm getting to the point where i need to deal with where the hell are my products going to ship from problem.

My marketplace project has Sellers & Manufacturers. Each Seller has it's own set of Manufacturers and I was doing this with a custom CCK type and node reference. Created a view for my node-reference, to only display the manufacturers for the current seller. Worked great, but doesn't help me with the where to ship from issue. My client requires I display where the product is shipping from and the shipping options directly on the product page....so I did some diggin' around.

Core-Ubercart uc_quote provides some hooks into a contrib module called uc_manufacturer to allow each product to ship directly from a particular manufacturer. Perfect!

Ubercart product page says this:

When delivering products to customers, the original location of the product must be known in order to accurately quote the shipping cost and set up a delivery. This form provides the default location for products, either individually or an entire manufacturer's line. If a product's individual pickup address is blank, Übercart looks for the manufacturer's. If that is also blank, it uses the store's default pickup address, which can be set here.

I ended up finding the http://drupal.org/project/uc_manufacturer project, which I had no idea existed.

Now the problem with uc_manufacturers is it doesn't use CCK node types for these manufacturers out of the box, although the developer of the module suggest for more advanced users, they might want to do this.

I've put most of my thought on what to do about this issue in this feature request for uc_manufacturers. I simply want to make both projects aware of each other.

http://www.ubercart.org/issue/7617/uc_manufacturers

I feel the integration of Marketplace with a slightly more robust implementation uc_manufacturers would make for a great implementation into Ubercart 3.x and would almost fully complete the multi-seller environment.

Discuss Laughing out loud

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

I think one of the first steps to dealing with this issue is standardizing what "Shipping From" information is stored. uc_quote uses two tables, uc_quote_product_locations, uc_quote_manufacturer_locations...i'm going to create uc_quote_seller_locations and work from there.

ATTN: Ryan.

Did uc_manufacturers used to be in core? Seems like uc_quote is in love with it.

Posts: 6997
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.
j0rd wrote:

ATTN: Ryan.

Did uc_manufacturers used to be in core? Seems like uc_quote is in love with it.

I'll redirect you to Lyle for the full answer, but the short answer is yes. Sticking out tongue

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

Short answer is enough Laughing out loud Explains everything.

Posts: 6
Joined: 10/29/2008

Turgrid, I noticed on tazetta you have done EXACTLY...and I mean almost exactly what I need.

http://www.tazetta.com/taxonomy/term/12/2/1/0

You have the sort by desinger and sort by price high to low, etc...

I have custom views set up for my project...so using table view for sort is out.

It looks like you managed to expose sort criteria (views 1.x only allows exposed filters)

Exposed sort criteria is exactly what I'm looking to do. I was wondering how you went about that. Thanks!

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

I need exposed sort too! I can't believe views doesn't easily support sorting. I was neglecting that features until I finished most everything up, then was going to get back to it.

Any tips/pointers/snippets would be appreciated.

Posts: 39
Joined: 03/05/2008

I was going to use Views until I realized the limitation. What you are seeing for the taxonomy pages is custom sql I wrote for the purpose that makes use of the arguments passed by the url (which come from the Drupal form with sort methods). I don't see any other way to do it efficiently. I can dig up some of my snippets, but I have provided the general outline of how to do it. Let me know if you have troubles at a point and I will try to provide an example.

Posts: 6
Joined: 10/29/2008
Turgrid wrote:

I was going to use Views until I realized the limitation. What you are seeing for the taxonomy pages is custom sql I wrote for the purpose that makes use of the arguments passed by the url (which come from the Drupal form with sort methods). I don't see any other way to do it efficiently. I can dig up some of my snippets, but I have provided the general outline of how to do it. Let me know if you have troubles at a point and I will try to provide an example.

thanks for the response, turgrid. For me, checking out a snippet would be great. If you could dig one up for an example to go by...that would be really helpful.

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

As far as I can tell from a quick venture into views-2.0, it doesn't support sorting either =(

Supposedly in view-1.0 you can sort when you're using a table output, but I haven't played around with this yet, nor do I want a table output (but I assume you could use a table view and then re-write the output with the theme engine to steal the sorting feature).

Sometimes things in Drupal are too round about though and you need to get "lazy" and do stuff for yourself instead of relying on modules for everything. I think views make me waste more time than they ever save me anyways.

Posts: 5
Joined: 01/30/2009

hi jord, I also need marketplace to save my sellers info. I'm in a rush to get things moving. I only have seller types though and not manufacturers. How is your patch going? Let me know if i can contribute. Thanks

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

@divinevette:

Well...the products your sellers create will be attached to their user accounts. You can use an existing Drupal modules like Node Profile to extend said users "Profile Pages"...then you can link to this new "Profile Page" from the product page.

That should get you moving. Let me know if you have any other questions.

Posts: 5
Joined: 01/30/2009

Thanks j0rd.

I have another question.

On my site, I would like to forgo mediating between byers and sellers and let the buyers pay the sellers directly. but have paypal notify me when payments are made, just for record keeping.

Thanks!

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

@divinevette:

As far as I know, the buyers pay you and you dole out the cash to your vendors. I personally haven't played with this all that much, so I'm not 100% sure how it all works. Someone else can probably clarify better than I can, but I think you're going to have to write something custom for this.

Posts: 18
Joined: 02/16/2009

Hi,
Is there a way to declare seller's address as they will ship the products directly?
thanx

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

I don't believe there is a way to do this. BUT! you can set the shipping address for each individual item.

So what I did was installed uc_addresses and then overwrite the default address (and create a selectable drop down) with the default uc_address for the "seller" of that item.

I don't believe market place can deal with this out of the box.

Posts: 18
Joined: 02/16/2009

thank you for your answer j0rd,

I' m new in Drupal so could you detail the process?

Quote:

overwrite the default address (and create a selectable drop down) with the default uc_address for the "seller" of that item.

I already installed uc_adresses and create default address for each seller but do not figure how to connect them to shipping.

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

This is more of an advanced topic, but I'll give you the overview. It's going to require for you to do some custom programming and reading some documentation.

uc_addresses allows you to associate multiple addresses with any particular user. Sellers in uc_marketplace are "users", so we can use uc_addresses to store multiple addresses for your sellers.

When you create a product in Ubercart there's an area which allows you to enter a different address where that item will ship from instead of your stores default shipping address. I personally only pull in their default address from uc_addresses.

What I've done, is use hook_form_alter (see drupal api docs) to modify the product add/edit form (form_id product_node_form) to include the additional addresses associated with the user from uc_addresses into the shipping addresses drop down.

Here's the snippet

<?php
function mymodule_form_alter($form_id, &$form) {
   switch(
$form_id) {
      case
'product_node_form':
        
$node = $form['#node'];
        
$vendor = user_load(array('uid' => $node->uid));
        
//dpm(array("VENDOR" => $vendor));
        
if(empty($node->nid)) {
           
# NEW Product
            //dpm(array("BEFORE" => $form['shipping']['default_address']));
           
$form['shipping']['default_address']['first_name']['#default_value'] = $vendor->default_address->first_name;
           
$form['shipping']['default_address']['last_name']['#default_value'] = $vendor->default_address->last_name;
           
$form['shipping']['default_address']['company']['#default_value'] = $vendor->default_address->company;
           
$form['shipping']['default_address']['street1']['#default_value'] = $vendor->default_address->street1;
           
$form['shipping']['default_address']['street2']['#default_value'] = $vendor->default_address->street2;
           
$form['shipping']['default_address']['city']['#default_value'] = $vendor->default_address->city;
           
$form['shipping']['default_address']['postal_code']['#default_value'] = $vendor->default_address->postal_code;
         }
         else {
           
# Editing a product
        
}
       
        
# I use this to require proper fields get entered, if they want to use a different address
        
foreach(array('first_name', 'last_name', 'phone', 'company', 'street1', 'street2', 'city', 'zone', 'postal_code', 'country') as $field) {
           
$form['shipping']['default_address'][$field]['#required'] = uc_address_field_required($field);
         }     
       }
       default:
        
//dpm(array("FORM_ID"  => $form_id));
        
break;
   }
}
?>

Can't confirm the code will work 100% because it's cut and paste, but should give you a general idea of the direction you should be heading.

Posts: 18
Joined: 02/16/2009

Thank you very much j0rd,
It works like a charm with litte modifications.

Posts: 2
Joined: 02/26/2009

I have setup Ubercart Marketplace to serve different Sellers who reside on my website.

I need help to get the below mentioned scenario working:

Each of the Seller can have their own PayPal account, and when the Buyer purchases any Seller's product and makes payment using PayPal, the amount must directly go to Seller's PayPal account without using the MassPay option.

Please help. Thanks in advance.

Posts: 1730
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Sounds the same as this issue: http://drupal.org/node/314505

--

Wanna help send me to DrupalCon Paris? Or do you just like my work? Donate via PayPal!

Posts: 35
Joined: 12/17/2008

Thank you j0rd for the code.
I got an error message when I enabled the module.

Parse error: syntax error, unexpected T_DEFAULT in /sites/all/modules/myaddress/myaddress.module on line 28.

What's on line 28 is "default:".

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

from a quick glance at the code "case 'product_node_form':" is missing a "break;" and there's one too many closing brackets.

Change

<?php
         
}
       }
       default:
       ...
?>

to

<?php

          }
          break;
        default:
        ...
?>

I apologize for the poor cut & paste.

It also appears that since I'm a slacker I didn't post the rest of the code which populates $vendor->default_address. That's done in hook_user which I'll provide here.

<?php
function mymodule_user($op, &$edit, &$account, $category = NULL) {
  global
$base_url;

   switch($op) {
      case
'load':
         if(
user_access('act as seller', $account)) {
           
$aid = _uc_addresses_get_default_address_id($account->uid);
           
$address = _uc_addresses_db_get_address($account->uid, $aid);
           
$country_data = uc_get_country_data(array('country_id' => $address->country));
            if(
$country_data) {
               foreach(
$country_data as $cd) {
                 
$address->country_iso_code_2 = $cd['country_iso_code_2'];
                 
$address->country_name = $cd['country_name'];
               }
            }
            else {
              
$address->country_name = t('N/A');
            }
           
$account->default_address = $address;
         }
         break;
   }
}
?>

This hook takes the default address from uc_addresses and loads it into $user->default_address for your "act as seller" users. uc_addresses code there is written against the outdated 5.x-2.0 instead of the latest 5.x-2.1 code, but I assume it should still work.

Posts: 35
Joined: 12/17/2008

Thank you for your reply.

I'm still getting the same error at line 29. "default:" is still causing an error.

Is this new code part of the module of the initial code that you posted above or I have to create a new module for it?

Posts: 109
Joined: 07/16/2008
Getting busy with the Ubercode.

Since these are hooks I would recommend creating a new module for them instead of modifying ubercart_marketplace.

As for the default error. It's a simple PHP error probably having to do with too many (or not enough) closing brackets. You should be able to debug that yourself with minimal PHP knowledge.

Posts: 35
Joined: 12/17/2008

Thanks JORd. I already created a seperate module, I was asking if the second code you posted should be added to that same module. I kind of figure that out.

I will look for the missing brackets when I get home tonight. I appreciate the help.

Posts: 5
Joined: 01/30/2009

I have my site set up now where buyers can pay sellers directly and it is working pretty well. One thing I noticed though is that the payment type/amount is not listed in the order info, did I break this functionality, or did it never exist. I can't remember, thanks!

Posts: 1
Joined: 04/07/2009

Is anyone having success with the marketplace module for Ubercart 2x/Drupal 6x?
If so, can you share with us your issues/use-cases?

We are beginning implementation for a multi-seller site and would like to use Drupal 6x but are not sure if the Marketplace module is ready for production yet on that version.

If it's not ready for production, is there someone that wants to pitch in with us to donate some money to get this ready for production in the coming weeks? We would consider joining forces.

Thanks.

Posts: 11
Joined: 10/08/2008

Hi,
First, thank you very much for this amazing module!
I am new in Drupal. Could you say me where can I find a translation (french) for marketplace, or how I could do it myself?
Thanks for your help
Regards,

Posts: 34
Joined: 10/26/2007

Thanks Turgrid for all your hard work!

I am using D6 and am bumping into some things with ubercart_marketplace...

I have a few questions that I haven't found an answer to yet. My apologies if these are lame...

1) How do I set up marketplace to where the site owner keeps the "commission" that is set on admin/store/settings/seller? So if set to 1%, once paypal mass pay is ran, sellers get paid all but 1%.

2) If a buyer wants to buy multiple products from multiple sellers, how does marketplace handle that?

3) I see in D6 marketplace module, seller can add their shipping address. Will this code support uc_addresses too? So when seller is filling out the product node, they will see their address from "user/*/selling/settings" and uc_addresses addresses?

4) Site owner would like to charge a flat fee per sale, instead of a percentage. Any plans to support this option in the near future?

5) For a specific role, no commission will be charged. Seller will be charged a monthly membership fee instead. Is this taken care of through "admin/store/settings/seller/commission"?

Thanks again for your module and continued support.

--

===
Elvis McNeely
Blogging about Drupal: http://www.elvisblogs.org/drupal

Posts: 3
Joined: 05/12/2009

I am beginning a project that is a social network with seller roles. This module seems like the only option for what I'd like to do. In addition to using Drupal 6, I'll also be using the uc_node_access module, since the seller is only selling access to a page that they set up.

I'm very interested in the answers to your questions and the estimated release of the D6 version.

Keep up the good work folks. I'll certainly try to contrib to this project if I have time and can figure things out too.

Thanks!

--

Regards,
Chad Hester