summaryrefslogtreecommitdiff
path: root/src/pages/shop/product
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/shop/product')
-rw-r--r--src/pages/shop/product/[slug].js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pages/shop/product/[slug].js b/src/pages/shop/product/[slug].js
index e44cfeca..cabda175 100644
--- a/src/pages/shop/product/[slug].js
+++ b/src/pages/shop/product/[slug].js
@@ -9,7 +9,7 @@ import { LazyLoadImage } from "react-lazy-load-image-component";
import "react-lazy-load-image-component/src/effects/blur.css";
import ProductSlider from "../../../components/product/ProductSlider";
import Layout from "../../../components/Layout";
-import { addToCart } from "../../../helpers/cart";
+import { createOrUpdateItemCart } from "../../../helpers/cart";
export async function getServerSideProps( context ) {
const { slug } = context.query;
@@ -83,7 +83,7 @@ export default function ProductDetail({ product }) {
let addItemToCart = () => {
if (quantity > 0) {
- addToCart(activeVariant.id, parseInt(quantity));
+ createOrUpdateItemCart(activeVariant.id, parseInt(quantity));
}
return true;
}