All things Shopify and commerce
Hey all:
I've been getting this error on every theme I've installed and I have ZERO subscriptions on my site;. Variant can only be purchased with a selling plan error. Currently using the DAWN theme. Its just a basic coffee roaster site selling beans; no subscriptions as of yet.
I just want folks to be able to order a couple bags of beans and ship! Highaltitudecoffeeroaster.com
Has anyone else been able to fix this and is willing to share how?
Appreciate it !
Hello @Soleiltan2
Thank you for reaching out to the Shopify community.
If you are getting an error "Variant can only be purchased with a selling plan error" it's probably because the product on the Shopify admin panel is marked as subscription only. Here are the steps to fix it:
1. Navigate to the products section on the Shopify admin panel.
2. Click on the product where you are facing this issue and scroll to the bottom of the page.
3. Uncheck "Only show this product with these purchase options" and save the changes.
Let me know if this was helpful.
Thanks.
Using the themes I am using, even the Dawn 11.0, there is nothing that reads like this when I click on a product. But what I did figure out on my own, is that I needed to use an app called recharge which allows for a single purchase or a subscription purchase.
Try this solution to add a selling plan to the cart drawer by embedding a button anywhere:
I added this directly to the theme by using the custom liquid option.
<input type="button" id="add-to-cart-button" value="ADD TO CART" style="background-color: #ffffff; color: #000000; width: 100%; padding-top: 15px; padding-bottom: 15px;" onClick="addItemToCart(VARIANT_ID, 1, SELLING_PLAN_ID)">
<script>
function addItemToCart(variant_id, qty, selling_plan) {
data = {
"id": variant_id,
"quantity": qty,
"selling_plan": selling_plan
}
jQuery.ajax({
type: 'POST',
url: '/cart/add.js',
data: data,
dataType: 'json',
success: function(carthtml) {
$('cart-drawer').html($(carthtml).find('cart-drawer').html());
}
});
}
</script>
The first value is the variant ID
Second is Quantity
Third if the selling plan ID
To add a selling plan from any page/button directly to the cart:
<input type="button" id="add-to-cart-button" value="ADD TO CART" style="background-color: #ffffff; color: #000000; width: 100%; padding-top: 15px; padding-bottom: 15px;" onClick="addItemToCart(VARIANT_ID, 1, SELLING_PLAN_ID)">
<script>
function addItemToCart(variant_id, qty, selling_plan) {
data = {
"id": variant_id,
"quantity": qty,
"selling_plan": selling_plan
}
jQuery.ajax({
type: 'POST',
url: '/cart/add.js',
data: data,
dataType: 'json',
success: function() {
window.location.href = '/cart';
}
});
}
</script>
Get more info from:
https://support.rechargepayments.com/hc/en-us/articles/360008683774-Adding-an-item-to-the-cart-with-...
How to find the selling plan ID:
https://community.shopify.com/c/technical-q-a/how-to-find-subscription-product-selling-plan-id/m-p/1...
Add to cart drawer:
https://stackoverflow.com/questions/75725480/shopify-refresh-cart-drawer-when-adding-new-items-to-ca...
@Sierra3 Thank you so much for this.
I used this in PageFly, since building the page and adding a subscription was not a problem until I tried to purchase in testing.
I then got an error citing the subscription as the problem
I used the second snippet successfully and have one thing to clarify for the next person.
Only replace the variables in all caps (VARIANT_ID, 1, SELLING_PLAN_ID) with the actual values, for it to work correctly
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025