- Issue created by @renatoheeb@gmail.com
Since issue 📌 Giftcard transaction reference Needs work a transaction tracks references to:
To use those information's for e.g. creating an integrated view and show the connections to these orders, we need to add relationships.
Probably it would make sense, to do this within the module, and not in "custom code".
The relationships would be defined similarly as follows:
$data['commerce_giftcard_transaction']['reference_id']['relationship'] = [
'base' => 'commerce_order_item',
'base field' => 'order_item_id',
'id' => 'standard',
'label' => t('Commerce order item'),
'title' => t('Commerce order item'),
];
$data['commerce_giftcard_transaction']['reference_id_order'] = [
'title' => t('Reference to order'),
'help' => t('Reference to order (giftcard use)'),
'relationship' => [
'base' => 'commerce_order',
'base field' => 'order_id',
'id' => 'standard',
'label' => t('Commerce order'),
'title' => t('Commerce order'),
],
'real field' => 'reference_id'
];
Maybe it would also be easier, if we track those references in separate fields. (single point of responsibility principle)
What do you think?
Active
2.0
Code