Intermittent Error: Variant can only be purchased with a selling plan.

Intermittent Error: Variant can only be purchased with a selling plan.

Ubuoy
Visitor
1 0 0

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 

 

Replies 10 (10)

mothertongue
New Member
4 0 0

Following this- we are having this problem too. 

sielath
Visitor
1 0 0

following...Also having this issue and tried different subscription apps with no luck.

Nevershiver
Visitor
3 0 0

giftcard.pngScreenshot 2023-01-14 010151.pngScreenshot 2023-01-14 011200.png

FloydFarmsWL
Visitor
2 0 0

Im having the same error and I have seen the same error in another store I was trying to buy something from last month.

Nevershiver
Visitor
3 0 0

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 .

Screenshot 2023-01-14 010151.pngScreenshot 2023-01-14 011200.pnggiftcard.png

FloydFarmsWL
Visitor
2 0 0

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...

josesunrise
Shopify Partner
1 0 0

 I allready have published she recharge widget and still having this error :c

dragan-rakita
Shopify Partner
1 0 0

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

Nevershiver
Visitor
3 0 0

giftcard.pngScreenshot 2023-01-14 010151.pngScreenshot 2023-01-14 011200.png

Sierra3
Visitor
3 0 0

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...