diff --git a/src/components/CorporateCampaign/CampaignLoanGridDisplay.vue b/src/components/CorporateCampaign/CampaignLoanGridDisplay.vue index 2a5e1e8756..6fa4c8234c 100644 --- a/src/components/CorporateCampaign/CampaignLoanGridDisplay.vue +++ b/src/components/CorporateCampaign/CampaignLoanGridDisplay.vue @@ -15,6 +15,7 @@ :custom-loan-details="true" :custom-checkout-button-text="getCheckoutBtnText(loan)" :checkout-route="checkoutRoute" + :use-emitted-add-to-basket="true" @show-loan-details="showLoanDetails(loans[index])" @add-to-basket="addToBasket" @custom-checkout-button-action="removeLoanFromBasket(loan)" diff --git a/src/components/CorporateCampaign/CampaignLoanRow.vue b/src/components/CorporateCampaign/CampaignLoanRow.vue index 5ddbdef9b0..738c1770d3 100644 --- a/src/components/CorporateCampaign/CampaignLoanRow.vue +++ b/src/components/CorporateCampaign/CampaignLoanRow.vue @@ -40,6 +40,7 @@ :checkout-route="checkoutRoute" :custom-loan-details="true" :custom-checkout-button-text="getCheckoutBtnText(loan)" + :use-emitted-add-to-basket="true" @show-loan-details="showLoanDetails(loans[index])" @add-to-basket="addToBasket" @custom-checkout-button-action="removeLoanFromBasket(loan)" diff --git a/src/components/LoanCards/KivaClassicBasicLoanCard.vue b/src/components/LoanCards/KivaClassicBasicLoanCard.vue index c1be6234cc..0eee689326 100644 --- a/src/components/LoanCards/KivaClassicBasicLoanCard.vue +++ b/src/components/LoanCards/KivaClassicBasicLoanCard.vue @@ -324,6 +324,10 @@ export default { enableFiveDollarsNotes: { type: Boolean, default: false + }, + useEmittedAddToBasket: { + type: Boolean, + default: false } }, inject: ['apollo', 'cookieStore'], @@ -537,7 +541,11 @@ export default { if (this.loan) this.isLoading = false; this.basketItems = result.data?.shop?.basket?.items?.values || null; }, - addToBasket() { + addToBasket(payload) { + if (this.useEmittedAddToBasket) { + this.$emit('add-to-basket', payload); + return true; + } this.isAdding = true; setLendAmount({ amount: this.lendAmount,