File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed
Block/Adminhtml/Chat/Edit/Tab
view/adminhtml/ui_component Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,16 @@ protected function _prepareForm()
9696 'base_fieldset ' ,
9797 ['legend ' => __ ('Customer Information ' ), 'class ' => 'fieldset-wide ' , 'disabled ' => $ isElementDisabled ]
9898 );
99+ $ fieldset ->addField (
100+ 'session_id ' ,
101+ 'note ' ,
102+ [
103+ 'name ' => 'session_id ' ,
104+ 'label ' => __ ('Chat Key ' ),
105+ 'title ' => __ ('Chat Key ' ),
106+ 'text ' => $ model ->getSessionId ()
107+ ]
108+ );
99109 $ fieldset ->addField (
100110 'customer_name ' ,
101111 'note ' ,
@@ -117,6 +127,16 @@ protected function _prepareForm()
117127 ['id ' => $ model ->getCustomerId ()]) . "' target='blank' title=' " . __ ('View Customer ' ) . "'> " . $ model ->getCustomerEmail () . '</a> ' : __ ('Guest ' )
118128 ]
119129 );
130+ $ fieldset ->addField (
131+ 'ip ' ,
132+ 'note ' ,
133+ [
134+ 'name ' => 'ip ' ,
135+ 'label ' => __ ('IP Address ' ),
136+ 'title ' => __ ('IP Address ' ),
137+ 'text ' => $ model ->getIp ()
138+ ]
139+ );
120140
121141 $ order_id = $ this ->order ->getCollection ()->addFieldToFilter ('customer_id ' ,
122142 $ model ->getCustomerId ())->getLastItem ()->getId ();
Original file line number Diff line number Diff line change @@ -202,16 +202,16 @@ public function getCoreRegistry()
202202 public function getChatId (\Lof \ChatSystem \Model \ChatFactory $ chatFactory ) {
203203 if (!$ this ->_current_chat_id ) {
204204 if ($ this ->isLoggedIn ()) {
205- $ chat = $ chatFactory ->create ()->getCollection ()->addFieldToFilter ('customer_email ' ,$ this ->getCustomer ()-> getData ( ' email ' ));
205+ $ chat = $ chatFactory ->create ()->getCollection ()->addFieldToFilter ('customer_email ' ,$ this ->getCustomerEmail ( ));
206206 if ($ chat ->getSize () > 0 ) {
207207 $ chat_id = $ chat ->getFirstItem ()->getData ('chat_id ' );
208208 }else {
209209 $ chatModel = $ chatFactory ->create ();
210210
211211 $ chatModel
212212 ->setCustomerId ($ this ->getCustomerSession ()->getCustomerId ())
213- ->setCustomerName ($ this ->getCustomer ()-> getData ( ' firstname ' ). ' ' . $ this -> getCustomer ()-> getData ( ' lastname ' ))
214- ->setCustomerEmail ($ this ->getCustomer ()-> getData ( ' email ' ));
213+ ->setCustomerName ($ this ->getCustomerName ( ))
214+ ->setCustomerEmail ($ this ->getCustomerEmail ( ));
215215 $ chatModel ->save ();
216216 $ chat_id = (int )$ chatModel ->getData ('chat_id ' );
217217 }
Original file line number Diff line number Diff line change 241241 </item >
242242 </argument >
243243 </column >
244- <column name =" ip" >
244+ <column name =" ip" >
245245 <argument name =" data" xsi : type =" array" >
246246 <item name =" config" xsi : type =" array" >
247247 <item name =" filter" xsi : type =" string" >text</item >
250250 </item >
251251 </argument >
252252 </column >
253+ <column name =" session_id" >
254+ <argument name =" data" xsi : type =" array" >
255+ <item name =" config" xsi : type =" array" >
256+ <item name =" filter" xsi : type =" string" >text</item >
257+ <item name =" sorting" xsi : type =" string" >asc</item >
258+ <item name =" label" xsi : type =" string" translate =" true" >Chat Key</item >
259+ </item >
260+ </argument >
261+ </column >
253262 <column name =" user_id" >
254263 <argument name =" data" xsi : type =" array" >
255264 <item name =" config" xsi : type =" array" >
You can’t perform that action at this time.
0 commit comments