App integration
For Application Developers
Pipeline includes a JavaScript file you can use to add custom functionality to the theme and also help integrate Shopify applications with the theme. The file to use is custom.js and is located in the Assets folder:

How to use
By default, Pipeline does not load custom.js, it has been commented out of theme.liquid.
To activate custom.js, simply uncomment the script line in layout/theme.liquid:

The script tag is located near the very bottom of the file:

Copy that line out of the commented-out section and paste it below:

Save the changes to theme.liquid.
Next, you can add your custom application code block to the custom.js file.
We have included an IIFE function example for event listeners:
Use case example
An example use case for adding a "Sell incoming inventory" checkbox to the product detail page:
Shopify includes a limited set of fields at the theme level. We have the ability for each variant to get:
Available inventory
Incoming inventory (from transfers)
Incoming inventory date (also from transfers)
A missing Shopify feature is a checkbox or ability to "Sell incoming inventory". We could say "sell unlimited quantities" or "sell what's available". However, we are unable to say "sell what's available plus the incoming and no more"
Because we are missing that feature, we can write a JavaScript function and add it to custom.js. The feature can manually add our incoming inventory to the "available" column. The logic looks like this:
If variant not available => "sold out"
If available and also incoming => "pre-order + date"
If available and NO incoming => add to cart
We are collapsing "available" and "incoming" together, thus we can only use transfers to track items that will be to going to pre-sell. Otherwise, anything with an incoming shipment will say "preorder".
Custom.js
We can add the code logic into custom.js
add-to-cart.liquid
Next, we can add Liquid markup to the add-to-cart.liquid file:
theme.css
Finally, add any CSS styles to customize the product detail page display:
Last updated
