Skip to content

Commit

Permalink
TH-186 New themes > Express checkout > Max checkout amount error is m…
Browse files Browse the repository at this point in the history
…issing (#75)
  • Loading branch information
bj-anas authored Oct 25, 2024
1 parent ba9ef26 commit c01eaae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions themes/aura/assets/express-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ async function placeOrder() {

const response = await youcanjs.checkout.placeExpressCheckoutOrder({ productVariantId, quantity, fields });

if (response.data.status >= 400) {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = response.data.message;

const errorMessage = tempDiv.innerText || tempDiv.textContent;
throw new Error(errorMessage);
}

response
.onSuccess((data, redirectToThankyouPage) => {
redirectToThankyouPage();
Expand Down
8 changes: 8 additions & 0 deletions themes/harmony/assets/express-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ async function placeOrder() {

const response = await youcanjs.checkout.placeExpressCheckoutOrder({ productVariantId, quantity, fields });

if (response.data.status >= 400) {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = response.data.message;

const errorMessage = tempDiv.innerText || tempDiv.textContent;
throw new Error(errorMessage);
}

response
.onSuccess((data, redirectToThankyouPage) => {
redirectToThankyouPage();
Expand Down
8 changes: 8 additions & 0 deletions themes/meraki/assets/express-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ async function placeOrder() {

const response = await youcanjs.checkout.placeExpressCheckoutOrder({ productVariantId, quantity, fields });

if (response.data.status >= 400) {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = response.data.message;

const errorMessage = tempDiv.innerText || tempDiv.textContent;
throw new Error(errorMessage);
}

response
.onSuccess((data, redirectToThankyouPage) => {
redirectToThankyouPage();
Expand Down

0 comments on commit c01eaae

Please sign in to comment.