feat: remove the feature flag for the pickups table on product detail pages
This commit is contained in:
1 parent
0477589a7a
commit
ef7d81fe99
2 files changed
+2
-18
No files matched your search
@@ -5,7 +5,6 @@ namespace EP\EpProducts\Service;
|
|||||||
use EP\EpProducts\Domain\Model\Hotel;
|
use EP\EpProducts\Domain\Model\Hotel;
|
||||||
use EP\EpProducts\Domain\Model\Product;
|
use EP\EpProducts\Domain\Model\Product;
|
||||||
use EP\EpProducts\Domain\Repository\DateRepository;
|
use EP\EpProducts\Domain\Repository\DateRepository;
|
||||||
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists the pickup points of a product's latest upcoming end-customer date that
|
* Lists the pickup points of a product's latest upcoming end-customer date that
|
||||||
@@ -17,11 +16,6 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
|||||||
*
|
*
|
||||||
* The returned shape is meant to be served by MyE&P later on, so that only the
|
* The returned shape is meant to be served by MyE&P later on, so that only the
|
||||||
* data source has to change once the local date table goes away.
|
* data source has to change once the local date table goes away.
|
||||||
*
|
|
||||||
* Switched by pickupsOverviewEnabled in the extension configuration. A missing
|
|
||||||
* key means off: a key added to ext_conf_template.txt is absent until the
|
|
||||||
* extension configuration is saved in the backend, and the overview must not
|
|
||||||
* go live before it is approved.
|
|
||||||
*/
|
*/
|
||||||
class PickupOverviewService
|
class PickupOverviewService
|
||||||
{
|
{
|
||||||
@@ -30,16 +24,9 @@ class PickupOverviewService
|
|||||||
*/
|
*/
|
||||||
private $dateRepository;
|
private $dateRepository;
|
||||||
|
|
||||||
/**
|
public function __construct(DateRepository $dateRepository)
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
private $enabled;
|
|
||||||
|
|
||||||
public function __construct(DateRepository $dateRepository, ExtensionConfiguration $extensionConfiguration)
|
|
||||||
{
|
{
|
||||||
$this->dateRepository = $dateRepository;
|
$this->dateRepository = $dateRepository;
|
||||||
$configuration = (array) $extensionConfiguration->get('ep_products');
|
|
||||||
$this->enabled = (bool) ($configuration['pickupsOverviewEnabled'] ?? false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,7 +35,7 @@ class PickupOverviewService
|
|||||||
public function getOverview(Product $product, ?Hotel $hotel): array
|
public function getOverview(Product $product, ?Hotel $hotel): array
|
||||||
{
|
{
|
||||||
$overview = ['pickups' => []];
|
$overview = ['pickups' => []];
|
||||||
if (!$this->enabled || $hotel === null || $product->isDaytrip()) {
|
if ($hotel === null || $product->isDaytrip()) {
|
||||||
return $overview;
|
return $overview;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
# cat=General; type=int; label=Searchresult PID
|
# cat=General; type=int; label=Searchresult PID
|
||||||
searchPageUid = 0
|
searchPageUid = 0
|
||||||
|
|
||||||
# cat=General; type=boolean; label=Show the bus pickups table on product detail pages
|
|
||||||
pickupsOverviewEnabled = 0
|
|
||||||
|
|
||||||
# cat=MyEp; type=string; label=MyE&P URL
|
# cat=MyEp; type=string; label=MyE&P URL
|
||||||
myEpUrl = https://my.ep-reisen.de
|
myEpUrl = https://my.ep-reisen.de
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user