diff --git a/erpnext/public/js/hub/marketplace.js b/erpnext/public/js/hub/marketplace.js
index 28309f3caf0..2c2a29d5255 100644
--- a/erpnext/public/js/hub/marketplace.js
+++ b/erpnext/public/js/hub/marketplace.js
@@ -332,6 +332,11 @@ erpnext.hub.SearchPage = class SearchPage extends SubPage {
}
erpnext.hub.Item = class Item extends SubPage {
+ make_wrapper() {
+ super.make_wrapper();
+ this.setup_events();
+ }
+
refresh() {
this.show_skeleton();
this.hub_item_code = frappe.get_route()[2];
@@ -370,6 +375,29 @@ erpnext.hub.Item = class Item extends SubPage {
this.$wrapper.html(skeleton);
}
+ setup_events() {
+ this.$wrapper.on('click', '.btn-contact-seller', () => {
+ const d = new frappe.ui.Dialog({
+ title: __('Send a message'),
+ fields: [
+ {
+ fieldname: 'to',
+ fieldtype: 'Read Only',
+ label: __('To'),
+ default: this.item.company
+ },
+ {
+ fieldtype: 'Text',
+ fieldname: 'message',
+ label: __('Message')
+ }
+ ]
+ });
+
+ d.show();
+ });
+ }
+
get_item(hub_item_code) {
return hub.call('get_item_details', { hub_item_code });
}
@@ -414,7 +442,7 @@ erpnext.hub.Item = class Item extends SubPage {
-
${where}${dot_spacer}${when}
@@ -430,6 +458,11 @@ erpnext.hub.Item = class Item extends SubPage {