To create a Buy button:
1. From your X-Cart admin menu, open the Marketing section and click Buy Button.
2. On the Buy Button page, choose either Generate product card or Embed product to email and click the corresponding Select product button:
3. From the Choose a product to create Buy button pop-up, select a product from your catalog or use the search to find a specific product:
4. From the Configure Buy Button page, you can customize the button’s click action and the language settings:
In the Click action dropdown, select what will happen when a customer clicks the buy button.
- The "Add to cart" option redirects a customer to the X-Cart store cart page and adds a product to the cart.
- The "Show product details" option redirects a customer to the product page.
5. If your product has multiple variants (like size or color), you can select a specific combination of attributes to associate with the Buy button. Please note that the variant stock status is not considered.
7. When you’re done, click Generate code or Get the link button.
8. In the pop-up, copy the embed code or the product link, or click the Copy button:
The code is ready for pasting!
After you created a Buy button in your X-Cart admin, you’re ready to add it to your own website or blog. The process of adding the embed code to your website’s source HTML is a bit different depending on how and where you want the Buy buttons and cart to appear on your website platform.
In general, any website or platform that allows you to paste plain HTML code with script tags can embed the Buy button cart. Look for an HTML code widget or Code text editor mode.