Skip to content

Commit

Permalink
refactor: updated variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
zubair-ce07 committed Apr 17, 2024
1 parent 3c796a4 commit 2a2e790
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/payment/PaymentPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ class PaymentPage extends React.Component {
if (skus !== null) {
const baseURL = getConfig().ECOMMERCE_BASE_URL;
// Constructing the URL with the sku parameters
let paymentPage = `${baseURL}/basket/add/?`;
let ecommerceBasketURL = `${baseURL}/basket/add/?`;
// Appending each sku value to the URL
Object.values(skus).forEach(sku => { paymentPage += `sku=${sku}&`; });
Object.values(skus).forEach(sku => { ecommerceBasketURL += `sku=${sku}&`; });
// Removing the extra '&' character at the end
paymentPage = paymentPage.slice(0, -1);
window.location.href = paymentPage;
ecommerceBasketURL = ecommerceBasketURL.slice(0, -1);
window.location.href = ecommerceBasketURL;
localStorage.removeItem('skus');
} else {
this.props.fetchBasket();
Expand Down

0 comments on commit 2a2e790

Please sign in to comment.