2

i am using comerce_node_checkout with drupal_commerce

I want to change product price depending on node field .

eg,

I have a field as field_gender if we select male then price will be 1000.00 or if we select female then it will be 500.

Any help is most appriciable.

Thanks in advance .

  • Wow, women go half price? Think I'll be wearing a dress to your website... – Clive Apr 10 '15 at 14:02
0

Ohhh!!!!!!!!

Power Of Rules

 { "rules_update_amount_female" : {
    "LABEL" : "Update amount Female",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "TAGS" : [ "Update amount" ],
    "REQUIRES" : [
      "rules",
      "commerce_line_item",
      "commerce_product_reference",
      "commerce_cart"
    ],
    "ON" : {
      "commerce_product_calculate_sell_price" : [],
      "commerce_cart_product_prepare" : []
    },
    "IF" : [
      { "entity_has_field" : {
          "entity" : [ "commerce-line-item" ],
          "field" : "commerce_node_checkout_node"
        }
      },
      { "entity_has_field" : {
          "entity" : [ "commerce-line-item:commerce-node-checkout-node" ],
          "field" : "field_ap_gender"
        }
      },
      { "data_is" : {
          "data" : [ "commerce-line-item:commerce-node-checkout-node:field-ap-gender" ],
          "value" : "Female"
        }
      }
    ],
    "DO" : [
      { "commerce_line_item_unit_price_amount" : {
          "commerce_line_item" : [ "commerce_line_item" ],
          "amount" : "500",
          "component_name" : "base_price",
          "round_mode" : "1"
        }
      }
    ]
  }
}

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.