Add a slide out window for your checkout on your Webflow, Wordpress, or HTML website.
This tutorial uses two FREE plugins. If you are using different plugins please refer to their documentation on how to complete the following steps.
Implement the Javascript.
From your Wordpress dashboard, navigate to the HFCM dropdown and select Add New.
Fill out all required fields and make sure your selections match what is below.
Copy and paste the script into the Snippet/Code section and then select "Save".
Implement the CSS.
Add a New Snippet for the CSS and make sure your selections match what is below.
Copy and paste the CSS into the Snippet/Code section and then select "Save".
Implement the button class.
Add a button element, open the Advanced tab and enter the CSS class name in the CSS Classes field.
Add HTML element for slide out HTML.
First, add a HTML element at the top of your page and paste in the HTML code.
Next, retrieve your Embed Code from your SamCart account by going to Product Edit and then the Checkout Anywhere tab.
Select "Embed" from the Display Options and select the "Copy Embed Code" button.
Now paste your SamCart Embed code in place of this line of code in your Wordpress HTML element:
This is an example of what the final HTML code should look like:
The button class "w-btn" will only work with one button instance, but if you have multiple buttons on your page we have a solution for that!
To have a second, third, or fourth button open your Slide Checkout, first just add "-x" at the end of the class name ("x" should be a unique number).
The second part of this is that you will also need to adjust the script to add in additional button triggers. Copy everything from "document" to "});" and just change the selector "w-btn" to the new class you've created. Make sure to do this for each new class you've created. Also, only create as many script additions as you need because any extras will break the script.
Implement the two code blocks in the appropriate places in your Webflow Page settings.
Copy the <style> and paste into the <head> of your page.
Copy the <script> and paste it before the </body> of your page.
Add a button element and implement the button class.
Add a button on your page that will trigger the slide. Give it the class name below in Webflow's Style selector.
Note that the class will only work with one button instance. If you need more than one button to open up the Slide Checkout, scroll down for guidance.
Add an embed element for the slide HTML.
First, add an Embed element and put it at the bottom of your page. Open up the HTML element and paste in the code below.
Next, retrieve your Embed Code from your SamCart account by going to Product Edit and then the Checkout Anywhere tab.
Select "Embed" from the Display Options and select the "Copy Embed Code" button.
Now paste your SamCart Embed code below this line of code in your Webflow HTML element:
This is an example of what the final HTML code should look like:
The button class "w-btn" will only work with one button instance, but if you have multiple buttons on your page we have a solution for that!
To have a second, third, or fourth button open your Slide Checkout, first just add "-x" at the end of the class name ("x" should be a unique number).
The second part of this is that you will also need to go back and adjust the script to add in additional button triggers. Copy everything from "document" to "});" and just change the selector "w-btn" to the new class you've created. Make sure to do this for each new class you've created. Also, only create as many script additions as you need because any extras will break the script.