How to Enable Ajax Add To Cart Button for Sample Products?
You can let customers add a sample to the cart without a full page reload by enabling Ajax add to cart.
Turn on Enable Ajax Add to Cart in the Ajax Add To Cart section. You can also show a success dialog after the sample is added, and customize the dialog button text.
In The Article
How to enable Ajax add to cart
- Go to Dotstore Plugins > Product Sample and open the Manage Sample tab and open the Ajax Add To Cart section.
- Turn on Enable Ajax Add to Cart.
- Optionally turn on Enable Ajax Dialog if you want a success dialog after the sample is added.
- If the dialog is enabled, you can change the Button Label for that dialog. The default value is Done!
- Click Save Changes.
Ajax add to cart settings
The Ajax Add To Cart section includes these options:
- Enable Ajax Add to Cart — Turn Ajax add to cart on or off.
- Enable Ajax Dialog — Turn the success dialog on or off.
- Button Label — Set the text on the success dialog button. The default is Done!
Pro Tips
- Enable Enable Ajax Dialog if you want clear confirmation that the sample was added.
- Keep the dialog Button Label short, such as the default Done!
- After you save, test the sample button on a product page to confirm the cart updates without a full reload.
Common Use Cases
Here are some popular ways to use Ajax add to cart:
1. Let customers add a sample without leaving the page
Turn on Enable Ajax Add to Cart so the product page does not fully reload.
2. Show a success dialog
Turn on Enable Ajax Dialog and customize the Button Label if you want a confirmation message after the sample is added.
FAQs
1. Where do I enable Ajax add to cart for samples?
Go to Dotstore Plugins > Product Sample and open the Manage Sample tab, open Ajax Add To Cart, and turn on Enable Ajax Add to Cart.
2. What does Enable Ajax Dialog do?
It shows a success dialog after a sample is added to the cart. You can change the dialog’s Button Label. The default is Done!