fix: be more easy on ep_trk cookie and resellers
This commit is contained in:
@@ -127,9 +127,10 @@ class AjaxDateController extends ActionController
|
|||||||
$altLabel = $product->getAltLabel();
|
$altLabel = $product->getAltLabel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
|
// Disabled, not working anyways, reseller subdomains are not registered since TYPO3 10.*
|
||||||
$paCode = $reseller['paCode'];
|
// if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
|
||||||
}
|
// $paCode = $reseller['paCode'];
|
||||||
|
// }
|
||||||
$datesTable = $this->dateService->getDatesTable([
|
$datesTable = $this->dateService->getDatesTable([
|
||||||
'product' => $product,
|
'product' => $product,
|
||||||
'hotel' => $hotel,
|
'hotel' => $hotel,
|
||||||
|
|||||||
@@ -281,11 +281,12 @@ class AjaxTableController extends ActionController
|
|||||||
*/
|
*/
|
||||||
public function pricetableHtmlAction(Product $product, Hotel $hotel, string $bpnBookingUrlTemplateCode = null): void
|
public function pricetableHtmlAction(Product $product, Hotel $hotel, string $bpnBookingUrlTemplateCode = null): void
|
||||||
{
|
{
|
||||||
if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
|
// Disabled, not working anyways, reseller subdomains are not registered since TYPO3 10.*
|
||||||
$paCode = $reseller['paCode'];
|
// if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) {
|
||||||
} else {
|
// $paCode = $reseller['paCode'];
|
||||||
$paCode = null;
|
// } else {
|
||||||
}
|
// $paCode = null;
|
||||||
|
// }
|
||||||
|
|
||||||
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
||||||
|
|
||||||
@@ -294,7 +295,7 @@ class AjaxTableController extends ActionController
|
|||||||
'hotel' => $hotel,
|
'hotel' => $hotel,
|
||||||
'filterSettings' => $this->filterService->getNormalizedFilterSettings(),
|
'filterSettings' => $this->filterService->getNormalizedFilterSettings(),
|
||||||
'template' => $this->settings['bpnBookingUrlTemplateCode'],
|
'template' => $this->settings['bpnBookingUrlTemplateCode'],
|
||||||
'paCode' => $paCode,
|
'paCode' => GeneralUtility::_GET('pa'),
|
||||||
'sortByRoom' => true,
|
'sortByRoom' => true,
|
||||||
]);
|
]);
|
||||||
$hasIncludedServices = $this->dateService->hasIncludedServices($priceTable);
|
$hasIncludedServices = $this->dateService->hasIncludedServices($priceTable);
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ class BookingUrlUtility
|
|||||||
{
|
{
|
||||||
|
|
||||||
const COOKIE_NAME = 'ep_trk';
|
const COOKIE_NAME = 'ep_trk';
|
||||||
const URL_BASE = 'https://www.ep-reisen.de/buchung/maske_buchung.php';
|
|
||||||
|
|
||||||
public static function generateUrl(array $options): string
|
public static function generateUrl(array $options): string
|
||||||
{
|
{
|
||||||
@@ -138,5 +137,6 @@ class BookingUrlUtility
|
|||||||
$site = $siteFinder->getSiteByIdentifier('ep-reisen');
|
$site = $siteFinder->getSiteByIdentifier('ep-reisen');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $site->getBase() . '/buchung/maske_buchung.php?' . http_build_query($query); }
|
return $site->getBase() . '/buchung/maske_buchung.php?' . http_build_query($query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ class CookieUtility
|
|||||||
{
|
{
|
||||||
const COOKIENAME_TRK = 'ep_trk';
|
const COOKIENAME_TRK = 'ep_trk';
|
||||||
const COOKIETTL_TRK = 30;
|
const COOKIETTL_TRK = 30;
|
||||||
const COOKIENAME_BPN = 'bpn_cookie';
|
|
||||||
const PATTERN = '/^PA\d{3,4}$/';
|
const PATTERN = '/^PA\d{3,4}$/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,18 +29,6 @@ class CookieUtility
|
|||||||
return $cookieValue;
|
return $cookieValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string|null
|
|
||||||
*/
|
|
||||||
public static function getBpnCookie()
|
|
||||||
{
|
|
||||||
if (!isset($_COOKIE[static::COOKIENAME_BPN])) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $_COOKIE[static::COOKIENAME_BPN];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $code
|
* @param string $code
|
||||||
* @return string
|
* @return string
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ namespace EP\EpTheme\DataProcessing;
|
|||||||
|
|
||||||
use EP\EpProducts\Service\ResellerDataService;
|
use EP\EpProducts\Service\ResellerDataService;
|
||||||
use EP\EpProducts\Traits\DbConnectionTrait;
|
use EP\EpProducts\Traits\DbConnectionTrait;
|
||||||
use EP\EpProducts\Utility\CookieUtility;
|
|
||||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
||||||
@@ -65,15 +64,11 @@ class ContextProcessor implements DataProcessorInterface
|
|||||||
}
|
}
|
||||||
if ($data['tx_eptheme_context_pacode']) {
|
if ($data['tx_eptheme_context_pacode']) {
|
||||||
$processedData['context']['paCode'] = $data['tx_eptheme_context_pacode'];
|
$processedData['context']['paCode'] = $data['tx_eptheme_context_pacode'];
|
||||||
} else {
|
// Disabled, not working anyways, reseller subdomains are not registered since TYPO3 10.*
|
||||||
$resellerData = $this->getResellerData();
|
// } elseif ($resellerData = $this->getResellerData()) {
|
||||||
if ($resellerData) {
|
// $processedData['context']['paCode'] = $resellerData['paCode'];
|
||||||
$processedData['context']['paCode'] = $resellerData['paCode'];
|
} elseif ($paCode = $this->getPaCodeFromRequest()) {
|
||||||
} elseif ($paCode = $this->getPaCodeFromRequest()) {
|
$processedData['context']['paCode'] = $paCode;
|
||||||
$processedData['context']['paCode'] = $paCode;
|
|
||||||
} elseif ($cookieData = CookieUtility::getPaCookie()) {
|
|
||||||
$processedData['context']['paCode'] = $cookieData;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $processedData;
|
return $processedData;
|
||||||
@@ -107,10 +102,7 @@ class ContextProcessor implements DataProcessorInterface
|
|||||||
parse_str($query, $items);
|
parse_str($query, $items);
|
||||||
|
|
||||||
if (array_key_exists('pa', $items)) {
|
if (array_key_exists('pa', $items)) {
|
||||||
$paCode = $items['pa'];
|
return $items['pa'];
|
||||||
CookieUtility::setPaCookie($paCode);
|
|
||||||
|
|
||||||
return $paCode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
Reference in New Issue
Block a user