Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing embedded checkout #1430

Open
techdaddies-kevin opened this issue May 4, 2022 · 2 comments
Open

Customizing embedded checkout #1430

techdaddies-kevin opened this issue May 4, 2022 · 2 comments

Comments

@techdaddies-kevin
Copy link

I started a discussion on this repo, but it got no traction. Bigcommerce support will not assist either. Hopefully the devs can help clear up the issue.

I know that we can customize the embedded checkout slightly with onLoad and onComplete events docs but I'm having a terrible time trying to figure out how to actually set up the event syntactically.

Basically, we're using the BigCommerce Wordpress plugin with embedded checkout. The plugin passes the configuration of the checkout via a data-js property, and we can customize that. I have tried various configurations of passing JSON objects into this, but no matter what I do, I cannot get my custom JS to execute. I cannot figure out what syntax the SDK is looking for. All I can create is JS errors in trying to figure out the format.

Any help would be appreciated. If I can just see an example of the data-js JSON that the SDK needs to fire an onLoad event, I can take that and implement it into the WP plugin. But that syntax is the spot we're stuck on currently and my JS chops aren't good enough to figure out what the SDK wants to see.

@bc-peng
Copy link
Contributor

bc-peng commented May 5, 2022

Hi, thanks for posting this.
If I understood you correctly, the config you are seeking for should be this line. The method to load embedded checkout is here. Think you could follow the config to launch an embedded checkout page.

@techdaddies-kevin
Copy link
Author

Yes, that's the line where the Wordpress plugin generates an array of configuration options that is passed to the embedded checkout container. My issue is that I cannot figure out the syntax that the Checkout SDK wants for the events. For example, let's say we want to just do an

alert('test');

in the onLoad event. How would that look in the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants