Hi,
Using the ubercart with the ECO module, I have ticked the box...
"Disable Drupal account creation for anonymous users / new customers"
under admin > store > configuration > checkout settings > checkout panes > customer info settings.

But when I go to admin > user management > users - I am still getting new accounts created.

I am also getting two emails sent and stock decremented twice when a customer buys a product (once when pay-pal finishes payment and once when I click 'back to the store'. (There are a lot of issues posted for this - but I couldn't figure out if it had been fixed or not).

If I uncheck the above tick box, the duplicate emails/duplicate stock decrementing issue goes away.

Has anyone seen this problem before / any suggestions where to investigate.

I have not altered any setting under: /admin/store/ca
I am not getting any errors reported.
Thanks,

Comments

petu’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev

I have the same problem on beta-2 and dev versions.

Any solutions?

tjpatterson’s picture

Category: support » bug

We're experiencing the exact same issue with a site of ours.
I'm guessing the issue is with code in uc_eco_main.module after line 647.
It's as if it's processing the order twice?

I read through the previous 'decrementing stock twice' bug threads too. They were caused by issues related to how the paypal module was handling the 'checkout complete'. It may be a similar issue with the status of the order not being handled correctly?

I've noticed it tries to change the order status to post_checkout. I think that order status has been removed.

tjpatterson’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta2
petu’s picture

I removed ECO module. I added custom PHP code for Condition actions to remove created user :).
Trigger: Customer completes checkout
Actions: PHP-code user_delete(NULL, $order->uid);

It works fine.

tjpatterson’s picture

Oh great idea. Thanks!

DaPooch’s picture

Made this change around line 690 of dev version in uc_eco_main.module make sure you clear your cache after update and every time after you toggle the " Disable Drupal account creation for anonymous users / new customers." option. Seems to work right for me now.


function uc_eco_main_complete_sale($order, $login = FALSE) {
  global $user;

  if ($order->uid == 0) {
    $result = db_query("SELECT uid FROM {users} WHERE mail = '%s'", $order->primary_email);
    if ($account = db_fetch_object($result)) {
      $order->uid = $account->uid;
      $account = user_load($account->uid);
      db_query("UPDATE {uc_orders} SET uid = %d WHERE order_id = %d", $order->uid, $order->order_id);
      $message_type = 'existing_user';
    }
    else {
      //mod to allow anon purchase without account creation, basically just allow it to log orders to the anon account if users aren't required to have an account for purchase.
      if (variable_get('uc_eco_main_new_account_creation_disable', 0) == 1) {
        $account = user_load(array('uid' => $node->uid));
        $message_type = 'logged_in';
      }else{
        $fields = array(
                'mail' => $order->primary_email,
        );
        $account = (object)$fields;
      }
      //end mods
    }
  }

...