> For the complete documentation index, see [llms.txt](https://cryptococo.gitbook.io/cocoshop-theme-development/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptococo.gitbook.io/cocoshop-theme-development/liquid/functions/buy.md).

# buy

The buy function is a function for purchasing NFTs that are on sale.

### Condition of use

The only template that can use the `buy` function is [product](/cocoshop-theme-development/architecture/templates/product.md) template.

Also, the UI should be such that it can only be run on NFTs that are in the selling state.
