From 22b17e3a57fbfaf7fd196687d5f1dadab0ec812f Mon Sep 17 00:00:00 2001 From: Vitor Date: Mon, 27 Jul 2026 18:26:13 -0300 Subject: [PATCH] fix(storefront): Show cash discount price in product JSON-LD Product JSON-LD offers now apply the store's configured payment discount (settings.modules.list_payments.discount_option), reusing getPriceWithDiscount from use-prices. Falls back to the regular price when no discount is configured, so behavior is unchanged for stores that don't set it. --- packages/storefront/src/lib/layouts/BaseHead.astro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/storefront/src/lib/layouts/BaseHead.astro b/packages/storefront/src/lib/layouts/BaseHead.astro index e404500c9..2a5ee9c70 100644 --- a/packages/storefront/src/lib/layouts/BaseHead.astro +++ b/packages/storefront/src/lib/layouts/BaseHead.astro @@ -8,6 +8,7 @@ import { inStock as checkInStock, } from '@ecomplus/utils'; import { i19searchProducts } from '@@i18n'; +import { getPriceWithDiscount } from '@@sf/composables/use-prices'; // @ts-ignore const isPWA = pwaInfo !== false; // config/astro/mock-pwa-info.mjs @@ -211,7 +212,10 @@ if (apiContext.resource === 'products' && apiContext.doc) { url: canonicalUrl, availability: `${(checkInStock(product) ? 'In' : 'OutOf')}Stock`, priceCurrency: settings.currency, - price: getPrice(product), + price: getPriceWithDiscount( + getPrice(product), + settings.modules?.list_payments?.discount_option || {}, + ), itemCondition: 'http://schema.org/' + `${(product.condition !== 'new' ? 'Used' : 'New')}Condition`, seller: {