import React, { useState, useEffect } from "react"; import { userProduct, userFactor, publicApi } from "../../redux/actions"; import separate from '../../utils/separate'; import { toast } from "react-toastify"; import DeliveryForm from "../DeliveryForm"; import Product from "./Product"; import Address from "../Address"; import Code from "./Code"; import Button from "../../components/Button"; //assets import dropdownIcon from "../../assets/icons/dropdown-blue.svg"; import alertIcon from "../../assets/icons/alert.svg"; import { connect } from "react-redux"; function ShoppingCart({ isDark, isMobile, list, payPrice, factorInfo, user, hasPhysical, getList, getInfo, getFactorInfo, payFactor, headerOptions, setHeaderOptions, desktopContentTransform, userProducts, loading, }) { const [phase, setPhase] = useState("products"); useEffect(() => { getList(); getFactorInfo({ userId: user?.id }); setHeaderOptions(headerOptions); }, []); const productsLength = userProducts?.filter( (product) => product.condition < 2 )?.length; const next = { products: () => productsLength ? setPhase("deliveryForm") : toast.info("ابتدا یک محصول را به سبد خرید خود اضافه کنید."), deliveryForm: () => console.log("Go to shaparak"), profile: () => { console.log("Set profile"); console.log("Go to shaparak"); }, }; const Table = () => { return (
{factorInfo?.payPrice + " " + "تومان"}
هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود
{separate(productsLength ? factorInfo?.payPrice : 0)} تومان
هزینه ارسال کالا پس از تعیین محل آدرس مشخص میشود