fix(sse): send per-product trade_open from server trading hours
The list stream must tell clients whether each product is open so the device clock cannot reopen a closed shop. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -715,7 +715,10 @@ class ProductController extends SuperController
|
||||
$displayPriceService = app(ProductDisplayPriceService::class);
|
||||
$displayPriceService->warmLivePriceCache();
|
||||
$displayPriceService->enrichForApi($products);
|
||||
$products->each(function (Product $product) use ($displayPriceService) {
|
||||
$config = app(ConfigService::class);
|
||||
$products->each(function (Product $product) use ($displayPriceService, $config) {
|
||||
$tradeOpen = $config->isProductWithinTradingHours($product);
|
||||
$product->setAttribute('trade_open', $tradeOpen);
|
||||
$product->setAttribute('show', $displayPriceService->resolveCustomerShow($product));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user