@empathyco/x-components
Version:
Empathy X Components
19 lines (10 loc) • 587 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [XAPI](./x-components.xapi.md) > [addProductToCart](./x-components.xapi.addproducttocart.md)
## XAPI.addProductToCart property
To track that a product was added to the cart from PDP.
**Signature:**
```typescript
addProductToCart: (productId?: string) => void;
```
## Remarks
if no productId is provided, then the current page url will be used as id for getting the previously stored result information.