Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Problem with "Update the order status" action on "When an order is first paid in full" event

Hi all.

My environment:

* Drupal Core 7.19
* Drupal Commerce 7.x-1.4
* Using "Example payment" module to test payments
* All respective dependencies are latest version as well
* NOT using kickstart

I'm trying to set "Order status" to "Completed" after full payment has been received using the "When an order is first paid in full" event.

Official guide on subject: http://www.drupalcommerce.org/user-guide/checkout-completion-rules

I have two actions set:
* "Update the order status" - does not seem to work at all
* "Send mail" - Works fine, I receive the email once payment has been made in full.

Please help!!!

Here is the exported rule:

{ "rules_update_status_when_payment_is_received" : {
    "LABEL" : "Update status when payment is received \u0026 send email receipt",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "commerce_order", "rules", "commerce_payment" ],
    "ON" : [ "commerce_payment_order_paid_in_full" ],
    "DO" : [
      { "commerce_order_update_status" : { "commerce_order" : [ "commerce_order" ], "order_status" : "completed" } },
      { "mail" : {
          "to" : [ "commerce-order:mail" ],
          "subject" : "Payment receipt for order #[commerce-order:order-number]",
          "message" : "Dear [commerce-order:owner],\r\n\r\nPayment has been successfully received for your order #  [commerce-order:order-number]\r\n\r\nThank you.\r\n",
          "language" : [ "" ]
        }
      }
    ]
  }
}
Asked by: Malty
on February 4, 2013

1 Answer

Vote up!
1
Vote down!

Solved! - Sort of!

It seems as though that when using any example test payment modules the "Update Order Status" to action does not get executed.

However when using the Official Paypal module it all works fine and my order status is now set to "Completed" after receiving full payment for an order.

Answer by: Malty
Posted: Feb 4, 2013

Comments

I got the same problem several times : full payment for an order event working for paybox / paypal but not for example payment. So i created a rule for example payment only to have "complete" state :
{ "rules_daesign_example_payment_complete_status" : {
"LABEL" : "daesign_example_payment_complete_status ( passer \u00e0 termin\u00e9 m\u00eame si on utilise le paiement d\u0027exemple)",
"PLUGIN" : "reaction rule",
"WEIGHT" : "10",
"OWNER" : "rules",
"REQUIRES" : [ "commerce_payment", "commerce_order", "commerce_checkout" ],
"ON" : { "commerce_checkout_complete" : [] },
"IF" : [
{ "commerce_payment_selected_payment_method" : {
"commerce_order" : [ "commerce_order" ],
"method_id" : "commerce_payment_example"
}
}
],
"DO" : [
{ "commerce_order_update_status" : { "commerce_order" : [ "commerce_order" ], "order_status" : "completed" } }
]
}
}

- Yann on April 2, 2016