Expose product data within theme.js.liquid

Highlighted
New Member
1 0 0

Hello all,

I'm attempting to make some modifications to how size variants look on the product details page.  I do not wish to alter the theme's product template/html, as there's some complicated stuff going on. Therefore, I'm hoping there is a way for me to expose product information within theme.js via Javascript and/or Ajax. 

My thought is that, on page load of the product detail page, I am able to grab the current product object, see which product.variant (sizes) have a value of "Out of Stock" and create some conditional logic off of that.

I'm a bit unclear which object(s) I should be utilizing. Any help is greatly appreciated! 

0 Likes