Fix reseller export
This commit is contained in:
@@ -25,10 +25,17 @@ class FacebookCatalogCsvFormatter
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($data['product'] as $product) {
|
foreach ($data['product'] as $product) {
|
||||||
|
if (!isset($product['hotels']['hotel'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$minPrice = 0;
|
$minPrice = 0;
|
||||||
$available = 0;
|
$available = 0;
|
||||||
|
|
||||||
foreach ($product['hotels']['hotel'] as $hotel) {
|
foreach ($product['hotels']['hotel'] as $hotel) {
|
||||||
|
if (!isset($hotel['dates']['date'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
foreach ($hotel['dates']['date'] as $date) {
|
foreach ($hotel['dates']['date'] as $date) {
|
||||||
if ($minPrice === 0 || $date['minprice'] < $minPrice) {
|
if ($minPrice === 0 || $date['minprice'] < $minPrice) {
|
||||||
$minPrice = $date['minprice'];
|
$minPrice = $date['minprice'];
|
||||||
|
|||||||
+7
@@ -22,10 +22,17 @@ class GoogleBusinessFeedCsvFormatter
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($data['product'] as $product) {
|
foreach ($data['product'] as $product) {
|
||||||
|
if (!isset($product['hotels']['hotel'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$minPrice = 0;
|
$minPrice = 0;
|
||||||
$available = 0;
|
$available = 0;
|
||||||
|
|
||||||
foreach ($product['hotels']['hotel'] as $hotel) {
|
foreach ($product['hotels']['hotel'] as $hotel) {
|
||||||
|
if (!isset($hotel['dates']['date'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
foreach ($hotel['dates']['date'] as $date) {
|
foreach ($hotel['dates']['date'] as $date) {
|
||||||
if ($minPrice === 0 || $date['minprice'] < $minPrice) {
|
if ($minPrice === 0 || $date['minprice'] < $minPrice) {
|
||||||
$minPrice = $date['minprice'];
|
$minPrice = $date['minprice'];
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ namespace EP\EpProducts\Domain\Serialization;
|
|||||||
|
|
||||||
use EP\EpProducts\Domain\Model\Fact;
|
use EP\EpProducts\Domain\Model\Fact;
|
||||||
use EP\EpProducts\Utility\SerializationUtility;
|
use EP\EpProducts\Utility\SerializationUtility;
|
||||||
|
use TYPO3\CMS\Core\Site\SiteFinder;
|
||||||
|
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||||
|
|
||||||
class Product
|
class Product
|
||||||
{
|
{
|
||||||
@@ -84,8 +86,14 @@ class Product
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = $entity->getExternalLink() ?: $entity->getDetailPage();
|
if ($entity->getExternalLink()) {
|
||||||
$product['link'] = SerializationUtility::generateLink($link, $queryData);
|
$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['region'] = Region::fromEntity($entity->getRegion());
|
||||||
$product['city'] = City::fromEntity($entity->getCity());
|
$product['city'] = City::fromEntity($entity->getCity());
|
||||||
|
|||||||
@@ -91,29 +91,6 @@ class SerializationUtility
|
|||||||
return $data;
|
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
|
* @return ImageService
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user