Sell on Webflow
Sell RevKeen products from a Webflow site, with a buy link to a checkout link or the RevKeen Embed cart drawer.
There are two ways to sell from a Webflow site:
| Buy link | Cart drawer (RevKeen Embed) | |
|---|---|---|
| What the buyer gets | One product, straight to hosted checkout | Add several products, then check out |
| Setup in RevKeen | A checkout link | A Cart publishable key and registered origins |
| Custom code in Webflow | None | One script tag |
Option 1: a buy link
-
In RevKeen, create a checkout link in Dashboard > Products > Checkout Links and copy its URL (
https://pay.revkeen.com/l/<link id>; links oncheckout.revkeen.comwork too). -
In Webflow, add a Link Block or Button and set its URL to the checkout link, followed by
?rk_channel=webflow:https://pay.revkeen.com/l/<link id>?rk_channel=webflow -
Publish.
No key and no origin registration are needed: the checkout link is a public URL, and checkout works out the amount on RevKeen's servers. If you also type a price next to the button, keep it in step with the link yourself; the buyer is always charged the link's price as shown at checkout.
rk_channel=webflow tags the checkout with the site it came from. Recording that value against the order is being added and is not yet shown anywhere; checkout ignores it until then.
Option 2: the cart drawer
Follow Embed for the script and attributes. The Webflow-specific steps:
- Register your origins first. In Dashboard > Commerce > Embed, register the
.webflow.iostaging address you test on, for examplehttps://your-site.webflow.io, and later your custom domain, for examplehttps://www.example.com. Each is its own registration, andwwwand the bare domain are separate. A page on an unregistered origin is refused with403 origin_not_allowed. - Issue the Cart publishable key on the same page. It is shown once; copy it then.
- Add the script in Site settings > Custom code > Footer code. Custom code runs only on the published site, not in the Designer.
- Add buttons. Select a button and add custom attributes in its element settings:
data-revkeen-product-idwith the RevKeen product id, and the classrevkeen-add-to-cart. Use classrevkeen-checkout-linkinstead for a buy-now button, anddata-revkeen-carton the element that opens the drawer. - Publish to the
.webflow.ioaddress and make a test purchase before you connect or publish to your custom domain.
Troubleshooting
| What you see | Cause | Fix |
|---|---|---|
| Nothing happens in the Designer | Custom code does not run in the Designer | Test on the published site |
Works on .webflow.io, refused on your domain | The custom domain is not registered | Register the exact domain, including www. if the site uses it |
403 origin_not_allowed, or a CORS error in the console | The origin in the address bar is not registered for this merchant | Register that exact origin, then hard-reload |
| The cart opens but a product is missing | The product is inactive or has no price | Price the product in RevKeen, then retry |
Related
Owner: david