From 3483bfa747716329d8e093e8f186e01b4c5915f5 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 12 May 2021 14:28:54 +0100 Subject: [PATCH] Updated `@price` data to not use archived prices no-issue Since we now allow archiving prices, we should filter them out from being considered the monthly or yearly plan, as they are unable to be subscribed to. --- core/frontend/services/theme-engine/middleware.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/frontend/services/theme-engine/middleware.js b/core/frontend/services/theme-engine/middleware.js index 4fe90402b0..6e3d6029f5 100644 --- a/core/frontend/services/theme-engine/middleware.js +++ b/core/frontend/services/theme-engine/middleware.js @@ -76,7 +76,11 @@ async function haxGetMembersPriceData() { const defaultProduct = products[0]; - const nonZeroPrices = defaultProduct.stripe_prices.filter((price) => { + const activePrices = defaultProduct.stripe_prices.filter((price) => { + return price.active; + }); + + const nonZeroPrices = activePrices.filter((price) => { return price.amount !== 0; });