Home > @shopware-pwa/composables > useProductAssociations

# useProductAssociations() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Get product association entity. Options - IUseProductAssociations


export declare function useProductAssociations(params: {
    product: Ref<Product> | Product;
    associationContext: "cross-selling" | "reviews";
}): IUseProductAssociations;

# Parameters

Parameter Type Description
params { product: Ref<Product> | Product; associationContext: "cross-selling" | "reviews"; }



# Example

Example of possibilities:

const { loading, loadAssociations, productAssociations } = useProductAssociation({product, associationContext: "cross-selling"})
if (!productAssociations.value) {
   await loadAssociations()