---
title: "get_variants"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/filter/get-variants'
  md: 'https://developer.shopline.com/docs/sline/filter/get-variants.md'
---

# get_variants


    Gets all variant objects associated with the given product.

    To be used in combination with the following object:

[product](https://developer.shopline.com/docs/sline/object/product.md)

> **CAUTION**
>
> To ensure store performance and responsiveness, the maximum number of times this filter can be called during a single page rendering process is 50. When multiple calls include identical input parameters, these calls will be deduplicated and counted as one call. Once the call limit is reached, subsequent calls will return `nil`.



    
`product | get_variants()` returns an array of [`variant`](https://developer.shopline.com/docs/sline/object/variant.md) objects.
    



    
        ## Required params

        
             `product` [`product`](https://developer.shopline.com/docs/sline/object/product.md)\: The given `product` object.
        
    





    
## Example

        
            

            

            

            
<SlineExample path={'/products/-a001-striped-off-shoulder---crop-top-collection-2023'} objects={ 
    [""] 
}>
```sline
{{#var myVariants = product | get_variants() /}}
{{#for variant in myVariants}}
  {{ variant.title }}
{{/for}}
```
</SlineExample>
            
        
    
