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...
User | RANK |
---|---|
53 | |
48 | |
41 | |
28 | |
21 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023