Fix reseller export
This commit is contained in:
@@ -25,10 +25,17 @@ class FacebookCatalogCsvFormatter
|
||||
];
|
||||
|
||||
foreach ($data['product'] as $product) {
|
||||
if (!isset($product['hotels']['hotel'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$minPrice = 0;
|
||||
$available = 0;
|
||||
|
||||
foreach ($product['hotels']['hotel'] as $hotel) {
|
||||
if (!isset($hotel['dates']['date'])) {
|
||||
continue;
|
||||
}
|
||||
foreach ($hotel['dates']['date'] as $date) {
|
||||
if ($minPrice === 0 || $date['minprice'] < $minPrice) {
|
||||
$minPrice = $date['minprice'];
|
||||
|
||||
+7
@@ -22,10 +22,17 @@ class GoogleBusinessFeedCsvFormatter
|
||||
];
|
||||
|
||||
foreach ($data['product'] as $product) {
|
||||
if (!isset($product['hotels']['hotel'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$minPrice = 0;
|
||||
$available = 0;
|
||||
|
||||
foreach ($product['hotels']['hotel'] as $hotel) {
|
||||
if (!isset($hotel['dates']['date'])) {
|
||||
continue;
|
||||
}
|
||||
foreach ($hotel['dates']['date'] as $date) {
|
||||
if ($minPrice === 0 || $date['minprice'] < $minPrice) {
|
||||
$minPrice = $date['minprice'];
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace EP\EpProducts\Domain\Serialization;
|
||||
|
||||
use EP\EpProducts\Domain\Model\Fact;
|
||||
use EP\EpProducts\Utility\SerializationUtility;
|
||||
use TYPO3\CMS\Core\Site\SiteFinder;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class Product
|
||||
{
|
||||
@@ -84,8 +86,14 @@ class Product
|
||||
];
|
||||
}
|
||||
|
||||
$link = $entity->getExternalLink() ?: $entity->getDetailPage();
|
||||
$product['link'] = SerializationUtility::generateLink($link, $queryData);
|
||||
if ($entity->getExternalLink()) {
|
||||
$product['link'] = $entity->getExternalLink();
|
||||
} else {
|
||||
/** @var SiteFinder $siteFinder */
|
||||
$siteFinder = GeneralUtility::makeInstance(SiteFinder::class);
|
||||
$site = $siteFinder->getSiteByIdentifier('ep-reisen');
|
||||
$product['link'] = $site->getRouter()->generateUri($entity->getDetailPage(), $queryData);
|
||||
}
|
||||
|
||||
$product['region'] = Region::fromEntity($entity->getRegion());
|
||||
$product['city'] = City::fromEntity($entity->getCity());
|
||||
|
||||
@@ -91,29 +91,6 @@ class SerializationUtility
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $parameter
|
||||
* @param array $queryData
|
||||
* @return string
|
||||
*/
|
||||
public static function generateLink($parameter, array $queryData = [])
|
||||
{
|
||||
if (static::$contentObject === null) {
|
||||
/** @var ContentObjectRenderer $contentObject */
|
||||
static::$contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class);
|
||||
}
|
||||
|
||||
$url = static::$contentObject->typoLink_URL([ 'parameter' => $parameter, 'forceAbsoluteUrl' => true ]);
|
||||
|
||||
if ($queryData) {
|
||||
$query = http_build_query($queryData);
|
||||
$divider = strpos($url, '?') !== false ? '&' : '?';
|
||||
$url .= $divider . $query;
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ImageService
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user