1

Using Commerce (7.x-1.1), Commerce Card on File (7.x-2.0-beta5), Commerce Recurring Framework (7.x-2.x-dev) and Commerce Donate (7.x-1.0)

I need Commerce Card on File for my recurring product entities, however I do not want the functionality applied to Donation Products.

How do I keep the Commerce Card on File functionality for recurring products, but disable it for donation products?

2

If you go to the Payment method configuration screen (admin/commerce/config/payment-methods), you'll see that each payment method is a rule. If you click on 'edit' you'll get a rules configuration screen.

enter image description here

Next, click on "Add condition" under the conditions section. Here you can choose the various conditions that allow (or disallow) a payment method to be selected.

add condition

You've got the order object here so you can choose 'Order contains a particular product'.

order contains a particular product drop-down

Then enter the SKU of your donation product in the field provided:

Product sku entry text field

Finally, make sure 'Negate' at the bottom of the rule configuration page is checked.

Negate button on rules form

Now that payment option will only show up if the order does not contain that product.

|improve this answer|||||
  • So basically, I will need to duplicate the rule, one for non-donation products and one for donation products. – VanD Nov 6 '15 at 17:54
  • If you have two different payment types you want to use, then yes. – nvahalik Nov 6 '15 at 18:37
  • I just have one, but I need one to have the card on file functionality, and one not to. – VanD Nov 6 '15 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.