Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi we are in the process of setting up a Shopify store for a subscription model using ReCharge.
For our subscription, we have 2 options:
1. Delivery every week
2. Delivery every 2 weeks.
When testing the site we get the error "Variant can only be purchased with a selling plan." But this is ONLY when you select Option 1; Delivery every week.
If you select Option 2; Delivery every 2 weeks it works just fine. What's strange is that if you select Delivery every 2 weeks first, and then go back to the option 1;Delivery every week, now it works.
Hoping to get rid of this error message. We tried a lot of things already (Followed ReCharge Rules; Subscription Widget published, tried removing products and re-adding, etc). Thank you
The store is Ubuoy.com and password is Ubuoy
Following this- we are having this problem too.
following...Also having this issue and tried different subscription apps with no luck.
Im having the same error and I have seen the same error in another store I was trying to buy something from last month.
I has the same problem , when i unchecked that option as shown in the picture i was able to add gift cards to the cart , hope this solve your problem too .
In case anyone else comes across this I found the solution here in the Recharge support docs:
https://support.rechargepayments.com/hc/en-us/articles/360008829593-Troubleshooting-the-Subscription...
I allready have published she recharge widget and still having this error :c
Hi,
it depends on where u received this error:
1. product page
2. add to cart button on a non-product page?
In the first case:
1. Is your product page built via JSON (2.0) or liquid (1.0)?
2. Did you add the Subscription widget and is it published?
https://support.rechargepayments.com/hc/en-us/articles/4557226879383-Overview-of-the-Shopify-2-0-sub...
4. Is the selling_plan id included?
In the second case:
1. Did you add the selling_plan id to the cart payload?
https://shopify.dev/api/ajax/reference/cart#add-a-selling-plan
Best,
Dragan
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...
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024