8 replies [Last post]
BruisedGhost's picture
Offline
Joined: 01/25/2009
Juice: 6
Was this information Helpful?

Hi All,

Im running into a bit of a problem, when I go to create an order as admin everything works fine, an invoice is generated, everything is added to the database and all is well. The big problem is that if I am the admin and create an order to a customer there is no way for the customer to pay for the order once I have created it. Is there anyway around this?

Thanks!

smb488292's picture
Offline
Joined: 09/16/2007
Juice: 19
Same problem here

There doesn't seem to be any way to

* trigger actions (such as email notification) when items are added to a user's cart.

* generate an invoice without initiating a checkout.

I would love to be able to do both!

My application involves using UC for generating web hosting orders. I am pulling my hair our (metaphorically speaking since I don't actually have hair) trying to find a way to automatically notify the user when I have added items to their cart.

A "Generate invoice and mail invoice to user" button would help me to grow my hair back. Smiling

Beyond the scope of this particular issue, sending notifications to users at defined intervals to remind them that there are still items in their cart would prompt some users to review their orders and head for the checkout... a potential sales booster.

I have been looking at the rules module for this but there doesn't appear to be any hooks from the shopping cart or the items in the cart.

Anyone have ideas how to implement this?

Stephen
Hardfocus Media
Japan

smb488292's picture
Offline
Joined: 09/16/2007
Juice: 19
Re: Same problem here

Came across this just now: http://drupal.org/project/uc_review

Too bad nothing's been done with it.

Stephen
Hardfocus Media
Japan

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Same problem here

Yeah, this has been a long standing feature request that I just haven't had time to address personally. My thought is that it would be fairly simple to use the CC module's form for collecting and processing cards in conjunction w/ a user's unpaid invoices... it would just take a few hours development that I don't have atm. An example implementation would be the admin CC terminal form, but of course that won't do as is for customers since it has a variable amount field and lets you do other things like simply authorize a sale instead of just charge it all at once. Hopefully we can get some movement on this once development picks up for UC 3.x.

smb488292's picture
Offline
Joined: 09/16/2007
Juice: 19
Re: Re: Re: Same problem here

While the shopping cart metaphor has been useful for allowing buyers to comprehend what on-line shopping is all about, it has limited the thinking of programmers who have yet to encounter the myriad of other workflow models, all of which could be handled quite elegantly if the hooks where built in for event triggers at every stage of the process.

The fundamental flaw, as I see it, is the tight coupling of the order process with the checkout process. It just does fit well with how non-retail businesses workflow their sales.

Stephen
Hardfocus Media
Japan

Docc's picture
Offline
Getting busy with the Ubercode.
Joined: 07/03/2008
Juice: 168
Re: Invoicing

Triggering a invoice to be send on order creation by the admin shouldn't be that hard with a custom module or conditional action.
The problem lies indeed with the fact payment and checkout are tied to each other.

I need this function for a project so ill be looking into possibilities the next few weeks.

steingard's picture
Offline
Joined: 03/30/2008
Juice: 70
Re: Re: Invoicing

Did you have any success with a custom module or conditional action to achieve the functionality?

Even a recipe to get the functionality to mail invoice automatically during an administration order create procedure would be fantastic.

It seems like (maybe) it would be ideal to simply send the invoice whenever the order is set to "payment received" regardless of web or administration creation.

steingard's picture
Offline
Joined: 03/30/2008
Juice: 70
Solve it with Workflow-NG

I guess my issue can be solved with Workflow-NG. Although it won't send an actual invoice, I can hook it up to send out a "thank you for your purchase" e-mail when an admin creates an order (over the phone or in person) and adds a payment so the order balance is zero.

From what I understand, this is what Conditional Actions is now doing in UC 2.x anyway.

steingard's picture
Offline
Joined: 03/30/2008
Juice: 70
Yep. Solved it with Workflow-NG Custom PHP Action

I wound up finding this function in uc_order.module & combined it with a Workflow-NG Custom PHP action, and then shut off the customer notification e-mail that sends out upon checkout. The condition I set this to trigger on is when a payment is entered and the order balance = 0.

  if ($order === FALSE) {
    drupal_set_message(t('Order @order_id does not exist.', array('@order_id' => $order_id)));
  }

// Check if there is an e-mail address in the order
if ([order:order-email] != '') {

// Load the order invoice and the to/from data
  $output = uc_order_load_invoice($order, 'admin-mail', variable_get('uc_cust_order_invoice_template', 'customer'));
  $from = '[order:store-owner] <[order:store-email]>';
  $recipient = '[order:order-email]';

// Send the e-mail with the drupal_mail() hook
  $sent = drupal_mail('invoice', $recipient, t('Your [order:store-name] Order (#[order:order-id])'), $output, $from, array('Content-Type' => 'text/html; charset=UTF-8; format=flowed'));

  if (!$sent) {
    drupal_set_message(t('E-mail failed.'));
  }
  else {
    $message = t('Invoice e-mailed to @email.', array('@email' => $recipient));
    drupal_set_message($message);
    uc_order_log_changes($order->order_id, array($message));
  }

}