Despite having user account checked under the product that allows anonymous users to purchase a recurring non-tangible product I have not had any success in getting an account set up after purchase.

Configuration of site:
The site allows only administrators to approve users
Using Authorize.net module

Perhaps I am missing something. I have followed directions for setup but neither of these actions take place when anon users try to purchase this product.

thanks

CommentFileSizeAuthor
#2 ec_useracc.patch8.64 KBgwen

Comments

gwen’s picture

I just installed 5.x-3.4 and am seeing the same problem. I think that this is the problem:

291 /**
292  * Implementation of hook_ecommerceapi()
293  */
294 function ec_useracc_ecommerceapi(&$txn, $op) {
295   global $user;
296 
297   switch ($op) {
298     case 'on payment completion':
299       if ($user->uid == $txn->uid) {
300         return;
301       }

When I put in debug statement, I find that as an anonymous user $user->uid == $txn->uid == 0, so the code that actually creates the account in the following lines never gets called.

I'm not familiar enough with the ecommerce module to know if there was an API change or something recently that changed $txn->uid, but if I change the conditional to something like:

  if ($user->uid != 0) {

the account gets created.

However, I am seeing a few other issues with account creation, namely:
* user registrations settings are not honored (my site is set to require administrator approval, but user is automatically logged in)--maybe this is a feature not a bug?
* user welcome email tokens are not replaced properly (I'm seeing things like "Dear [firstname]" using the default emails)

Not sure we're going to use this module, but if we do, I'll try to post a patch.

gwen’s picture

Status: Needs review » Active
StatusFileSize
new8.64 KB

I fixed the issue above and created a patch that also fixes these related issues:

  1. all token replacements were not working in welcome/confirm emails
  2. tokens in emails were sometimes incorrectly set upon install (e.g. instead of [account-edit], token was set [account]-edit
  3. existing emails in the user db were during new user creation

The patch is against 5.x-3.4.

gwen

gwen’s picture

Version: 5.x-4.1-alpha10 » 5.x-3.4
Status: Active » Needs review
theorichel’s picture

Status: Active » Needs review

Gwen,

I am installing the patch that you wrote (which hopefully ends a very long struggle with e-commerce). So far one glitch. I use a special emailaddress to experiment with this. To be able to do another experiment, all I had to do before installing your patch was remove that record from the users-list.
Now that the patch is installed removing the user from the list is not sufficient anymore, I constantly get message that 'the emailaddress is already taken'. Emptying the cache had no effect, removing that emailaddress from the ec-tmp table did neither. I now have removed all references to that emailaddress from the database and now I can get through.
Maybe useful.
Thanks

Theo Richel

theorichel’s picture

Gwen, once more

Alas, no changes. User accounts are created, but the only mail that is sent to the buyer is an empty email which seems to be a Mime Mail problem (and which a total reinstall of Mime Maile didnt remedy). No welcome message whatsoever, not the regular welcome message nor the welcome message that is supposedly provided by e-commerce.

Thanks

Theo Richel

theorichel’s picture

Have some more experiences with this patch now.

1. Message 'user is already taken' has not resurfaced anymore.
2. Each payment is replied to with an empty email to the new user that only contains the css from the site
3. I am flooded with errors like these; #164068
4. The new user is created, but he is not notified. Nor is there an option to do so (apart from totally rectreating the account).

I work on Drupal 5.11 and experienced this with E-commerce 3.4, 3.5 and the dev version of nov 2 (in the latter 2 I used your patch). E-commerce product: donate, payment method PayPal.

I know you 'only' patched the thing, but have you finally gotten it working?

Thanks

Theo Richel

gwen’s picture

I actually abandoned ecommerce altogether b/c I found several other issues in my particular instance. Sorry!

theorichel’s picture

I understand completely. I have it working somewhat, but it remains a mess.

Thanks anyway

TR

kaoru’s picture

Version: 5.x-3.4 » 5.x-3.5

I am new to Drupal and am creating e-commerce site and made automatic user account when customer purchase the goods. During the test, the default customer invoice was sent successfully and when the transaction was completed, the welcome e-mail which include login user name and password were sent. Unfortunately, the token for username does not work. Token [user-clear-password] works fine showing Password. I searched the available token, but nothing works for Username.

Username:[username] I tried [user], !user, %user, etc….
Password: Lrepgyiro Password works fine.

I appreciate for your advise.

Thank you

theorichel’s picture

Sorry you are even further then I am. In my situation no emails are sent by E-commerce. User accounbts are created, and I manage to have them mailed with the module User-status. I first block the users and then reactivate them, and the reactivation starts the sending of email.

davea’s picture

Version: 5.x-3.5 » 5.x-3.x-dev
Status: Needs review » Fixed

Committed

theorichel’s picture

I had applied the patch myself and it worked, now I install the apparently committed version 5.x-3.x of nov 17 2008 and it doesnt work anymore: no user accounts are created and no mail is sent out.
Will try now to reinstall 'my' version.

davea’s picture

Status: Fixed » Active

Theo,

Please test the latest version again. I may have found the problem. My testing shows this bug to be resolved after some minor changes that I made just now.

Let us know!

Thanks,
DaveA

davea’s picture

Assigned: Unassigned » davea

assigning to me

theorichel’s picture

That is a fast response, but I do not quite get it. Should I download the 17 november version again? On the site it doesnt contain a single document that has been altered after 17 november.

theorichel’s picture

Well I downloaded the 17 nov version again and installed it. Made no difference. Payments do arrive however, allthough the Add to cart button behaves strangely, but user accounts are not created and no mail is sent.

davea’s picture

You want to download the latest dev version. This version is updated automatically to include any changes made to the project. Right now it would be the November 21st version.

Try that version.

Thanks!
DaveA

theorichel’s picture

I have completely removed EC today (not just an uninstall, but I also removed the tables manually as well as all references to EC in the system and variable tables. Also uninstalled the Token module (and removed ref to that in system table).
Then Update.php.
Then reinstallred Token,
Then Reinstalled Anonymous purchase, which pulls the rest.
Then read your mail on todays update. Uploaded it, ran update php.

Then created a new product 'Donation'

Former error ec_mail_modref() SERIOUS ERROR! ( see #119432 ) has now disappeared

Donations do come in, the money arrives, no user accounts are created but an order confirmation is sent

davea’s picture

Silly question-- you have the box checked to create the accounts on the *donation* edit page ?

theorichel’s picture

Silly questions are often the best, but not this time: that box is indeed checked.
Meanwhile I have also added a Recurring schedule, but it had no effect.

theorichel’s picture

Just guessing wildly. Could it have to do with the screen order? That is currently:
ec_anon 0
payment 1
cart 2

where the only thing I can change is the 1 of the payment, well.. the box is editable but if I add e.g. a 2 there and submit it just changes back to the original value.

I have never understood this screen order thing. In my system I have the impressiopn that my users first get the cart, then are asked for their email and then pay.

planctus’s picture

Is there any update about this?
I'm using ec 3.6 and drupal 5.15, i have some recurring products.
The user creation, with the right role is working with the C.O.D set to "Mark transaction as paid".
Otherwise, with another c.o.d, if i change the transaction status set it as "payment received" the confirmation email is not sent.
but i see another issue, i created a custom email to be sent but the default one is being sent even tough i chose the custom one in the ec_useracc admin page.
Thanks,
Da.