when de-selecting "Send new customers a separate e-mail with their account details.", the invoice mail doesn't contain the new username and password because $_SESSION['new_user'] is cleared before the template gets parsed

to fix it, in ./uc_cart/uc_cart.module at line 1288 move the unset last, like this:

  // Empty that cart...
  uc_cart_empty(uc_cart_get_id());

  module_invoke_all('uc_checkout_complete', $order, $account);
  ca_pull_trigger('uc_checkout_complete', $order, $account);

  // Clear our the session variables used to force the cart workflow.
  unset($_SESSION['cart_order'], $_SESSION['do_complete'], $_SESSION['new_user']);

how does it impact the 2 function calls? seems to be working ok, alternatively you can split it in 2 unset calls and just unset the new_user last

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Offlein’s picture

This seemed to do just what I needed, and I've yet to see any negative consequences.

EvanDonovan’s picture

Title: new customer invoice email with no account details » Account details are not included in customer invoice email since $_SESSION['new_user'] is unset prior to ca_pull_trigger()

Is there any reason why this is not being done already? I am experiencing this issue also in 2.3.

EvanDonovan’s picture

Version: 6.x-2.2 » 6.x-2.4
Priority: Normal » Major

I think this is a major bug; I'm still seeing it in 2.4. Going to try the suggested code & see if I run into issues. RTBC if none.

YK85’s picture

subscribing

sarjeet.singh’s picture

Priority: Major » Critical
FileSize
621 bytes

I faced same problem. abaddon's solution worked fine.

I made a patch for it. its need to review.

Status: Needs review » Needs work

The last submitted patch, uc_cart_ptach.patch, failed testing.

sarjeet.singh’s picture

Status: Needs work » Needs review
FileSize
687 bytes

I made new patch(uc_cart_ptach_1.patch). please review it.

Status: Needs review » Needs work

The last submitted patch, uc_cart_ptach_1.patch, failed testing.

sarjeet.singh’s picture

Status: Needs work » Needs review
FileSize
743 bytes

I made new patch(uc_cart_ptach_2.patch) with git(linux). please review it.

longwave’s picture

Priority: Critical » Major

Ignore the testbot failures, it doesn't work properly at the moment.

Status: Needs review » Needs work

The last submitted patch, uc_cart_ptach_2.patch, failed testing.

Offlein’s picture

Status: Needs work » Reviewed & tested by the community

This ptach has been working for me in a live environment for about a year now. I think it should just be committed.

EvanDonovan’s picture

I agree with Offlein. I didn't test this particular patch to see whether it applies, but it does exactly what I am now doing on my production sites (and have been for about 6 months).

longwave’s picture

Just to note this change is already included in another patch that fixes several other issues at #644538-291: Duplicate order notification e-mail, and duplicate stock decrement

Offlein’s picture

Hrm. If that patch takes forever to commit, then it should be broken out.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed to both branches.

Offlein’s picture

Whaa!! Great success!

sarjeet.singh’s picture

Great!!!! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.