From bf063f244c39565e616467de8fc53e1acd286686 Mon Sep 17 00:00:00 2001 From: tieptk Date: Mon, 29 Dec 2025 17:29:51 +0700 Subject: [PATCH] update --- src/app/cart/page.tsx | 16 + src/components/Cart/Home/FormCart/index.tsx | 82 + src/components/Cart/Home/ItemCart/index.tsx | 110 + src/components/Cart/Home/index.tsx | 179 ++ src/components/common/ItemProduct/index.tsx | 2 +- .../other/Header/HeaderMid/index.tsx | 84 +- .../ProductDetail/BoxInfoRight/index.tsx | 42 +- .../ProductComment/ListComment/index.tsx | 2 +- src/data/ListProduct/index.tsx | 2278 +++++++++++++++++ src/lib/ButtonCart/index.ts | 69 + src/styles/globals.css | 32 +- src/types/cart/index.ts | 46 + src/types/global/TypeListProduct.ts | 40 +- src/types/product/detail/index.ts | 6 +- 14 files changed, 2922 insertions(+), 66 deletions(-) create mode 100644 src/app/cart/page.tsx create mode 100644 src/components/Cart/Home/FormCart/index.tsx create mode 100644 src/components/Cart/Home/ItemCart/index.tsx create mode 100644 src/components/Cart/Home/index.tsx create mode 100644 src/lib/ButtonCart/index.ts create mode 100644 src/types/cart/index.ts diff --git a/src/app/cart/page.tsx b/src/app/cart/page.tsx new file mode 100644 index 0000000..6a7b3df --- /dev/null +++ b/src/app/cart/page.tsx @@ -0,0 +1,16 @@ +import React from 'react'; +import HomeCart from '@/components/Cart/Home'; +import { Metadata } from 'next'; + +export const metadata: Metadata = { + title: 'Thông tin giỏ hàng', + description: 'Xem các sản phẩm đã thêm vào trong giỏ hàng', +}; + +export default function CartPage() { + return ( + <> + + + ); +} diff --git a/src/components/Cart/Home/FormCart/index.tsx b/src/components/Cart/Home/FormCart/index.tsx new file mode 100644 index 0000000..ea1e07f --- /dev/null +++ b/src/components/Cart/Home/FormCart/index.tsx @@ -0,0 +1,82 @@ +import { useState } from 'react'; + +export const FormCart = () => { + const [showTax, setShowTax] = useState(false); + + return ( + <> +
+

Thông tin khách hàng

+
+ +
+ + +
+ +
+ + +
+ + +
+ +
+ {showTax && ( +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ )} +
+
+ + ); +}; diff --git a/src/components/Cart/Home/ItemCart/index.tsx b/src/components/Cart/Home/ItemCart/index.tsx new file mode 100644 index 0000000..6616bb6 --- /dev/null +++ b/src/components/Cart/Home/ItemCart/index.tsx @@ -0,0 +1,110 @@ +import Image from 'next/image'; +import Link from 'next/link'; +import { TypeCartItem } from '@/types/cart'; +import { FaSortDown, FaTrashCan } from 'react-icons/fa6'; +import { formatCurrency } from '@/lib/formatPrice'; + +interface PropsCart { + item: TypeCartItem; + onUpdate: (id: string, quantity: number) => void; + onDelete: (id: string) => void; +} + +export const ItemCart: React.FC = ({ item, onUpdate, onDelete }) => { + const handleChangeQuantity = (delta: number) => { + const newQuantity = Math.max(1, parseInt(item.in_cart.quantity) + delta); + onUpdate(item._id, newQuantity); + }; + + return ( +
+
+ + model + {item.item_info.sale_rules?.type == 'deal' && ( + deal + )} + +
+ + {item.item_info.productName} + + {item.item_info.specialOffer?.all && ( +
+

+ Khuyến mại{' '} + + {' '} + (Chi tiết) + + +

+ +
+ {item.item_info.specialOffer.all.map((_item, idx) => ( +
+ ))} +
+
+ )} +
+
+ + handleChangeQuantity(1)} + /> + +
+
+
+
+ {item.in_cart.price == '0' ? ( +

+ 0 đ +

+ ) : ( +

+ {formatCurrency(item.in_cart.total_price)} đ +

+ )} +
+ +
+
+ ); +}; diff --git a/src/components/Cart/Home/index.tsx b/src/components/Cart/Home/index.tsx new file mode 100644 index 0000000..5cc7e3b --- /dev/null +++ b/src/components/Cart/Home/index.tsx @@ -0,0 +1,179 @@ +'use client'; +import { useState } from 'react'; +import Image from 'next/image'; +import Link from 'next/link'; +import { FaChevronLeft } from 'react-icons/fa6'; +import { Breadcrumb } from '@/components/Common/Breadcrumb'; +import { TypeCartItem } from '@/types/cart'; +import { ItemCart } from './ItemCart'; +import { FormCart } from './FormCart'; +import { formatCurrency } from '@/lib/formatPrice'; + +const HomeCart = () => { + const breadcrumbItems = [{ name: 'Giỏ hàng', url: '/cart' }]; + const [cart, setCart] = useState(() => { + const storedCart = localStorage.getItem('cart'); + return storedCart ? JSON.parse(storedCart) : []; + }); + + const [payMethod, setPayMethod] = useState('2'); + + const updateCartItem = (id: string, quantity: number) => { + const newCart = cart.map((item) => + item._id === id + ? { + ...item, + in_cart: { + ...item.in_cart, + quantity: quantity.toString(), + total_price: quantity * Number(item.in_cart.price), + }, + } + : item, + ); + setCart(newCart); + localStorage.setItem('cart', JSON.stringify(newCart)); + }; + + const deleteCartItem = (id: string) => { + const isConfirm = confirm('Bạn có chắc chắn xóa sản phẩm này không ?'); + if (isConfirm) { + const newCart = cart.filter((item) => item._id !== id); + setCart(newCart); + localStorage.setItem('cart', JSON.stringify(newCart)); + } + }; + + const deleteCart = () => { + const isConfirm = confirm('Bạn có chắc chắn xóa sản phẩm này không ?'); + if (isConfirm) { + setCart([]); + localStorage.removeItem('cart'); + } + }; + + // tính tổng tiền + const getTotalPrice = () => { + return formatCurrency(cart.reduce((sum, item) => sum + Number(item.in_cart.total_price), 0)); + }; + + return ( + <> +
+ +
+
+ {cart.length === 0 ? ( +
+ icon-cart +

Không có sản phẩm nào trong giỏ hàng của bạn.

+ + Tiết tục mua sắm + +
+ ) : ( + <> +
+

Giỏ hàng của bạn

+ + + Mua thêm sản phẩm khác + +
+ +
+
+ +
+
+ {cart.map((item, index) => ( + + ))} +
+ + {/* form mua hàng */} + +
+

Phương thức thanh toán

+
+ +
+

Tổng tiền

+
+

+ Tổng cộng + + {getTotalPrice()} ₫ + +

+

+ Thành tiền + + {getTotalPrice()} đ + +

+ (Giá đã bao gồm VAT) +
+
+ +
+ +
+ + Tải file excel + + + Tải ảnh báo giá + + + in báo giá + +
+
+
+ + )} +
+ + ); +}; + +export default HomeCart; diff --git a/src/components/common/ItemProduct/index.tsx b/src/components/common/ItemProduct/index.tsx index 2a346a4..72aa910 100644 --- a/src/components/common/ItemProduct/index.tsx +++ b/src/components/common/ItemProduct/index.tsx @@ -44,7 +44,7 @@ const ItemProduct: React.FC = ({ item }) => { {item.marketPrice.toLocaleString()} đ

-
-{Math.round(item.price_off)} %
+
-{Math.round(Number(item.price_off))} %
) : (
diff --git a/src/components/other/Header/HeaderMid/index.tsx b/src/components/other/Header/HeaderMid/index.tsx index 3a9d1e0..39ae17d 100644 --- a/src/components/other/Header/HeaderMid/index.tsx +++ b/src/components/other/Header/HeaderMid/index.tsx @@ -1,11 +1,30 @@ 'use client'; -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import Image from 'next/image'; import Link from 'next/link'; import { FaMapMarkerAlt, FaBars } from 'react-icons/fa'; import BoxShowroom from '@/components/Common/BoxShowroom'; +import { TypeCartItem } from '@/types/cart'; +import { formatCurrency } from '@/lib/formatPrice'; const HeaderMid: React.FC = () => { + const [cartCount, setCartCount] = useState(() => { + const storedCart = localStorage.getItem('cart'); + return storedCart ? JSON.parse(storedCart).length : 0; + }); + + const [cart, setCart] = useState(() => { + const storedCart = localStorage.getItem('cart'); + return storedCart ? JSON.parse(storedCart) : []; + }); + + const [cartQuantity, setCartQuantity] = useState(() => { + return cart.reduce((sum: number, item) => sum + Number(item.in_cart.quantity), 0); + }); + const [cartTotal, setCartTotal] = useState(() => { + return cart.reduce((sum: number, item) => sum + Number(item.in_cart.total_price), 0); + }); + const PopupAddress = () => { const modal = document.getElementById('boxShowroom') as HTMLDialogElement; modal?.showModal(); @@ -63,7 +82,7 @@ const HeaderMid: React.FC = () => {
- +

@@ -72,7 +91,7 @@ const HeaderMid: React.FC = () => {

@@ -80,46 +99,83 @@ const HeaderMid: React.FC = () => { Khách hàng liên hệ - +

Tin tức công nghệ -
- +
+

- 1 + {cartCount}

Giỏ hàng
-
-
+
+ {cart.map((item, index) => ( +
+ + {item.item_info.productName} + +
+ + {item.item_info.productName} + +
+ x {item.in_cart.quantity} + + {item.in_cart.price == '0' + ? 'Liên Hệ' + : `${formatCurrency(item.in_cart.total_price)} đ`} + +
+
+
+ ))} + {/* end item */} +
+

Tổng tiền hàng

-

-

+

+ ({cartQuantity} sản phẩm) +

+

+ {formatCurrency(cartTotal)}đ +

-

THANH TOÁN NGAY

+

THANH TOÁN NGAY

- Tài khoản + Tài khoản
diff --git a/src/components/product/ProductDetail/BoxInfoRight/index.tsx b/src/components/product/ProductDetail/BoxInfoRight/index.tsx index e6a84fb..a550fad 100644 --- a/src/components/product/ProductDetail/BoxInfoRight/index.tsx +++ b/src/components/product/ProductDetail/BoxInfoRight/index.tsx @@ -1,10 +1,22 @@ +'use client'; +import { useRouter } from 'next/navigation'; import type { ProductDetailData } from '@/types'; import Link from 'next/link'; import { BoxPrice } from './BoxPrice'; import { BoxBought } from './BoxBought'; +// thêm giỏ hàng +import { addToCart } from '@/lib/ButtonCart'; + export const BoxInfoRight = (item: ProductDetailData) => { + const router = useRouter(); + + const handleBuyNow = () => { + router.push('/cart'); + addToCart(item.product_info.productId); + }; + return ( <>

@@ -81,32 +93,42 @@ export const BoxInfoRight = (item: ProductDetailData) => { +{' '}

- + -
- +
handleBuyNow()} + > + - + - +
)} - n{/* yên tâm mua hàng */} + {/* yên tâm mua hàng */}

Yên tâm mua hàng

diff --git a/src/components/product/ProductDetail/ProductComment/ListComment/index.tsx b/src/components/product/ProductDetail/ProductComment/ListComment/index.tsx index 43e08c2..75417b3 100644 --- a/src/components/product/ProductDetail/ProductComment/ListComment/index.tsx +++ b/src/components/product/ProductDetail/ProductComment/ListComment/index.tsx @@ -28,7 +28,7 @@ export const ListComment = () => {
{' '} {/* content */} -
+

{item.content}

diff --git a/src/data/ListProduct/index.tsx b/src/data/ListProduct/index.tsx index 7ce83ed..8d75c18 100644 --- a/src/data/ListProduct/index.tsx +++ b/src/data/ListProduct/index.tsx @@ -2187,4 +2187,2282 @@ export const productData: TypeListProduct = [ }, ], }, + { + id: 25404, + productId: 25404, + priceUnit: 'chiếc', + marketPrice: 13990000, + price: '11690000', + price_off: 16, + currency: 'vnd', + sale_rules: { + price: '11690000', + normal_price: 11690000, + min_purchase: '1', + max_purchase: '0', + remain_quantity: 1, + from_time: '1766106000', + to_time: '1767148200', + type: 'deal', + }, + lastUpdate: '2025-12-22 09:47:28', + warranty: 'Bảo hành theo từng linh kiện ', + productName: 'Bộ PC Gaming AMD Ryzen 5 5500, RAM 16GB, VGA 4GB [TẶNG MÀN HÌNH]', + productSummary: + 'CPU AMD Ryzen 5 5500 (3,6 GHz Boost 4,2 GHz | 6 Cores / 12 Threads | 16 MB Cache| PCIe 3.0)\r\nMain Gigabyte A520M-K V2\r\nRAM Simorchip DDR4 16GB 3200MHz (Hỗ trợ Intel/AMD)\r\nSSD DAHUA C910N 512GB M.2 NVMe PCIe Gen 3.0 x4 (DHI-SSD-C910N512G)\r\nVGA Colorful GT 1030 4GB Single Fan\r\nNguồn Segotep SG D600A U5 500W Đen/Black\r\nCase MIK LV12 MINI FLOW - BLACK\r\nTản nhiệt ID-Cooling SE-904-XT ARGB BLACK', + package_accessory: '', + productImage: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-01.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-01.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-03.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-03.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-02.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-02.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-05.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-05.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-14.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-14.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-07.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-07.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-08.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-08.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-19.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-25404-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-19.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/bts-gaming-02', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 127568, + rating: 5, + reviewCount: 16, + review: { + rate: 5, + total: 16, + }, + comment: { + rate: 5, + total: 39, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

Tặng Màn Hình :  VSP IP2407SG - 24 INCH - 100HZ - 1MS

\r\n

=>> Không lấy quà tặng màn hình: Giá PC là 10.290.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

Tặng Màn Hình :  VSP IP2407SG - 24 INCH - 100HZ - 1MS

\r\n

=>> Không lấy quà tặng màn hình: Giá PC là 10.290.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '464', + pixel_code: '', + review_count: '64', + review_score: '4.8', + }, + weight: 0, + promotion_price: null, + deal_list: [ + { + id: '565', + pro_id: '25404', + title: 'Bộ PC Gaming AMD Ryzen 5 5500, RAM 16GB, VGA 4GB [TẶNG MÀN HÌNH]', + price: '11690000', + quantity: '5', + min_purchase: '1', + max_purchase: '0', + is_featured: '0', + from_time: '1766106000', + to_time: '1767148200', + is_started: 1, + }, + ], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3471', + catPath: ':3471:3469:1829:0', + name: '5 Triệu - 15 Triệu', + url: '/5-trieu-15-trieu', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + ], + }, + { + id: 27258, + productId: 27258, + priceUnit: 'chiếc', + marketPrice: 14590000, + price: 12190000, + price_off: 16, + currency: 'vnd', + sale_rules: { + price: 12190000, + normal_price: 12190000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-22 09:49:05', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming Core i5-12400F, RAM 16GB, VGA 4GB', + productSummary: + 'CPU Intel Core i5-12400F Tray NEW (Up to 4.4Ghz, 6 nhân 12 luồng)\r\nMainboard H610M DDR4\r\nRAM DDR4 16GB 3200MHZ Tản nhiệt \t\r\nSSD 500G NVME M2\r\nCard màn hình Colorful GT 1030 4GB Single Fan\t\r\nPSU Xigmatek 500w\r\nVỏ case MIK LV12 MINI FLOW - BLACK\r\nTản nhiệt ID-Cooling SE-904-XT ARGB BLACK', + package_accessory: '', + productImage: { + small: + 'https://nguyencongpc.vn/media/product/75-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-018.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-02.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-02.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-14.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-14.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-05.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-05.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-07.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27258-pc-gaming-amd-ryzen-5-5500-ram-16gb-vga-4gb-07.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-03', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 76530, + rating: 5, + reviewCount: 2, + review: { + rate: 5, + total: 2, + }, + comment: { + rate: 5, + total: 18, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

• Mua thêm màn hình đang được khuyến mại =>> TẠI ĐÂY ( Giảm thêm 100K khi mua kèm PC )

\r\n

• Mua thêm Gear ( Phím, Chuột, tai nghe, ghế ) đang được khuyến mại =>> TẠI ĐÂY

\r\n

• Miễn phí giao hàng toàn quốc.

\r\n

• Hỗ trợ trả góp online toàn quốc - linh hoạt

\r\n

• Bảo hành đổi mới trong thời gian đầu sử dụng - nhanh gọn.

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

• Mua thêm màn hình đang được khuyến mại =>> TẠI ĐÂY ( Giảm thêm 100K khi mua kèm PC )

\r\n

• Mua thêm Gear ( Phím, Chuột, tai nghe, ghế ) đang được khuyến mại =>> TẠI ĐÂY

\r\n

• Miễn phí giao hàng toàn quốc.

\r\n

• Hỗ trợ trả góp online toàn quốc - linh hoạt

\r\n

• Bảo hành đổi mới trong thời gian đầu sử dụng - nhanh gọn.

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 1, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '321', + pixel_code: '', + review_count: '45', + review_score: '4.7', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + { + id: '3471', + catPath: ':3471:3469:1829:0', + name: '5 Triệu - 15 Triệu', + url: '/5-trieu-15-trieu', + }, + ], + }, + { + id: 27719, + productId: 27719, + priceUnit: 'chiếc', + marketPrice: 16990000, + price: 14690000, + price_off: 14.000000000000002, + currency: 'vnd', + sale_rules: { + price: 14690000, + normal_price: 14690000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-22 10:08:49', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming AMD Ryzen 5 5500, RAM 16GB, RTX 3050 6GB [TẶNG MÀN HÌNH]', + productSummary: + 'CPU AMD Ryzen 5 5500 (3,6 GHz Boost 4,2 GHz | 6 Cores / 12 Threads | 16 MB Cache| PCIe 3.0)\r\nMainboard Gigabyte A520M-K V2\r\nRAM Simorchip DDR4 16GB 3200MHz (Hỗ trợ Intel/AMD)\r\nỔ Cứng SSD Colorful CN600 512GB M.2 NVME đọc/ghi (tối đa): 3200MB/S – 2000MB/S\r\nCard Màn Hình ASUS DUAL RTX 3050 OC 6GB\r\nNguồn máy tính Segotep SG D600A U5 500W Đen/Black\r\nVỏ case MIK LV12 MINI FLOW - BLACK + 2Fan Clio RGB\r\nTản nhiệt ID-Cooling SE-904-XT ARGB BLACK', + package_accessory: '', + productImage: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-17.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-17.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-17.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-17.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-11.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-11.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-15.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-15.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-16.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-16.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-12.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-12.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-14.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-14.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-13.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27719-pc-gaming-amd-ryzen-5-5500-ram-16gb-rtx-3050-6gb-13.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-02', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 27899, + rating: 5, + reviewCount: 2, + review: { + rate: 5, + total: 2, + }, + comment: { + rate: 5, + total: 5, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

Tặng Màn Hình:  VSP IP2407SG - 24 INCH - 100HZ - 1MS

\r\n

=>> Không lấy quà tặng màn hình: Giá PC là 13.290.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

Tặng Màn Hình:  VSP IP2407SG - 24 INCH - 100HZ - 1MS

\r\n

=>> Không lấy quà tặng màn hình: Giá PC là 13.290.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '1204', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3471', + catPath: ':3471:3469:1829:0', + name: '5 Triệu - 15 Triệu', + url: '/5-trieu-15-trieu', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + ], + }, + { + id: 26625, + productId: 26625, + priceUnit: 'chiếc', + marketPrice: 16990000, + price: 16290000, + price_off: 4, + currency: 'vnd', + sale_rules: { + price: 16290000, + normal_price: 16290000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-18 16:22:11', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming i5-12400F, RAM 16GB, RTX 3050 6GB [TẶNG MÀN HÌNH]', + productSummary: '', + package_accessory: '', + productImage: { + small: + 'https://nguyencongpc.vn/media/product/75-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-1.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-1.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-2.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-2.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-3.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-3.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-4.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-4.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-5.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-5.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-6.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-6.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-7.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-pc-gaming-i5-12400f-ram-16g-vga-rtx-3050-6g-7.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-26625-ryzen-5-7500f-ram-16gb--rtx-3050-6gb-0102.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-26625-ryzen-5-7500f-ram-16gb--rtx-3050-6gb-0102.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-05', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 190323, + rating: 5, + reviewCount: 25, + review: { + rate: 5, + total: 25, + }, + comment: { + rate: 5, + total: 45, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

- Tặng Màn Hình : Màn hình VSP IP2407S

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 14.890.000đ

\r\n

- Xem thêm km: khuyenmai.nguyencongpc.vn/build-pc

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

- Tặng Màn Hình : Màn hình VSP IP2407S

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 14.890.000đ

\r\n

- Xem thêm km: khuyenmai.nguyencongpc.vn/build-pc

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '1890', + pixel_code: '', + review_count: '25', + review_score: '4.6', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + { + id: '3471', + catPath: ':3471:3469:1829:0', + name: '5 Triệu - 15 Triệu', + url: '/5-trieu-15-trieu', + }, + ], + }, + { + id: 27563, + productId: 27563, + priceUnit: 'chiếc', + marketPrice: 18990000, + price: 17490000, + price_off: 8, + currency: 'vnd', + sale_rules: { + price: 17490000, + normal_price: 17490000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-18 16:13:29', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming AMD Ryzen 5 5500, RAM 16GB, RX 7600 8GB [TẶNG MÀN HÌNH]', + productSummary: '', + package_accessory: '', + productImage: { + small: 'https://nguyencongpc.vn/media/product/75-27563-pc-gaming--25251325-.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27563-pc-gaming--25251325-.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: 'https://nguyencongpc.vn/media/product/75-27563-pc-gaming--25251325-.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27563-pc-gaming--25251325-.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: 'https://nguyencongpc.vn/media/product/75-27563-27426-khung-pc.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27563-27426-khung-pc.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: 'https://nguyencongpc.vn/media/product/75-27563-khung-pc-gaming--1-.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27563-khung-pc-gaming--1-.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-07', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 21123, + rating: 0, + reviewCount: 0, + review: { + rate: 0, + total: 0, + }, + comment: { + rate: 5, + total: 4, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

Tặng Màn Hình: Màn hình VSP IP2407S

\r\n

 Hoặc VIOX MF2425

\r\n

=> Giá PC Không lấy quà tặng: 15.990.000đ

\r\n

- Xem thêm km: khuyenmai.nguyencongpc.vn/build-pc

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

Tặng Màn Hình: Màn hình VSP IP2407S

\r\n

 Hoặc VIOX MF2425

\r\n

=> Giá PC Không lấy quà tặng: 15.990.000đ

\r\n

- Xem thêm km: khuyenmai.nguyencongpc.vn/build-pc

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '162', + pixel_code: '', + review_count: '18', + review_score: '4.4', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + { + id: '3471', + catPath: ':3471:3469:1829:0', + name: '5 Triệu - 15 Triệu', + url: '/5-trieu-15-trieu', + }, + ], + }, + { + id: 27562, + productId: 27562, + priceUnit: 'chiếc', + marketPrice: 18990000, + price: 18090000, + price_off: 5, + currency: 'vnd', + sale_rules: { + price: 18090000, + normal_price: 18090000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-18 16:14:25', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming Ryzen 5 5500, RAM 16GB, RTX 3060 12GB [TẶNG MÀN HÌNH]', + productSummary: '', + package_accessory: '', + productImage: { + small: 'https://nguyencongpc.vn/media/product/75-27562-pc-gaming--25251325-.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27562-pc-gaming--25251325-.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: 'https://nguyencongpc.vn/media/product/75-27562-pc-gaming--25251325-.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27562-pc-gaming--25251325-.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: 'https://nguyencongpc.vn/media/product/75-27562-27426-khung-pc.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27562-27426-khung-pc.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27562-27426-z6351411234703_719a6e70207d589616a6d621b31efe1f.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27562-27426-z6351411234703_719a6e70207d589616a6d621b31efe1f.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-08', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 20064, + rating: 5, + reviewCount: 2, + review: { + rate: 5, + total: 2, + }, + comment: { + rate: 5, + total: 2, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

TẶNG MÀN HÌNH: Màn hình VSP IP2407S

\r\n

Hoặc - Màn hình máy tính VIOX MF2425-V 100Hz

\r\n

=> Giá PC Không lấy quà tặng: 16.690.000đ

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

TẶNG MÀN HÌNH: Màn hình VSP IP2407S

\r\n

Hoặc - Màn hình máy tính VIOX MF2425-V 100Hz

\r\n

=> Giá PC Không lấy quà tặng: 16.690.000đ

\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '381', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + { + id: '3485', + catPath: ':3485:3469:1829:0', + name: '15 Triệu - 20 Triệu', + url: '/15-trieu-20-trieu-1', + }, + ], + }, + { + id: 28292, + productId: 28292, + priceUnit: 'chiếc', + marketPrice: 17990000, + price: 18300000, + price_off: -2, + currency: 'vnd', + sale_rules: { + price: 18300000, + normal_price: 18300000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-18 15:49:20', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming Ryzen 5 7500F, RAM 16GB, RTX 3050 6GB [TẶNG MÀN HÌNH]', + productSummary: '', + package_accessory: '', + productImage: { + small: + 'https://nguyencongpc.vn/media/product/75-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28448-pc-gaming-ryzen-5-7500f-ram-16gb-rx-7600-8gb.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-07.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-07.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-01.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-01.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-05.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-05.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-06.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-06.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-04.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-04.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-03.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-03.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-02.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28292-pc-gaming-ryzen-5-7500f-rtx-3050-6gb-02.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: 'https://nguyencongpc.vn/media/product/75-28292-27016-pc-gaming-25251328.jpg', + large: 'https://nguyencongpc.vn/media/product/250-28292-27016-pc-gaming-25251328.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-06', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 7081, + rating: 5, + reviewCount: 4, + review: { + rate: 5, + total: 4, + }, + comment: { + rate: 5, + total: 1, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

- Tặng Màn Hình :  VSP IP2407S - 24 INCH - 100HZ - 1MS

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 16.900.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

- Tặng Màn Hình :  VSP IP2407S - 24 INCH - 100HZ - 1MS

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 16.900.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '164', + pixel_code: '', + review_count: '45', + review_score: '4.6', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + { + id: '3471', + catPath: ':3471:3469:1829:0', + name: '5 Triệu - 15 Triệu', + url: '/5-trieu-15-trieu', + }, + ], + }, + { + id: 27016, + productId: 27016, + priceUnit: 'chiếc', + marketPrice: 0, + price: 19590000, + price_off: '', + currency: 'vnd', + sale_rules: { + price: 19590000, + normal_price: 19590000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-19 11:46:20', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming i5-12400F, RAM 16GB, RTX 3060 12GB [TẶNG MÀN HÌNH]', + productSummary: '', + package_accessory: '', + productImage: { + small: 'https://nguyencongpc.vn/media/product/75-27016-pc-gaming-25251328.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27016-pc-gaming-25251328.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: 'https://nguyencongpc.vn/media/product/75-27016-pc-gaming-25251328.jpg', + large: 'https://nguyencongpc.vn/media/product/250-27016-pc-gaming-25251328.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-011.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-011.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-012.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-012.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-013.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-013.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-014.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-014.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-015.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-015.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-016.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-27016-b----pc-gaming-i5-12400f--ram-16g--vga-3060-12g-016.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-27016-bo-----pc-gaming-i5-12400f---ram-16g---vga-3060-12g.webp', + large: + 'https://nguyencongpc.vn/media/product/250-27016-bo-----pc-gaming-i5-12400f---ram-16g---vga-3060-12g.webp', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-10', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 158097, + rating: 5, + reviewCount: 20, + review: { + rate: 5, + total: 20, + }, + comment: { + rate: 5, + total: 51, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

Tặng Màn Hình :  Màn hình VSP IP2407S

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 18.190.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

Tặng Màn Hình :  Màn hình VSP IP2407S

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 18.190.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 1, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '843', + pixel_code: '', + review_count: '19', + review_score: '4.5', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + { + id: '3485', + catPath: ':3485:3469:1829:0', + name: '15 Triệu - 20 Triệu', + url: '/15-trieu-20-trieu-1', + }, + ], + }, + { + id: 28294, + productId: 28294, + priceUnit: 'chiếc', + marketPrice: 0, + price: 19900000, + price_off: '', + currency: 'vnd', + sale_rules: { + price: 19900000, + normal_price: 19900000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-18 15:44:52', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming Ryzen 5 7500F, RAM 16GB, RX 7600 [TẶNG MÀN HÌNH]', + productSummary: '', + package_accessory: '0', + productImage: { + small: + 'https://nguyencongpc.vn/media/product/75-28294-ryzen-5-7500f-ram-16gb--rtx-3050-6gb-0102.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28294-ryzen-5-7500f-ram-16gb--rtx-3050-6gb-0102.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28294-ryzen-5-7500f-ram-16gb--rtx-3050-6gb-0102.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28294-ryzen-5-7500f-ram-16gb--rtx-3050-6gb-0102.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28294-ryzen-5-7500f--ram-16gb--rtx-3050-6gb-0101.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28294-ryzen-5-7500f--ram-16gb--rtx-3050-6gb-0101.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-09', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 3303, + rating: 0, + reviewCount: 0, + review: { + rate: 0, + total: 0, + }, + comment: { + rate: 0, + total: 0, + }, + quantity: 1, + productSKU: '0', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

- Tặng Màn Hình :  VSP IP2407S - 24 INCH - 100HZ - 1MS

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 18.500.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

- Tặng Màn Hình :  VSP IP2407S - 24 INCH - 100HZ - 1MS

\r\n

Hoặc VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 18.500.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '45', + pixel_code: '', + review_count: '56', + review_score: '4.2', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3485', + catPath: ':3485:3469:1829:0', + name: '15 Triệu - 20 Triệu', + url: '/15-trieu-20-trieu-1', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + ], + }, + { + id: 28293, + productId: 28293, + priceUnit: 'chiếc', + marketPrice: 0, + price: 20890000, + price_off: '', + currency: 'vnd', + sale_rules: { + price: 20890000, + normal_price: 20890000, + min_purchase: 1, + max_purchase: 1, + remain_quantity: 1, + from_time: 0, + to_time: 0, + type: '', + }, + lastUpdate: '2025-12-18 15:47:05', + warranty: 'Bảo hành theo từng linh kiện', + productName: 'Bộ PC Gaming Ryzen 5 7500F, RAM 16GB, RTX 3060 12GB [TẶNG MÀN HÌNH]', + productSummary: '', + package_accessory: '', + productImage: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-1.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-1.jpg', + original: '', + }, + imageCollection: [ + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-1.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-1.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-05.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-05.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-01.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-01.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-06.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-06.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-08.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-08.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-02.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-02.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-03.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-03.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-04.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-04.jpg', + original: '', + }, + alt: '', + }, + { + image: { + small: + 'https://nguyencongpc.vn/media/product/75-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-07.jpg', + large: + 'https://nguyencongpc.vn/media/product/250-28293-pc-gaming-ryzen-5-7500f-ram-16gb-rtx-3060-12gb-07.jpg', + original: '', + }, + alt: '', + }, + ], + productUrl: '/pc-gaming-ncpc-11', + brand: { + id: 124, + brand_index: 'ncpc', + name: 'NCPC', + image: '', + url: '/brand/ncpc', + }, + visit: 7539, + rating: 5, + reviewCount: 4, + review: { + rate: 5, + total: 4, + }, + comment: { + rate: 0, + total: 0, + }, + quantity: 1, + productSKU: '', + productModel: '', + hasVAT: 0, + condition: 'Mới', + config_count: 0, + configurable: 0, + component_count: 0, + specialOffer: { + other: [ + { + id: 0, + title: + '

- Tặng Màn Hình :  VSP IP2407S - 24 INCH - 100HZ - 1MS

\r\n

Hoặc  VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 19.490.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + all: [ + { + id: 0, + title: + '

- Tặng Màn Hình :  VSP IP2407S - 24 INCH - 100HZ - 1MS

\r\n

Hoặc  VIOX MF2425

\r\n

=>> Không lấy quà tặng màn hình : Giá PC là 19.490.000đ

\r\n\r\n

', + type: '', + thumbnail: '', + cash_value: 0, + quantity: 1, + from_time: '', + to_time: '', + url: '', + description: '', + status: 1, + }, + ], + }, + specialOfferGroup: [], + productType: { + isNew: 0, + isHot: 0, + isBestSale: 0, + isSaleOff: 0, + 'online-only': 0, + }, + bulk_price: [], + thum_poster: '0', + thum_poster_type: '', + addon: [], + variants: [], + variant_option: [], + extend: { + buy_count: '78', + }, + weight: 0, + promotion_price: null, + deal_list: [], + pricing_traces: [ + { + price: '11690000', + type: 'deal', + type_id: '565', + }, + ], + categories: [ + { + id: '1829', + catPath: ':1829:0', + name: 'PC GAMING', + url: '/pc-gaming', + }, + { + id: '3468', + catPath: ':3468:1829:0', + name: 'CHỌN THEO NHU CẦU', + url: '/chon-theo-nhu-cau-1', + }, + { + id: '3432', + catPath: ':3432:3468:1829:0', + name: 'PC ESPORT', + url: '/pc-esport', + }, + { + id: '3433', + catPath: ':3433:3468:1829:0', + name: 'PC GAME AAA', + url: '/pc-game-aaa', + }, + { + id: '3434', + catPath: ':3434:3468:1829:0', + name: 'PC STREAM GAME', + url: '/pc-stream-game', + }, + { + id: '3469', + catPath: ':3469:1829:0', + name: 'CHỌN THEO KHOẢNG GIÁ', + url: '/chon-theo-khoang-gia-1', + }, + { + id: '3471', + catPath: ':3471:3469:1829:0', + name: '5 Triệu - 15 Triệu', + url: '/5-trieu-15-trieu', + }, + ], + }, ]; diff --git a/src/lib/ButtonCart/index.ts b/src/lib/ButtonCart/index.ts new file mode 100644 index 0000000..9c0020c --- /dev/null +++ b/src/lib/ButtonCart/index.ts @@ -0,0 +1,69 @@ +import { TypeCartItem } from '@/types/cart'; + +// data +import { productData } from '@/data/ListProduct'; + +export const addToCart = (productId: string | number) => { + // Lấy giỏ hàng hiện tại từ localStorage + const cart: TypeCartItem[] = JSON.parse(localStorage.getItem('cart') || '[]'); + + console.log('chay tiếp'); + + const product = productData.find((p) => p.productId == productId); + if (!product) return; + + // Kiểm tra sản phẩm đã có trong giỏ chưa + const existing = cart.find((item) => item.item_info.id == productId); + + if (existing) { + // Nếu có rồi thì tăng số lượng + existing.in_cart.quantity = (parseInt(existing.in_cart.quantity) + 1).toString(); + existing.in_cart.total_price = + Number(existing.in_cart.quantity) * Number(existing.in_cart.price); + } else { + // Nếu chưa có thì thêm mới + const cartItem = { + _id: `product-${product.id}-0`, + item_type: 'product', + item_id: `${product.id}-0`, + item_info: { + id: product.productId, + priceUnit: product.priceUnit, + marketPrice: product.marketPrice, + hasVAT: product.hasVAT, + weight: product.weight, + price: product.price, + currency: product.currency, + bulk_price: product.bulk_price, + configurable: product.configurable, + productName: product.productName, + productImage: product.productImage, + productUrl: product.productUrl, + brand: product.brand, + productSKU: product.productSKU, + quantity: product.quantity, + addon: product.addon, + warranty: product.warranty, + variants: product.variants, + variant_option: product.variant_option, + extend: product.extend, + categories: product.categories, + specialOffer: product.specialOffer, + specialOfferGroup: product.specialOfferGroup, + sale_rules: product.sale_rules, + }, + in_cart: { + quantity: '1', + buyer_note: '', + price: product.price, + total_price: Number(product.quantity) * Number(product.price), + weight: '0', + total_weight: '0', + }, + }; + cart.push(cartItem); + } + + // Lưu lại vào localStorage + localStorage.setItem('cart', JSON.stringify(cart)); +}; diff --git a/src/styles/globals.css b/src/styles/globals.css index 613685c..0879be1 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -3433,7 +3433,7 @@ textarea::placeholder { -o-transition: color 0.2s ease-out; transition: color 0.2s ease-out; } -.page-product-detail .box-content-product-detail .detail-buy a { +.page-product-detail .box-content-product-detail .detail-buy button { padding: 8px 12px; text-align: center; background: #0a76e4; @@ -3441,16 +3441,16 @@ textarea::placeholder { color: #fff; font-size: 13px; } -.page-product-detail .box-content-product-detail .detail-buy a:first-child { +.page-product-detail .box-content-product-detail .detail-buy button:first-child { background: #e31223; } -.page-product-detail .box-content-product-detail .detail-buy a:hover { +.page-product-detail .box-content-product-detail .detail-buy button:hover { background: #007eff !important; } -.page-product-detail .box-content-product-detail .detail-buy a:first-child:hover { +.page-product-detail .box-content-product-detail .detail-buy button:first-child:hover { background: #ff0015 !important; } -.page-product-detail .box-content-product-detail .detail-buy a span { +.page-product-detail .box-content-product-detail .detail-buy button span { width: 100%; float: left; font-weight: 20px; @@ -4458,7 +4458,7 @@ textarea::placeholder { color: var(--swiper-theme-color); } .page-cart .box-info-cart { - padding: 12px 0; + padding: 12px; margin-bottom: 44px; } .page-cart .box-delete-all { @@ -4497,10 +4497,13 @@ textarea::placeholder { } .page-cart .cart-item-info .quantity-change { border: 1px solid #d6d6d6; - padding: 10px 8px; + width: 32px; height: 32px; cursor: pointer; color: #b8b8b8; + display: flex; + align-items: center; + justify-content: center; } .page-cart .cart-item-info .quantity-change:hover { color: var(--swiper-theme-color); @@ -4540,12 +4543,12 @@ textarea::placeholder { margin-bottom: 12px; } .page-cart .box-cart-info-customer { - margin: 20px 12px 16px; + margin: 20px 0; } .page-cart .box-cart-info-customer .list-info-customer input, .page-cart .box-cart-info-customer .list-info-customer select, .page-cart .box-cart-info-customer .list-info-customer textarea { - width: 100%; + width: 97%; border: 1px solid #d6d6d6; padding: 13px 12px; border-radius: 5px; @@ -4554,7 +4557,7 @@ textarea::placeholder { outline: 0; } .page-cart .box-cart-info-customer .list-info-customer select { - color: #b8b8b8; + color: #000; } .page-cart .box-cart-info-customer .list-info-customer input::-webkit-input-placeholder, .page-cart .box-cart-info-customer .list-info-customer textarea::-webkit-input-placeholder { @@ -4589,9 +4592,7 @@ textarea::placeholder { width: max-content; margin-bottom: 0; } -.page-cart .box-payment { - padding: 0 12px; -} + .page-cart .box-payment .list-method-payment { margin-bottom: 16px; } @@ -4603,7 +4604,7 @@ textarea::placeholder { } .page-cart .box-payment .has-vat { width: 100%; - float: left; + display: block; font-size: 16px; text-align: right; margin-top: 10px; @@ -4645,8 +4646,7 @@ textarea::placeholder { .page-cart .not-cart { margin: 0 auto; text-align: center; - padding: 30px 0; - padding: 0 8px; + padding: 50px 8px; max-width: 1216px; display: -webkit-box; display: -ms-flexbox; diff --git a/src/types/cart/index.ts b/src/types/cart/index.ts new file mode 100644 index 0000000..0e4eee0 --- /dev/null +++ b/src/types/cart/index.ts @@ -0,0 +1,46 @@ +import { ProductImage, Brand, Category, SaleRules, Extend, SpecialOfferItem } from '@/types'; + +export interface CartProductInfo { + id: number; + productName: string; + price: string | number; + productImage: ProductImage; + productUrl: string; + brand: Brand; + warranty: string; + quantity: number; + priceUnit?: string; + marketPrice?: number; + hasVAT?: number; + weight?: number; + currency?: string; + bulk_price?: []; + configurable?: number; + addon?: []; + variants?: []; + variant_option?: []; + extend?: Extend; + categories?: Category[]; + specialOffer?: { other?: SpecialOfferItem[]; all?: SpecialOfferItem[] }; + specialOfferGroup?: []; + sale_rules?: SaleRules; +} + +// Thông tin sản phẩm trong giỏ +export interface InCart { + quantity: string; + buyer_note: string; + price: number | string; + total_price: number; + weight: string; + total_weight: string; +} + +// Item trong giỏ hàng +export interface TypeCartItem { + _id: string; + item_type: string; + item_id: string; + item_info: CartProductInfo; + in_cart: InCart; +} diff --git a/src/types/global/TypeListProduct.ts b/src/types/global/TypeListProduct.ts index a7fca08..2621cd0 100644 --- a/src/types/global/TypeListProduct.ts +++ b/src/types/global/TypeListProduct.ts @@ -56,25 +56,24 @@ export interface Category { } export interface Extend { - pixel_code?: string; - review_count?: string; - review_score?: string; - buy_count?: string; + pixel_code?: string; + review_count?: string; + review_score?: string; + buy_count?: string; } -export interface SpecialOfferItem { - id: number; - title: string; - type: string; - thumbnail: string; - cash_value: number; - quantity: number; - from_time: string; - to_time: string; - url: string; - description: - string; - status: number; +export interface SpecialOfferItem { + id: number; + title: string; + type: string; + thumbnail: string; + cash_value: number; + quantity: number; + from_time: string; + to_time: string; + url: string; + description: string; + status: number; } export interface Product { @@ -83,7 +82,7 @@ export interface Product { priceUnit: string; marketPrice: number; price: string | number; - price_off: number; + price_off: number | string; currency: string; sale_rules: SaleRules; lastUpdate: string; @@ -108,7 +107,7 @@ export interface Product { config_count: number; configurable: number; component_count: number; - specialOffer: { other?: SpecialOfferItem[], all?: SpecialOfferItem[] }; + specialOffer: { other?: SpecialOfferItem[]; all?: SpecialOfferItem[] }; specialOfferGroup: []; productType: { isNew: number; @@ -131,5 +130,4 @@ export interface Product { categories: Category[]; } - -export type TypeListProduct = Product[]; \ No newline at end of file +export type TypeListProduct = Product[]; diff --git a/src/types/product/detail/index.ts b/src/types/product/detail/index.ts index 01c737b..9304560 100644 --- a/src/types/product/detail/index.ts +++ b/src/types/product/detail/index.ts @@ -19,14 +19,14 @@ interface Brand { } // Product Image -export interface ProductImage { +export interface ProductImageDetail { small: string; large: string; original: string; } export interface ProductImageGallery { - size: ProductImage; + size: ProductImageDetail; alt: string; folder: string; } @@ -135,7 +135,7 @@ export interface ProductInfo { productSKU: string; productUrl: string; productName: string; - productImage: ProductImage; + productImage: ProductImageDetail; price: string; quantity: string; currency: string;