Velo Code:
import { cart } from 'wix-stores';
export function addToCart_click(event) {
let product = $w('#dynamicDataset').getCurrentItem();
let idProduct = product.productReference;
$w('#shoppingCartIcon1').addToCart(idProduct)
.then(() => {
console.log("Product Added");
cart.showMiniCart();
})
.catch((error) => {
console.log(error);
});
}