I add 3 questions here to avoid multiple posts.
- I use this snippet to add link from my account to vendor profile:
add_filter(
'hivepress/v1/menus/user_account',
function ( $menu ) {
if ( is_user_logged_in() ) {
$vendor_id = HivePress\Models\Vendor::query()->filter(
[
'user' => get_current_user_id(),
]
)->get_first_id();
if ( $vendor_id ) {
$menu['items']['vendor_view'] = [
'label' => 'Vendor profile',
'url' => hivepress()->router->get_url( 'vendor_view_page', [ 'vendor_id' => $vendor_id ] ),
'_order' => 10,
];
}
}
return $menu;
},
1000
);
But the problem is when the user creates a listing and waits for the administration to approve his listing the link “vendor profile” takes him to the 404 page because the listing has not yet been approved.
What should I add to this snippet to check if vendor first listing is approved then insert the vendor profile link in my account?
-
How the approval works now? I can’t understand. when the vendor creates a new listing the only option is to approve or disapprove it?
Is it possible to make that after the vendor creates his listing how can I disapprove the listing and give him a reason why? after that give him a chance to moderate the listing and then send it again to admin for approval. -
After the vendor received an order he receive 2 emails one from the booking plugin and one from the marketplace plugin (I know because have seen the strings through loco translate).
The first email the vendor receive is: Hi, %user_name%! A booking of “%listing_title%” has been confirmed, click on the following link to view it: %booking_url%
And the second email vendor receives: Hi, %user_name%! You’ve received a new order %order_number% of %order_amount%, click on the following link to view it: %order_url%
It should be this way? I think it is a little confusing to receive 2 emails.