0

I´m running a D7 Commerce and I need to activate a payment method for some special products. On the Payment Rule conditions I need to check if the product included in the order has a specific value. For instance a certain Title, certain category or certain custom numeric value.

I tried with "order contains certain sku" that works fine, but as I need to do this activation for hundred of products, this is a messy way, becouse each condition applies only for 1 SKU.

That's why I need to filter the condition by any product related value. ¿Any Idea?

I tried to compare text and compare data (taxonomy, category, etc) but couldnt get result. It seems like is not comparing text or data in a good way :(

This is what I tried:

{ "rules_1_pago_con_tarjeta_de_cr_dito" : {
    "LABEL" : "1. Pago con tarjeta de cr\u00e9dito NOW",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "commerce_payment" ],
    "ON" : { "commerce_payment_methods" : [] },
    "IF" : [
      { "entity_has_field" : { "entity" : [ "commerce-order" ], "field" : "field_product" } },
      { "text_matches" : { "text" : [ "commerce-order:field-product:title" ], "match" : "EXPO" } }
    ],
    "DO" : [
      { "commerce_payment_enable_commerce_sermepa2" : {
          "commerce_order" : [ "commerce-order" ],
          "payment_method" : "commerce_sermepa2"
        }
      }
    ]
  }
}

Thanks in advance for any help. Sorry if I´m not a Drupla expert. Keep learning

Your Answer

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

Browse other questions tagged or ask your own question.