2011-03-04 45 views
0

我使用的是CommerceRules模塊,我想在我的商店買東西后與我的客戶保持聯繫。如何使用字段安排規則?

我想爲產品實體添加一個follow_up_date字段,並使用它來安排規則。我已經設置了規則,我已經使用Entity has field條件,以便follow_up_date被加載並且可以讀取和編輯,但它不會顯示爲調度組件的數據選擇器。

我試過使用DateInteger Date模塊,並且使用各種類型和粒度的日期戳,但沒有骰子。

如何使用字段中的數據計劃規則?

回答

0

根據產品的訪問方式,fx通過訂單,規則缺陷/缺陷可能會阻止您,請參閱d.o上的issue

有一個解決方法,通過使用hook_entity_property_info_alter來解決此問題。像這樣的東西應該爲你做的伎倆:

/** 
* Implements hook_entity_property_info_alter() on top of the Line Item module. 
*/ 
function module_entity_property_info_alter(&$info) { 
    // Add custom discount fields to circumvent a rules bug. 
    $properties = array(); 

    foreach ($info['commerce_product']['bundles'] as $bundle => $bundle_info) { 
    $bundle_info += array('properties' => array()); 
    $properties += $bundle_info['properties']; 
    } 

    $info['commerce_product']['properties']['field_NAME'] = $properties['field_NAME']; 
}