mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[IdealoBridge] Fix (#4316)
When a product was available before as used product in the past, and now it's not available used anymore, a price update article was generated on every feed loading, because the old used price was still stored in the cache, and therefore different as "no price". The issue was also present in the cas of a New product price that becomes unavailable. Now, when either there is no New or Used price available, the previous price is delete from the cache.
This commit is contained in:
parent
29d984cbe7
commit
bd0fb1da99
1 changed files with 7 additions and 0 deletions
|
@ -152,14 +152,21 @@ class IdealoBridge extends BridgeAbstract
|
|||
$PriceNew = $FirstButton->find('strong', 0)->plaintext;
|
||||
// Save current price
|
||||
$this->saveCacheValue($KeyNEW, $PriceNew);
|
||||
} else if ($FirstButton === null) {
|
||||
// In case there is no actual New Price delete the previous value in the cache
|
||||
$this->cache->delete($this->getShortName() . '_' . $KeyNEW);
|
||||
}
|
||||
|
||||
|
||||
// Second Button contains the used product price
|
||||
$SecondButton = $html->find('.oopStage-conditionButton-wrapper-text', 1);
|
||||
if ($SecondButton) {
|
||||
$PriceUsed = $SecondButton->find('strong', 0)->plaintext;
|
||||
// Save current price
|
||||
$this->saveCacheValue($KeyUSED, $PriceUsed);
|
||||
} else if ($SecondButton === null) {
|
||||
// In case there is no actual Used Price delete the previous value in the cache
|
||||
$this->cache->delete($this->getShortName() . '_' . $KeyUSED);
|
||||
}
|
||||
|
||||
// Only continue if a price has changed
|
||||
|
|
Loading…
Add table
Reference in a new issue