Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgo-magento-extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgo-magento-extension
Merge requests
!15
Tracking page
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Tracking page
tracking_page
into
dev
Overview
0
Commits
8
Pipelines
0
Changes
6
Merged
Christel Loftus
requested to merge
tracking_page
into
dev
8 months ago
Overview
0
Commits
8
Pipelines
0
Changes
6
Expand
0
0
Merge request reports
Viewing commit
62c32bf0
Prev
Next
Show latest version
6 files
+
164
−
61
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
62c32bf0
link the setting to the tracking page
· 62c32bf0
Christel Loftus
authored
8 months ago
Block/TrackOrderLink.php
0 → 100644
+
39
−
0
Options
<?php
namespace
BobGroup\BobGo\Block
;
use
Magento\Framework\View\Element\Html\Link\Current
;
use
Magento\Framework\App\Config\ScopeConfigInterface
;
class
TrackOrderLink
extends
Current
{
protected
$scopeConfig
;
public
function
__construct
(
\Magento\Framework\View\Element\Template\Context
$context
,
ScopeConfigInterface
$scopeConfig
,
\Magento\Framework\App\DefaultPathInterface
$defaultPath
,
// Add this dependency
array
$data
=
[]
)
{
$this
->
scopeConfig
=
$scopeConfig
;
parent
::
__construct
(
$context
,
$defaultPath
,
$data
);
// Pass it to the parent constructor
}
protected
function
_toHtml
()
{
// Check if the Track My Order feature is enabled
$isEnabled
=
$this
->
scopeConfig
->
isSetFlag
(
'carriers/bobgo/enable_track_order'
,
\Magento\Store\Model\ScopeInterface
::
SCOPE_STORE
);
if
(
!
$isEnabled
)
{
return
''
;
// Return an empty string if the feature is disabled
}
return
parent
::
_toHtml
();
// Use the parent class's rendering method
}
}
Loading