From 1ba932035abc1c11a573eb376884e109384e3a48 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 7 Nov 2022 15:44:38 -0600 Subject: [PATCH 1/2] Add gift_details type to response cart --- packages/shopping-cart/src/types.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/shopping-cart/src/types.ts b/packages/shopping-cart/src/types.ts index 1e956a259eea76..71a36255038036 100644 --- a/packages/shopping-cart/src/types.ts +++ b/packages/shopping-cart/src/types.ts @@ -312,6 +312,11 @@ export interface ResponseCart< P = ResponseCartProduct > { */ credits_display: string; + /** + * Gift Details + */ + gift_details?: ResponseCartGiftDetails; + currency: string; allowed_payment_methods: string[]; coupon: string; @@ -588,6 +593,11 @@ export interface ResponseCartProductExtra { is_marketplace_product?: boolean; } +export interface ResponseCartGiftDetails { + receiver_blog_id: number; + receiver_blog_url?: string; +} + export interface RequestCartProductExtra extends ResponseCartProductExtra { purchaseId?: string; isJetpackCheckout?: boolean; From dfb6801fe52541b4b29a3147f677e092a56dd58b Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 7 Nov 2022 15:45:12 -0600 Subject: [PATCH 2/2] Fall through to the gift blog URL --- .../components/wp-checkout-order-review.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-review.tsx b/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-review.tsx index 80fbcc99c2baa7..9383acdb7e655e 100644 --- a/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-review.tsx +++ b/client/my-sites/checkout/composite-checkout/components/wp-checkout-order-review.tsx @@ -124,7 +124,11 @@ export default function WPCheckoutOrderReview( { ( product ) => isDomainTransfer( product ) || isDomainRegistration( product ) || isDomainMapping( product ) ); - const domainUrl = primaryDomain ?? firstDomainProduct?.meta ?? siteUrl; + const domainUrl = + primaryDomain ?? + firstDomainProduct?.meta ?? + responseCart?.gift_details?.receiver_blog_url ?? + siteUrl; const removeCouponAndClearField = () => { couponFieldStateProps.setCouponFieldValue( '' );