"Variant can only be purchased with a selling plan" error
Sections
Issue
A "Variant can only be purchased with selling plan" error appears when adding a product that should be configured for subscription to the cart.
Environment
- Shopify Checkout Integration
- Migrated Shopify Checkout Integration
Before you start
The widget loads last on the page. If it doesn't completely load and a customer tries to add a subscription, it can cause the "Variant can only be purchased with a selling plan" error.
If you notice slow load times, refer to The Recharge Widget loads slowly on my product page to troubleshoot that first.
Resolution
This error can occur when there are multiple product forms on a page and the subscription widget is not injected into the correct form. This can be fixed by injecting a line of code into the correct form.
Look for the product form in your Shopify Theme's product template file (ex: product.liquid
or main-product.liquid
) and inject the following code snippet to render the widget:
<div class="rc-widget-injection-parent" style="display: initial;"></div>
Place the code snippet in the form, either directly below:
<form id="add-item-form" action="/cart/add" method="post" data-productid="{{product.id}}">
Or below:
{% form 'product', product, data-productid: product.id, class: productClasses %}
This solution specifies the correct product form on the product page and resolves the error.