Skip to content

Commit

Permalink
Merge pull request #567 from commercelayer/fix/buy-now-mode
Browse files Browse the repository at this point in the history
Change checkout url using the buy now mode
  • Loading branch information
acasazza authored Aug 4, 2024
2 parents b1e3213 + 6783da9 commit c4db03f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export function CheckoutLink(props: Props): JSX.Element {
): void {
e.preventDefault()
e.stopPropagation()
console.log('e.currentTarget.href', e.currentTarget.href)
const currentHref = e.currentTarget.href
if (accessToken && endpoint && order?.id) {
void getOrganizationConfig({
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/src/reducers/OrderReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ export async function addToCart(
const params = `${id}?accessToken=${config.accessToken ?? ''}`
const redirectUrl = checkoutUrl
? `${checkoutUrl}/${params}`
: `https://${organization}.checkout.commercelayer.app/${params}`
: `https://${organization}.commercelayer.app/checkout/${params}`
location.href = redirectUrl
} else if (openMiniCart) {
publish('open-cart')
Expand Down

0 comments on commit c4db03f

Please sign in to comment.