I am following the instructions to "Adding color swatches to your products", but I can not locate selectCallback function anywhere in my product.liquid or theme.liquid.
My client's site is using the Pipeline theme.
Any ideas where "selectCallback" is located?
Link to the 'color swatches discussion': https://community.shopify.com/c/Shopify-Design/Product-pages-Add-color-swatches-to-products/m-p/6164...
I don't have access to the Pipeline theme myself, but as Pipeline is not a free theme developed by Shopify, it likely achieves the effect of the selectCallback function in a different way under a different name. While parts of that tutorial you linked will be useful, following the steps exactly won't work as they're tailored to themes developed by Shopify. For example, one thing you will have to consider is if the Pipeline theme references jQuery in the same way as that tutorial or even at all.
With that said, I can offer advice on how to locate where the Pipeline theme will be running similar code.
First, search for the formatMoney function in the theme's JS files. This function will be called to render a new price whenever a product variant is selected, and may be part of a calling function that also modifies the Add to Cart button.
If that doesn't help, search for an identifier of the Add to Cart button in the theme's JS files. The identifier may be an ID or data-* attribute – e.g. in the Debut theme, the identifier is data-add-to-cart (see image below). Once you know how the Add to Cart button is referenced in the JS files of the Pipeline theme, you will be able to find other references to it and insert your new swatch-related code in the appropriate place.
I hope this helps.
Hi! Thanks for responding!
I just want you to know that I already updated it correctly based on a solution I found here: https://help.groupthought.com/article/429-how-to-use-shopifys-swatches-in-pipeline-4
Your suggestion is kind of similar too with the solution I found so it's still a helpful suggestion. Thanks again!