Skip Navigation

Open

Reported for: WooCommerce Multilingual & Multicurrency 5.4.0

Topic Tags: WCML

Overview of the issue

The UI was updated in WCML 5.4.0 such that a new “Translate Taxonomy” button is shown at WooCommerce > WooCommerce Multilingual & Multicurrency.

Shop Managers can see the button, but if they click it it leads to a “Sorry, you are not allowed to access this page” message, because Shop Managers do not have permission to visit the WPML > Taxonomy translation page.

Workaround

Shop Managers do not inherently have permission to translate taxonomies. One option would be to simply grant Shop Managers such permission by adding this code to your site:

/**
 * Expand shop_manager caps to be able to translate taxonomies
 */
add_filter( 'user_has_cap', 'wssupp_boost_caps', 10, 1 );
function wssupp_boost_caps( $allcaps ){

	$newcaps = array();

	if ( isset( $allcaps['shop_manager'] ) && $allcaps['shop_manager'] ) {

		$newcaps = [
			"wpml_manage_taxonomy_translation" => true
		];
	}

	return array_merge(  $allcaps, $newcaps );
}

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>