Getting Product Details on payment method
On 'Select available payment methods for an order' i want to get the product field. My Product name is event and it has a field 'number of participants' but i am not able to get it in rules. I want to put check on this field plz help?
Comments
Check this
Hi
Did you check this: http://www.drupalcommerce.org/faq/rules-field-data-selection
Thanks
select available payment mehtod getting product
I have written this code in rule(it was select available payment method) condition may be it helps some one
<?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_minimum_participants['und'][0]['value'];
if($field_part == 1) {
return TRUE;
}
}
return FALSE;
?>