feat(marketplace): featured Items for sellers
This commit is contained in:
@@ -72,6 +72,11 @@ export default {
|
||||
condition: hub.is_user_registered() && !this.is_own_item,
|
||||
action: this.add_to_saved_items
|
||||
},
|
||||
{
|
||||
label: __('Add to Featured Item'),
|
||||
condition: hub.is_user_registered() && this.is_own_item,
|
||||
action: this.add_to_featured_items
|
||||
},
|
||||
{
|
||||
label: __('Report this Item'),
|
||||
condition: !this.is_own_item,
|
||||
@@ -212,6 +217,21 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
add_to_featured_items() {
|
||||
hub.call('add_item_to_seller_featured_items', {
|
||||
hub_item_name: this.hub_item_name,
|
||||
hub_user: frappe.session.user
|
||||
},)
|
||||
.then(() => {
|
||||
const featured_items_link = `<b><a href="#marketplace/featured-items">${__('Added to Featured Items')}</a></b>`
|
||||
frappe.show_alert(featured_items_link);
|
||||
erpnext.hub.trigger('action:item_feature');
|
||||
})
|
||||
.catch(e => {
|
||||
console.error(e);
|
||||
});
|
||||
},
|
||||
|
||||
make_contact_seller_dialog() {
|
||||
this.contact_seller_dialog = new frappe.ui.Dialog({
|
||||
title: __('Send a message'),
|
||||
|
||||
Reference in New Issue
Block a user