Skip to content

Commit

Permalink
zbozi and heureka XML feeds: return value of FEED_DELIVERY_DAYS_FOR_O…
Browse files Browse the repository at this point in the history
…UT_OF_STOCK_PRODUCTS setting for out of stock sellable products

- ProductAvailabilityFacade::getProductAvailabilityDaysByDomainId() renamed to getProductAvailabilityDaysForFeedsByDomainId and returns the setting value for the out of stock products
- ZboziProductRepository and HeurekaProductRepository refactored to use getAllSellableWithoutInquiriesQueryBuilder
  • Loading branch information
vitek-rostislav committed Dec 2, 2024
1 parent c6ecf67 commit a6e8a6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Model/FeedItem/MergadoFeedItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function createForProduct(Product $product, DomainConfig $domainConfig):
$this->productUrlsBatchLoader->getProductUrl($product, $domainConfig),
$this->categoryFacade->getCategoryNamesInPathFromRootToProductMainCategoryOnDomain($product, $domainConfig),
$this->getProductUsp($product, $domainId),
$this->availabilityFacade->isProductAvailableOnDomainCached($product, $domainId) ? 0 : $this->setting->getForDomain(Setting::FEED_DELIVERY_DAYS_FOR_OUT_OF_STOCK_PRODUCTS, $domainId),
$this->availabilityFacade->getProductAvailabilityDaysForFeedsByDomainId($product, $domainId),
$this->productPriceCalculationForCustomerUser->calculatePriceForCustomerUserAndDomainId($product, $domainId),
$this->getOtherProductImages($product, $domainConfig),
$this->productParametersBatchLoader->getProductParametersByName($product, $domainConfig),
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/MergadoFeedItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ private function doSetUp(bool $isProductAvailableOnStock): void
$this->pricingGroupSettingFacadeMock = $this->createMock(PricingGroupSettingFacade::class);
$this->loggerMock = $this->createMock(LoggerInterface::class);
$this->settingMock = $this->createMock(Setting::class);
$this->settingMock->method('getForDomain')->with(Setting::FEED_DELIVERY_DAYS_FOR_OUT_OF_STOCK_PRODUCTS, Domain::FIRST_DOMAIN_ID)->willReturn(self::MOCKED_SETTING_FEED_DELIVERY_DAYS_FOR_OUT_OF_STOCK_PRODUCTS);

$this->productAvailabilityFacadeMock = $this->createMock(ProductAvailabilityFacade::class);
$this->productAvailabilityFacadeMock->method('isProductAvailableOnDomainCached')->willReturn($isProductAvailableOnStock);
$this->productAvailabilityFacadeMock->method('getProductAvailabilityDaysForFeedsByDomainId')->willReturn($isProductAvailableOnStock ? 0 : self::MOCKED_SETTING_FEED_DELIVERY_DAYS_FOR_OUT_OF_STOCK_PRODUCTS);

$this->mergadoFeedItemFactory = new MergadoFeedItemFactory(
$this->productUrlsBatchLoaderMock,
Expand Down

0 comments on commit a6e8a6f

Please sign in to comment.