Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookings > Settings > Accommodation: Invisible To Shop Manager Role #337

Open
2 tasks
rtpHarry opened this issue May 18, 2023 · 0 comments
Open
2 tasks
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.

Comments

@rtpHarry
Copy link

Affected ticket(s)

Issue

The Accommodation tab is not available to the Shop Manager role.

They can do everything else like editing the products and all other aspects of the Booking system, so this seems like a bug.

You are requiring manage_options when you should require manage_woocommerce to support the Shop Manager role as well:

	/**
	 * Initialize settings by using Bookings filter.
	 *
	 * @param array $tabs_metadata Tabs metadata.
	 *
	 * @return array Modified metadata that includes Accommodation.
	 */
	public function add_accommodation_settings( $tabs_metadata ) {
		$tabs_metadata['accommodation'] = array(
			'name'          => __( 'Accommodation', 'woocommerce-bookings' ),
			'href'          => admin_url( 'edit.php?post_type=wc_booking&page=wc_bookings_settings&tab=accommodation' ),
			'capability'    => 'manage_options',
			'generate_html' => 'WC_Accommodation_Booking_Admin_Product_Settings::generate_form_html',
		);

		return $tabs_metadata;
	}

Steps to reproduce the issue

  1. Log in as a shop manager
  2. Navigate to Bookings > Settings
  3. No Accomodation tab visible

  • Issue assigned to next milestone.
  • Issue assigned a priority (will be assessed by maintainers).
@vikrampm1 vikrampm1 added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug. labels May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants