Question:
How can I create a “Buy Now” button in Wix for a single digital product (an eBook) instead of the default “Add to Cart” button? I want customers to click “Buy Now” and proceed directly to checkout without going through the cart.
Product:
Wix Editor (or Wix Stores, if applicable)
What are you trying to achieve:
I want to replace the default “Add to Cart” button with a “Buy Now” button that allows customers to purchase my eBook instantly. Currently, the “Buy Now” button does not let me connect a product, and the “Add to Cart” button requires an extra step in the checkout process, which I want to avoid.
What have you already tried:
- I have explored Wix Stores and the default product page settings.
- I found the “Buy Now” button option, but it does not allow me to link my eBook product directly.
- I tried looking for a way to create a direct checkout link for my digital product but haven’t found a clear solution.
- I searched Wix Help Center and forums but couldn’t find an exact answer.
Additional information:
- My eBook is a digital download, so I want the purchase process to be as seamless as possible.
- If a workaround, such as a custom button with a direct checkout link, is needed, I’d like to know how to implement it.
You can achieve this by creating a custom “Buy Now” button that links directly to the checkout page for your eBook. Instead of using the default Wix Stores button, generate a direct checkout link using the product’s store URL and product ID, then set your button’s click action to redirect users to that link. This will bypass the cart and take them straight to checkout. You can also use Velo (Dev Mode) to create a dynamic button that fetches the product ID and redirects users accordingly. Let me know if you need more details
There are a few options to consider depending on set up but as you are wanting this for a specific product I would use the following
Custom Velo
Thanks mate - there is nothing out of the box avaialble in wix?
There is a pay button that may suit your requirements
Hi, this seems like the right solution for me. How do I implement this in Wix Editor? Is there a nocode/native solution? I tried different approaches using velo too, none has worked yet. I get different versions of failed checkout pages. Maybe the new Wix stores/wix ecom doesn’t support the foll code? Or sdk is better? Hope it can be done with simple page code before trying with backend
Approach 1)
import wixLocation from 'wix-location';
$w.onReady(() => {
const STORE_URL = "https://www.openrescue.com"; //I also tried the product pg
const PRODUCT_ID = "1782649327875000"; //also tried inventory id
$w("#buyNowButton").onClick(() => {
const checkoutUrl =
`${STORE_URL}/checkout?items=${PRODUCT_ID}:1`;
wixLocation.to(checkoutUrl);
});
});
Approach 2)
import { cart } from 'wix-stores-frontend';
import wixLocation from 'wix-location';
$w.onReady(() => {
$w("#buyNowButton").onClick(async () => {
await cart.addProducts([
{
productId: "1782649327875000",
quantity: 1
}
]);
wixLocation.to("/checkout");
});
});