Want to Disable the add to cart button if the customer's store credit is less than Product Price

Topic summary

A developer is implementing functionality to disable the “Add to Cart” button when a customer’s store credit balance is insufficient to purchase a product.

Current Setup:

  • Store credit payment method is enabled in Shopify
  • Store credit has been assigned to customers
  • Goal is to both disable the button AND display the customer’s store credit amount on product pages

Technical Challenge:
The developer has written JavaScript code to handle the button disabling logic, but faces a critical issue: accessing the customer.store_credit value on the product page.

Key Question:
How to fetch and store the customer’s store credit balance directly from their account to use in the product page template or file? The developer notes this must be based on the actual store credit system (not meta fields or tags), and needs to work even when users are checking their account for available credit.

Status: The question remains unanswered, with the developer clarifying that existing responses haven’t addressed the core issue of accessing customer store credit data on product pages.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

I have enabled the store credit payment method. https://prnt.sc/Wuk_QZOs2sg0

and assigned store credit to a customer https://prnt.sc/DktmHNjR9yrB

I want to disable the add to cart button if the Store credit amount is less than the product price. https://prnt.sc/C48lS5ejCYtw

and also show the this store credit amount on the product page. like this screenshot https://prnt.sc/f39Z_ukLxpt1

i used this JS for disabling the button. but the issue is that customer.store_credit value. how I can store customer.store_credit value in my product page by fetching it directly from the customer account?

Note: No tag based, no meta fields based fetching. because our store’s total system is based on store credit. even user can access to their account for checking credits.

1 Like

hi

Thanks for the prompt response but it does not answered my question. my question was “i used this JS for disabling the button. but the issue is that customer.store_credit value. how I can store/access customer.store_credit value in my product page?” and you assumed that my theme and/or apps store the customer’s store credit balance already. but my actual case is how can i store the customer store credit in my theme or product file.