Skip to content
Snippets Groups Projects
Commit 436fc694 authored by Vitaliy Marchuk's avatar Vitaliy Marchuk Committed by Jonathan Sacksick
Browse files

Issue #3418492: Implement a settings pattern for disabling partner banners.

parent 64efd2ff
No related branches found
No related tags found
No related merge requests found
......@@ -20,3 +20,12 @@ composer create-project drupalcommerce/project-base mysite --stability dev --no-
```
See the [install documentation](https://docs.drupalcommerce.org/commerce2/developer-guide/install-update/installation) for more details.
## Disabling Partner banners
Drupal Commerce modules occasionally link to offers from technology partners in
contextually relevant portions of the administrative interface. To simplify
disabling these, the project has established a pattern of all such banners
respecting a setting you can set in your site's settings.php:
`$settings['commerce_show_partner_banners'] = FALSE;`
......@@ -7,6 +7,7 @@ use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Site\Settings;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -75,6 +76,10 @@ class TaxTypeListBuilder extends ConfigEntityListBuilder {
public function render() {
$build = parent::render();
if (!Settings::get('commerce_show_partner_banners', TRUE)) {
return $build;
}
/** @var \Drupal\commerce_store\StoreStorageInterface $store_storage */
$store_storage = $this->entityTypeManager->getStorage('commerce_store');
$stores_count = $store_storage->getQuery()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment