Browse code

Add a shipping annotation fields for customer informations

Benjamin Roth authored on17/06/2020 09:50:23
Showing2 changed files
... ...
@@ -11,6 +11,7 @@
11 11
 $GLOBALS['TL_DCA']['tl_iso_product_collection']['config']['onload_callback'][] = array('tl_iso_product_collection_eSM_isotope_shipmenttracking','registerSubPalettes');
12 12
 
13 13
 $GLOBALS['TL_DCA']['tl_iso_product_collection']['palettes']['default'] = str_replace(array('{status_legend}','{status_legend:hide}'),array('{status_legend},shipping_tracking','{status_legend:hide},shipping_tracking'),$GLOBALS['TL_DCA']['tl_iso_product_collection']['palettes']['default']);
14
+$GLOBALS['TL_DCA']['tl_iso_product_collection']['palettes']['default'] = str_replace('date_paid','shipping_annotation,date_paid',$GLOBALS['TL_DCA']['tl_iso_product_collection']['palettes']['default']);
14 15
 $GLOBALS['TL_DCA']['tl_iso_product_collection']['palettes']['__selector__'][] = 'shipping_tracking';
15 16
 
16 17
 $GLOBALS['TL_DCA']['tl_iso_product_collection']['subpalettes']['shipping_tracking'] = 'tracking_number';
... ...
@@ -39,6 +40,14 @@ $GLOBALS['TL_DCA']['tl_iso_product_collection']['fields']['tracking_number'] = a
39 40
   'eval'                      => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50', 'decodeEntities'=>true),
40 41
   'sql'                       => "varchar(255) NOT NULL default ''",
41 42
 );
43
+$GLOBALS['TL_DCA']['tl_iso_product_collection']['fields']['shipping_annotation'] = array
44
+(
45
+  'label'                     => &$GLOBALS['TL_LANG']['tl_iso_product_collection']['shipping_annotation'],
46
+  'exclude'                   => true,
47
+  'inputType'                 => 'textarea',
48
+  'eval'                      => array('style'=>'height:80px;', 'tl_class'=>'clr'),
49
+  'sql'                       => "mediumtext NULL",
50
+);
42 51
 
43 52
 $GLOBALS['TL_DCA']['tl_iso_product_collection']['fields']['order_status']['eval']['tl_class'] = 'clr';
44 53
 
... ...
@@ -16,6 +16,8 @@ class IsotopeHooks extends \Controller
16 16
 {
17 17
   public function getOrderNotificationTokens($Order, $arrTokens)
18 18
   {
19
+    $arrTokens['shipmenttracking_shipping_annotation'] = $Order->shipping_annotation;
20
+
19 21
     if (!$Order->shipping_tracking)
20 22
     {
21 23
       return $arrTokens;