How to open the Virtual Agent Chatbot using HREF link from a catalog item description

Sujatha V M
Kilo Patron
Kilo Patron

Hi Team, 

 

I would like to know, if there is any way to call the "Virtual Agent Bot" to open on click from a description part of the catalog item. 

 

For eg, the below snippet has the item name as "Password Reset" and the description has "click here". I'm able to achieve it by opening the chat bot in a separate window using HREF but how do I open the bot on the same page on that icon right bottom corner without any navigation from the description of the catalog item. 

 

Note: Its not about the html syntax's target=_blank or _self

 

Sujatha8_0-1697530696922.png

 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.
4 REPLIES 4

RaghavSh
Kilo Patron

What you are asking is possible but not recommended as all. This will lead to customisation of your two widgets:

1. Catalog item widget.

2. VA widget.

 

Process (this will need two widgets to task):

1. Broadcast an event when from catalog item widget when "click here" is clicked using $rootScope.$broadcast

2. Listen the event in VA widget and open it using $rootScope.$on

 

SN does not recommend customisation of widgets as it may break in future releases. If its for learning purpose explore the above process.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

Thank you for the response and appreciate to explain on this. 

 

Yes I have implemented the above for custom widgets but the problem here is only for a catalog item which doesn't require the modification of the widget itself as the description will differ for each catalog item. 

 

 

 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

I understand that the description will differ, but it gets rendered in widget through code with somethinh like:

 

{{Item.description}} // not exactly.

So you will need to write the Onclick on description in client controller, which will broadcast the event.

 

I have inplemented this in custom widget, so I know this could ne possible from catalog item widget as well.

 

If it has to be opened from a particular set of catalog items , in that case additional queries will be required which will fetch those item from cat item table.

 

I hope this explains.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

@Sujatha V M did this work for you?


Raghav
MVP 2023