Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have a webshop that sells meat. For some meat products, the weight varies a lot so we need customers to pay afterwards (Cash on Delivery). I added a field to the products which is "field_pin_only", now i need a rule in the payment methods that checks this field and disables the payment method if the field equals yes.

I tried using the data selector but the field doesn't show up.

Thanks alot!

share|improve this question
    
Also tried the following: <?php $line_items = $commerce_order->commerce_line_items['und']; foreach($line_items as $lid) { $line_item = commerce_line_item_load($lid['line_item_id']); $pid = $line_item->data['context']['product_ids'][0]; $product = commerce_product_load($pid); $field_part = $product->field_pin_only; if($field_part == Ja) { return TRUE; } } return FALSE; ?> – Stefan 1 hour ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.