diff --git a/static/js/src/advantage/credentials/components/CredExamShop/CredExamShop.tsx b/static/js/src/advantage/credentials/components/CredExamShop/CredExamShop.tsx index 3f8ed5ed559..9b7be466f41 100644 --- a/static/js/src/advantage/credentials/components/CredExamShop/CredExamShop.tsx +++ b/static/js/src/advantage/credentials/components/CredExamShop/CredExamShop.tsx @@ -18,17 +18,23 @@ const CredExamShop = () => { { id: "cue-linux-essentials", name: "CUE.01 Linux", + displayName: "CUE.01 Linux", metadata: [ { key: "description", value: "Prove your basic operational knowledge of Linux by demonstrating your ability to secure, operate and maintain basic system resources. Topics include user and group management, file and filesystem navigation, and logs and installation tasks related to system maintenance.", }, + { + key: "originalPrice", + value: "10000", + }, ], }, { id: "cue-02-desktop", name: "CUE.02 Desktop", + displayName: "CUE.02 Desktop", metadata: [ { key: "description", @@ -40,6 +46,7 @@ const CredExamShop = () => { { id: "cue-03-server", name: "CUE.03 Server", + displayName: "CUE.03 Server", metadata: [ { key: "description", @@ -121,7 +128,7 @@ const CredExamShop = () => { { className="u-align--right" style={{ paddingRight: "1rem" }} > - {examElement.price === undefined - ? "Coming Soon!" - : "Price: " + - currencyFormatter.format( + {examElement.price === undefined ? ( + Coming Soon + ) : ( + + Price:{" "} + {examElement.metadata[1].value !== undefined ? ( + + {currencyFormatter.format( + parseInt(examElement.metadata[1].value) / 100 + )} + + ) : ( + <> + )}{" "} + {currencyFormatter.format( examElement.price.value / 100 )} + + )} @@ -162,7 +182,7 @@ const CredExamShop = () => { > { className="u-align--right" style={{ paddingRight: "1rem" }} > - {examElement.price === undefined - ? "Coming Soon!" - : "Price: " + - currencyFormatter.format(examElement.price.value / 100)} + {examElement.price === undefined ? ( + Coming Soon + ) : ( + + Price:{" "} + {examElement.metadata[1].value !== undefined ? ( + + {currencyFormatter.format( + parseInt(examElement.metadata[1].value) / 100 + )} + + ) : ( + <> + )}{" "} + {currencyFormatter.format( + examElement.price.value / 100 + )} + + )} @@ -198,7 +233,7 @@ const CredExamShop = () => {

- {ExamProducts[exam]?.name} + {ExamProducts[exam]?.displayName}

diff --git a/static/js/src/advantage/credentials/utils/utils.ts b/static/js/src/advantage/credentials/utils/utils.ts index e8347537422..f755d57c1e9 100644 --- a/static/js/src/advantage/credentials/utils/utils.ts +++ b/static/js/src/advantage/credentials/utils/utils.ts @@ -6,8 +6,10 @@ export type Product = { price?: { value: number; currency: string; + original?: number; }; id: string; marketplace?: UserSubscriptionMarketplace; metadata: Array<{ key: string; value: string }>; + displayName?: string; }; diff --git a/static/js/src/advantage/subscribe/checkout/components/BuyButton/BuyButton.tsx b/static/js/src/advantage/subscribe/checkout/components/BuyButton/BuyButton.tsx index ef173e73a2a..be11eefb2f4 100644 --- a/static/js/src/advantage/subscribe/checkout/components/BuyButton/BuyButton.tsx +++ b/static/js/src/advantage/subscribe/checkout/components/BuyButton/BuyButton.tsx @@ -315,9 +315,15 @@ const BuyButton = ({ setError, quantity, product, action }: Props) => { if (request.readyState === 4) { localStorage.removeItem("shop-checkout-data"); if (product.marketplace == "canonical-cube") { - location.href = `/credentials/shop/order-thank-you?productName=${encodeURIComponent( - product.name - )}&quantity=${quantity}`; + if (product.name === "cue-linux-essentials-free") { + location.href = `/credentials/shop/order-thank-you?productName=${encodeURIComponent( + "CUE.01 Linux" + )}&quantity=${quantity}`; + } else { + location.href = `/credentials/shop/order-thank-you?productName=${encodeURIComponent( + product.name + )}&quantity=${quantity}`; + } } else if (!window.loginSession) { const email = userInfo?.customerInfo?.email || values.email || ""; let urlBase = "/pro/subscribe"; diff --git a/static/js/src/advantage/subscribe/checkout/components/Summary/Summary.tsx b/static/js/src/advantage/subscribe/checkout/components/Summary/Summary.tsx index a03c9167e57..490d5446aec 100644 --- a/static/js/src/advantage/subscribe/checkout/components/Summary/Summary.tsx +++ b/static/js/src/advantage/subscribe/checkout/components/Summary/Summary.tsx @@ -55,7 +55,11 @@ function Summary({ quantity, product, action, setError }: Props) { ? "Plan type" : "Products"; const productName = - action !== "offer" ? product?.name : product?.name.replace(", ", "
"); + action !== "offer" + ? product?.name === "cue-linux-essentials-free" + ? "CUE.01 Linux" + : product?.name + : product?.name.replace(", ", "
"); const discount = (product?.price?.value * ((product?.price?.discount ?? 0) / 100)) / 100; const defaultTotal = (product?.price?.value * quantity) / 100 - discount; @@ -124,6 +128,7 @@ function Summary({ quantity, product, action, setError }: Props) { <> {total == 0 && priceData !== undefined && + product?.name !== "cue-linux-essentials-free" && "This is because you have likely already paid for this product for the current billing period."}