if you use the content profile module to create a profile node for each user on registration, and use it on uc_node_checkout with an ubercart product, you will get an error like "is not a product. Unable to add to cart." when users register (hence their node profile gets created but they dont actually edit it directly)

heres a patch to fix it, there should be more to it because the order listing in the admin shows an empty ID:

# cat uc_node_checkout_uprofile.patch
--- uc_node_checkout.module     2009-08-28 11:32:24.000000000 +0000
+++ uc_node_checkout.module     2009-08-28 12:37:19.000000000 +0000
@@ -546,7 +546,15 @@ function uc_node_checkout_nodeapi(&$node
       if (uc_node_checkout_node_associated($node)) {
         // Load up the corresponding product so we can use the default add to
         // cart quantity.
-        $product = node_load($node->ucnc_product_nid);
+        if ( isset($node->ucnc_product_nid) ) {
+          $product = node_load($node->ucnc_product_nid);
+        } else {
+          $nc_map = uc_node_checkout_product_map($node->type) ;
+          if ($nc_map['nid'] && !$nc_map['view']) {
+            $product_nid = $nc_map['nid'] ;
+            $product = node_load($product_nid) ;
+          }
+        }

         // Make sure we add at least 1 to the cart.
         if (empty($product->default_qty)) {

ucnc_product_nid gets added on node edit form, which never happens when the node profile gets automatically created
why is it added like that? i think the user could modify it to some arbitrary value (hidden doesnt mean safe), would it work to just replace the "if" with the "else" in all cases or any logic not to do it?

Comments

robby.smith’s picture

Status: Needs review » Reviewed & tested by the community

tested. thanks!

lameei’s picture

I'm trying to create a membership site using ubercart+content profile + uc node checkout. The users should be able to create a profile by buying the membership. I've created a product which is connected to content profile using node checkout so the user when tries to buy this product the profile form appears so the buyer should fill it. after filling the form and clicking on submit the checkout form appears. the problem is that when the user logs in, the profile form is empty and there is an add to cart bottom under the form. the profile user filled during the purchase is created as a separate content which is of "profile" content type.

Am i missing something or this is not possible?

hixster’s picture

subscribing, bumping, interested in a solution too :-)

hixster’s picture

@lameei - it seems that the content profile isn't created until after the user has completed checkout - so the content profile node used with node checkout gets orphaned, there is then a brand new , empty content profile that is associated with the user account.
It seems that for the moment, it's not possible to use a content profile node successfully with uc node checkout.
One possible solution maybe to use a node that 'gathers' profile information prior to check out - this node that gathered the information is then used to fill in the information of a content profile after checkout and payment is complete.

aidanlis’s picture

Status: Reviewed & tested by the community » Needs review

This is not RTBC, the patch needs more work and direction from a core dev.

gennadiy’s picture

@hixster
This should be possible somehow:
1) uc_checkout creates user (uid);
2) autologin user with sending him/her to the /user/uid/edit/profile with some of the fields populated from uc_checkout to edit/add required and optional info.

or this, with just few modifications of the code (shouldn't be hard for someone who knows uc_checkout):
1) get nid for the profile created - the content profile node used with node checkout;
2) get uid of the user created after payment was successful;
3) and at the very same point update table node with uid of the created user for nid=nid of the created profile.

Please let me know in case you will get closer to the solution.

gennadiy’s picture

Matt,
I didn't try uc_node_checkout yet. Do you know if there is a way to map address and name fields from content profile to billing info to show just entered values on the checkout form as well?
TIA,
Gennady

hixster’s picture

Hey Gennnadiy - i'm not sure about how to achieve #7 yet, but for #6 and my needs i've been looking at the tutorial posted on this modules home page.
This tutorial http://drupaleasy.com/blogs/ultimike/2009/03/event-registration-ubercart shows how to grab & update fields on the node using conditional actions.

It shouldn't be too hard to achieve what we want, i just haven't had time to sit down and work through this properly.

gennadiy’s picture

Thank you Matt,
The tutorial's Registrant Profile is not the same as a Content Profile node. The other additional thing I was evaluating for the membership it's UC Recurring Payments and Subscriptions module, so will try without it and see if I can make it work.
It's very surprising that there is no tutorial/setup available for the membership website. Ideally it would be membership (Content Profile) form with radio buttons at the very end for one of the membership products available and "continue" button to get to checkout and pay for it with the name and address fields automatically populated from the member's profile.
The other way is also OK: choose one of the membership products, fill out member's profile, checkout and pay for it with the name and address fields automatically populated from the member's profile. And as I understand this is working solution (not for me yet) with only problem - orphaned member's profile, that is fixable with the uid update for the profile in the node table.

hixster’s picture

The tutorial's Registrant Profile is not the same as a Content Profile node.

Yes, for sure, I was just using it for some of the techniques in that tutorial which could be applied to content proflle and working with nodes using CA.

It's very surprising that there is no tutorial/setup available for the membership website. Ideally it would be membership (Content Profile) form with radio buttons at the very end for one of the membership products available and "continue" button to get to checkout and pay for it with the name and address fields automatically populated from the member's profile.

Yes, it's quite amazing that ubercart does not have a simple solution to what seems to be a common eCommerce/Membership workflow which is a shame.
I have spent days researching ways to achieve a good membership workflow, ie: User completes a registration > fills in additional details > then purchases a membership level.

In the process of looking for solutions I did find this -> http://www.moneyscripts.net/drupal-membership-suite, which is a paid module and seems to do nearly everything I would need. I'm just a little hesitant about leaving the tools I know (Ubercart)

gennadiy’s picture

In the process of looking for solutions I did find this -> http://www.moneyscripts.net/drupal-membership-suite.

I found this script few months ago and watched Membership Suite Tutorial Video and decided to try Content Profile + Ubercart modules first and then get back to moneyscripts later if unsuccessful. Now after lots of time spend on research for Content Profile + Ubercart and almost no time left for playing with the stuff, I will try moneyscripts and see if it will do what we need. There is also 15 days full refund policy if you are unable to use the software for your needs. And 1 year of updates for additional functionality you may request from author to implement. Hope this would be the right choice.

gennadiy’s picture

Status: Postponed » Needs review

Hi Folks,
Please check this post http://drupal.org/node/376399#comment-4555912 for working solution.

Thanks,
Gennady

aidanlis’s picture

Status: Needs review » Postponed

This may or may not be possible, I'm not sure, but I definitely don't have time to fix it.

Status: Needs review » Postponed