When customers click on the link, the product is added to their cart, and they are automatically redirected to the Cart page.
In this example, we’ll work with a product named Pro Membership that has a product ID of 579.
https://domain.com/product/pro-membership/?add-to-cart=579- Adjust the domain name
- Add the slug of your product
- Add the product ID of your product
Product IDs can be found by hovering over any of your products within the WordPress Dashboard.