CASH-2402 use selected item for determining part number instead of amt

CASH-2402 use selected item for determining part number instead of amount.  Amount will be driven by the price service
This commit is contained in:
CarlNation 2026-02-24 13:05:05 -05:00
parent 15ecb19fa6
commit 0042cc47be
3 changed files with 15 additions and 21 deletions

View file

@ -31,23 +31,15 @@
<div class="donation-slider my-4">
<input
name="amount"
id="one"
id="zero"
type="radio"
:value="donationValues[0]"
checked />
<label for="one" class="label">$1</label>
<input
name="amount"
id="three"
type="radio"
:value="donationValues[1]" />
<label for="three" class="label">$3</label>
<input
name="amount"
id="five"
type="radio"
:value="donationValues[2]" />
<label for="five" class="label">$5</label>
<label for="zero" class="label">${{ donationValues[0] }}</label>
<input name="amount" id="one" type="radio" :value="donationValues[1]" />
<label for="one" class="label">${{ donationValues[1] }}</label>
<input name="amount" id="two" type="radio" :value="donationValues[2]" />
<label for="two" class="label">${{ donationValues[2] }}</label>
<div class="indicator-bar"></div>
</div>
</div>
@ -264,17 +256,17 @@ export default {
background: $blue;
}
input {
&#one:checked {
&#zero:checked {
~ .indicator-bar {
transform: translateX(2rem);
}
}
&#three:checked {
&#one:checked {
~ .indicator-bar {
transform: translateX(calc(100% + 2rem));
}
}
&#five:checked {
&#two:checked {
~ .indicator-bar {
transform: translateX(calc(200% + 2rem));
}

View file

@ -470,7 +470,8 @@ export default {
}
},
donationValues() {
return [1, 3, 5];
var donationAmounts = this.getCmsContent("DonationAmountsWidget", "Text");
return donationAmounts.split(",").map(Number);
},
lineItemsWithoutDonation() {
const lineItemsClone = deepClone(this.lineItems);
@ -531,10 +532,11 @@ export default {
window.location.assign(location.protocol + "//" + location.host);
},
async addDonationToOrder() {
const selectedItemNumber = this.donationValues.indexOf(Number(this.donationAmount));
const donationResponse = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.SUBMIT_DONATION_PART_TO_SV2,
{
donationAmount: parseInt(this.donationAmount),
selectedItemNumber: selectedItemNumber,
submittedOrder: this.submittedOrder,
},
false

View file

@ -2126,14 +2126,14 @@ export const actions = {
},
async submitDonationPartToSV2(
context,
{ payload: { donationAmount, submittedOrder }, pageNameToLog }
{ payload: { selectedItemNumber, submittedOrder }, pageNameToLog }
) {
const state = JSON.parse(
window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)
);
const order = state.order;
const payload = {
donationAmount: parseInt(donationAmount),
selectedItemNumber: selectedItemNumber,
savedSessionId: state.applicationUser.savedSessionId,
paymentInfo: {
parentAccountNumber: order.payment.parentAccountNumber,