Hi,

For future development, I think rules is the way to go, because Ubercart 3 will use rules.
It would be great if I could use my already made CA's and they will be migrates to rules, so implementing this module will bring me on the path to move to Ubercart 3 in the future easier!

greetings,
Martjin

Comments

hunziker’s picture

Assigned: Unassigned » hunziker

Hi

Thank you for your post. A migration of Conditional Actions (CA) is from my point of view not possible, because rules and CA has a different handling of objects. If you see this different, please explain me how you would implement such migration?

summit’s picture

Hi, May be migration is not the correct word, but what would be necessary to get Ubercart 2 working with rules is that all standard CA's from Ubercart need to be worked to Rules with exact the same functionality, right? Than CA can be fased out, and Ubercart 2 with Rules can in the future more easily be upgraded to Ubercart 3.
Next to this other rules functionality can be easily integrated in Ubercart 2. For instance rules which other users have build which can be handy in a Ubercart implementation.

Greetings, Martijn

hunziker’s picture

Hi Martjin

Now I understand better what you mean. A direct migration of the rules will never be possible. There is a nice analogy to a normal Drupal module. Rules is nothing else then a process flow structure. This nothing else then PHP does. So but there is no automatic way to migrate Drupal modules from version 6.x to 7.x. Because rules are not different in the semantic, you have the same issues here.

Your approach to give a as near as possible API in rules as in CA is for me the way to go. So I try to assemble all necessary events and acctions:

Events to trigger in rules

The following events are available be default in CA:

  • Payment has been entered for an order
  • Customer completes Checkout
  • Order Status gets updated
  • E-Mail requested for order update

I'm not sure, but the most of them can triggered by an event "Order Status gets changed". The E-Mail thing is not really useful, because you have a separate integration of e-mail in rules. Please correct me here if I am wrong at this point. The mentioned event is already implemented.

Actions to be executed

The following actions can be executed by CA:

  • Execute custom PHP code
  • Display a message
  • Send order E-Mail again*
  • Send order E-Mail Invoice*
  • Add comment to the order*
  • Send a custom E-Mail
  • Update the order status*

The actions with a * needs to be implemented in rules. Are there more actions?

summit’s picture

Hi,
This is exactly the approach as I mean!
May be asking in the Ubercart community on www.ubercart.org, whether other actions are needed initial?
greetings, Martijn

hunziker’s picture

I will implement these features (actions & events). Then we should test it in real cases. Problems and missing features will be then become visible.

summit’s picture

I agree, and others can contribute to this thread also in the meantime off course.
greetings, Martijn

hunziker’s picture

I have integrated the above actions and events (see last commit). It would be nice if you can test it.

summit’s picture

I try to get to it tomorrow, can I use your module side by side with CA, or do I need to disable CA to test the actions and events?
And may be stupid question, are those rules already in Ubercart 3 also? I do not know the Ubercart 3 progress..
greetings,
Martijn

hunziker’s picture

Your qustions are not stupid. You can use CA side by side with Rules. Important there are 3 new predicates. You need to activate theme. In future vesion I will remove this. The events will be triggerred directly and not through CA.

hunziker’s picture

About Ubercart 3: I don't know which actions and events are integrated in Ubercart 3. I will check this.

hunziker’s picture

I remove the dependencies to the conditional actions module. The predicates are not needed anymore for the integration. I replace it with the appropriate hooks.

I check the current Ubercart 3. This module implements all the rules of Ubercart 3. The parameters can be different.

summit’s picture

Hi,
I apologize didn't had time yet to test...sorry.
greetings,
Martijn

hunziker’s picture

Version: » 6.x-1.0-rc1
Status: Active » Closed (fixed)
summit’s picture

Hi,
jumped over to drupal commerce, because drupal 7 is the future. Sorry for not telling earlier.
greetings, Martijn