If you wish to add a product directly to the cart for a closed type course in LearnDash-WooCommerce setup then it’s quite simple.
- Copy the product ID of the corresponding product.
- Then instead of adding the URL of the product page as the Closed Button URL, input your website’s checkout page URL with an add-to-cart query parameter.
For example, if a product ID is 29 then the URL you should input is https://example.com/checkout/?add-to-cart=29.
This will redirect a user to the checkout page with the product added to the cart.