Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
commerce-3469240
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
commerce-3469240
Commits
436fc694
Commit
436fc694
authored
11 months ago
by
Vitaliy Marchuk
Committed by
Jonathan Sacksick
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+9
-0
9 additions, 0 deletions
README.md
modules/tax/src/TaxTypeListBuilder.php
+5
-0
5 additions, 0 deletions
modules/tax/src/TaxTypeListBuilder.php
with
14 additions
and
0 deletions
README.md
+
9
−
0
View file @
436fc694
...
...
@@ -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;`
This diff is collapsed.
Click to expand it.
modules/tax/src/TaxTypeListBuilder.php
+
5
−
0
View file @
436fc694
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment