Recharge app: out of stock/inventory issue/redirecting to shopify checkout

RoisinCull
Tourist
3 0 1

Hey everyone, 

 

Having a bit of a nightmare. I run an online subscription business and use recharge app for this prupose. It's been working great until the last week I did the following. 

 

1. Made all subscriptions unavailable as it was out of stock before the 30th preorder deadline

2. Made all subscriptions available as we reopened our sales for the following month.

3. all inventory tracking is set to 1. continue selling when out of stock 2. do not track inventory

 

Ever since this happened whenever someone is going to purchase a subscription they get an out of stock error, or else no variant ID. 

 

I've done the following

 

1. updated rule sets 

2. synced products (many many many times)

3. set recharge checkout to always make order even when out of stock

3. got onto recharge, they think it's misdirecting to the shopify checkout instead of the recharge checkout but none of what they suggested is working

 

I also don't understand why this just happened out of the blue with me changing the stock. 

 

Any help would be greatly appreciated, 

 

Getting loads of people messaging me trying to check out!

 

Cheers

 

R

RoisinCull
Tourist
3 0 1

This is the error I keep getting, everything else is set up as normal

 

https://www.brewboxcoffee.ie/7171145831/checkouts/0dd5963ae52190903a25185ffe8c6cec/stock_problems?_g...

 

recharge have been pretty unreachable unfortunately

0 Likes
RoisinCull
Tourist
3 0 1

anyone else able to help??


@RoisinCull wrote:

This is the error I keep getting, everything else is set up as normal

 

https://www.brewboxcoffee.ie/7171145831/checkouts/0dd5963ae52190903a25185ffe8c6cec/stock_problems?_g...

 

recharge have been pretty unreachable unfortunately


 

0 Likes
Serigne
New Member
1 0 1

Hello,

maybe you are my rescue. I have exactly the same problem, how did you solve it?

 

Kind regards

 

Serigne

jehuty15
Shopify Partner
1 0 0

I had a similar problem. After adding to cart from the product page, it would redirect to the cart page. However, when you'd reach checkout it says the item was out of stock. It turns out that my cart.liquid was missing this line of code: {% include 'subscription-cart-footer' %} 

Once I included that line, everything was working  (obvious that file need to already exist in your snippets folder) 

 

0 Likes
AFerrara
Shopify Partner
12 1 4

Hi, I'm having the exact same issue now on all subscription items.  Can you tell me where this line of code should be placed in the .liquid file so I can see if it too resolves our out of stock issue?  TIA! 

0 Likes
battlemiles
New Member
2 0 0

This unfortunately did not help me (the code was already correct) and I am still having this out of stock error issue! Can anyone help???

0 Likes
Luka_Koczorowsk
Shopify Partner
10 0 4

I got this working on Prestige theme. 

My issue was not the cart page itself but the drawer cart the theme has. If you click "Checkout" in the drawer cart it doesn't work because the template is different than the default cart template which means that {% render 'subscription-cart-footer' %} never gets called. 

First thing I tried to do is simply add {% render 'subscription-cart-footer' %} to the cart-drawer template. However, I would get the following JS error: Uncaught TypeError: ReCharge.addProduct is not a function

Turns out, the {% render 'subscription-product' %} template on the product page was colliding with the {% render 'subscription-cart-footer' %} template in the drawer cart. To get around this, you need to modify subscription-product.liquid. Replace the following

			if (document.readyState === "complete" || document.readyState === "loaded") {
				if (!window.ReCharge) { window.ReCharge = new rcWidget(options); }
				ReCharge.addProduct(myProduct);
			} else {
				document.addEventListener("DOMContentLoaded", function() {
					if (!window.ReCharge) { window.ReCharge = new rcWidget(options); }
					ReCharge.addProduct(myProduct);
				});
			}

 

With

			if (document.readyState === "complete" || document.readyState === "loaded") {			
				if (!window.ReCharge) { window.ReCharge = new rcWidget(options); }
				else { window.ReCharge = Object.assign(new rcWidget(options), window.ReCharge) }
			} else {
				document.addEventListener("DOMContentLoaded", function() {
					if (!window.ReCharge) { window.ReCharge = new rcWidget(options); }
					else { window.ReCharge = Object.assign(new rcWidget(options), window.ReCharge) }
					ReCharge.addProduct(myProduct);
				});
			}

 

The magic is in 

window.ReCharge = Object.assign(new rcWidget(options), window.ReCharge) }

Which combines the Product ReCharge object to the Cart ReCharge object.

 

0 Likes