I'm currently working for a client who has more complex conditions around adding payment methods to their orders and therefore don't want any of the commerce_payment rules defaults. I've done this by following the steps below:

* Use hook_default_rules_configuration_alter() much like http://detlus.com/articles/drupal/disable-rules-programmatically-in-drup... but use commerce_payment_methods() to make sure all payment method's rules are disabled
* Use hook_commerce_payment_methods() to add them to the order using our business logic

The problem now is that features complains about overridden features for ones that contain commerce rules config, but don't even contain the commerce_payment rules themselves. I've also tried using hook_module_implements_alter() to unset commerce_payment's implementation of the default rules config hook but that causes issues when clearing cache since there's so many it fails with a Fatal error from xdebug regarding nested function limits.

This needs to be 100% automatic and programatic, meaning when new payment methods are added there's no manual steps to remove the rules configuration whatsoever.

Is there a way we could have a setting to simply not add these rules? Or is there another way I'm missing altogether?

The module versions are older than the latest stable but I've tried updating things and still have no luck so I don't think that is the cause of my problems.

Features 2.0-rc3
Commerce 1.7
Rules 2.3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acbramley created an issue. See original summary.

acbramley’s picture

As an interim solution I'm just adding this patch so I can move on to other things.

acbramley’s picture

Status: Active » Closed (won't fix)

Yeah, now I see why this isn't possible, commerce_payment is way too tightly coupled with the rules.