From aa21c215d18d0a80e7f2979f9a18f5af7db02f8c Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 29 Mar 2023 11:10:53 +0700 Subject: video page --- src/lib/product/components/Product/ProductDesktop.jsx | 16 +++++++++++++--- src/lib/product/components/Product/ProductMobile.jsx | 10 ++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'src/lib/product') diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 79e7bb45..2f0ac488 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -12,6 +12,7 @@ import useVariantPrice from '@/lib/variant/hooks/useVariantPrice' import useProductPrice from '../../hooks/useProductPrice' import PriceSkeleton from '@/core/components/elements/Skeleton/PriceSkeleton' import { useRouter } from 'next/router' +import { createSlug } from '@/core/utils/slug' const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { const router = useRouter() @@ -38,7 +39,8 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { if (!validQuantity(quantity)) return updateItemCart({ productId: variantId, - quantity + quantity, + selected: true }) toast.success('Berhasil menambahkan ke keranjang') } @@ -92,7 +94,15 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => {
Manufacture
{product.manufacture?.name ? ( - {product.manufacture?.name} + + {product.manufacture?.name} + ) : (
-
)} @@ -181,7 +191,7 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { {product.variants.map((variant) => ( {variant.code} - {variant.attributes.join(', ')} + {variant.attributes.join(', ') || '-'} diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx index 0df22026..e560639c 100644 --- a/src/lib/product/components/Product/ProductMobile.jsx +++ b/src/lib/product/components/Product/ProductMobile.jsx @@ -14,6 +14,7 @@ import { toast } from 'react-hot-toast' import useVariantPrice from '@/lib/variant/hooks/useVariantPrice' import PriceSkeleton from '@/core/components/elements/Skeleton/PriceSkeleton' import useProductPrice from '../../hooks/useProductPrice' +import { createSlug } from '@/core/utils/slug' const ProductMobile = ({ product, wishlist, toggleWishlist }) => { const router = useRouter() @@ -79,7 +80,8 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => { if (!validAction()) return updateItemCart({ productId: activeVariant.id, - quantity + quantity, + selected: true }) toast.success('Berhasil menambahkan ke keranjang') } @@ -106,7 +108,11 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
{product.manufacture?.name ? ( - {product.manufacture?.name} + + {product.manufacture?.name} + ) : (
-
)} -- cgit v1.2.3