summaryrefslogtreecommitdiff
path: root/src/lib/product/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/product/components')
-rw-r--r--src/lib/product/components/Product.jsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/product/components/Product.jsx b/src/lib/product/components/Product.jsx
index 396eba5f..39d29d4d 100644
--- a/src/lib/product/components/Product.jsx
+++ b/src/lib/product/components/Product.jsx
@@ -8,7 +8,7 @@ import Select from "react-select"
import ProductSimilar from "./ProductSimilar"
import LazyLoad from "react-lazy-load"
import { toast } from "react-hot-toast"
-import { addItemCart } from "@/core/utils/cart"
+import { updateItemCart } from "@/core/utils/cart"
const informationTabOptions = [
{ value: 'specification', label: 'Spesifikasi' },
@@ -75,7 +75,7 @@ const Product = ({ product }) => {
toast.error('Jumlah barang minimal 1')
return
}
- addItemCart({
+ updateItemCart({
productId: activeVariant.id,
quantity
})
@@ -98,7 +98,7 @@ const Product = ({ product }) => {
{ activeVariant?.price?.discountPercentage > 0 && (
<div className="flex gap-x-1 items-center mt-2">
<div className="text-gray_r-11 line-through text-caption-1">
- {currencyFormat(activeVariant?.price?.priceDiscount)}
+ {currencyFormat(activeVariant?.price?.price)}
</div>
<Badge type="solid-red">
{activeVariant?.price?.discountPercentage}%
@@ -106,7 +106,7 @@ const Product = ({ product }) => {
</div>
) }
<h3 className="text-red_r-11 font-semibold mt-1">
- { activeVariant?.price?.price > 0 ? currencyFormat(activeVariant?.price?.price) : (
+ { activeVariant?.price?.priceDiscount > 0 ? currencyFormat(activeVariant?.price?.priceDiscount) : (
<span className="text-gray_r-11 leading-6 font-normal">
Hubungi kami untuk dapatkan harga terbaik,&nbsp;
<a href="https://wa.me/" className="text-red_r-11 underline">klik disini</a>