khanegi setting and prices records
This commit is contained in:
@@ -18,7 +18,7 @@ class ProductDisplayPriceService
|
||||
{
|
||||
public const LIVE_PRICE_CACHE_KEY = 'live_price_api_payload';
|
||||
|
||||
public const LIVE_PRICE_CACHE_SECONDS = 45;
|
||||
public const LIVE_PRICE_CACHE_SECONDS = 15;
|
||||
|
||||
public function usesAppPrice(Product $product): bool
|
||||
{
|
||||
@@ -262,6 +262,18 @@ class ProductDisplayPriceService
|
||||
/** @param array<int, array<string, mixed>> $feed */
|
||||
private function applyReferenceFeedPrice(Product $product, array $feed, ZaarboxPriceService $zaarbox): void
|
||||
{
|
||||
if (Product::hasStoredPriceColumns()) {
|
||||
$stored = (int) ($product->price ?? 0) + (int) ($product->price_profit ?? 0);
|
||||
if ($stored > 0) {
|
||||
$product->setAttribute('price', (int) ($product->price ?? 0));
|
||||
if (Schema::hasColumn($product->getTable(), 'price_profit')) {
|
||||
$product->setAttribute('price_profit', (int) ($product->price_profit ?? 0));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$row = $zaarbox->findFeedRow($feed, (string) $product->reading_method);
|
||||
if ($row === null) {
|
||||
$useLast = $this->productUsesLastPriceIfZero($product);
|
||||
|
||||
Reference in New Issue
Block a user