diff --git a/components/AppsComponent/CheckoutData/page.jsx b/components/AppsComponent/CheckoutData/page.jsx
index d7f86dc..7be3fdb 100644
--- a/components/AppsComponent/CheckoutData/page.jsx
+++ b/components/AppsComponent/CheckoutData/page.jsx
@@ -35,7 +35,6 @@ const CheckoutData = () => {
const data = await Chapar.get(
`${process.env.NEXT_PUBLIC_API_URL}/warehouse/shipping?page=0`
);
-
setShippingData(data);
} catch ({ error, status }) {
toast.error(`${error?.response?.data?.message}`, {
@@ -118,6 +117,13 @@ const CheckoutData = () => {
}
};
+ const filteredShippingData = shippingData?.filter((item) => {
+ if (item.name === "ارسال رایگان" && checkOutData.totalPrice <= 5000000) {
+ return false;
+ }
+ return true;
+ });
+
useEffect(() => {
if (shippingData.length <= 0) {
GetShippingData();
@@ -138,6 +144,8 @@ const CheckoutData = () => {
setPermissionGoPay(false);
}, []);
+ console.log("checkOutData", checkOutData);
+
return (
<>
@@ -255,7 +263,7 @@ const CheckoutData = () => {
- {shippingData?.map((e, index) => (
+ {filteredShippingData?.map((e, index) => (
handleShippingID(index)}
className={`flex rtl justify-between cursor-pointer mx-2 ${
@@ -291,15 +299,20 @@ const CheckoutData = () => {
{e.name}{" "}
-
- {" "}
- هزینه ارسال
-
- هزار تومان
-
+ {e.name == "ارسال رایگان" ? (
+
+ ارسال با پست پیشتاز
+
+ ) : (
+
+ هزینه ارسال
+
+ هزار تومان
+
+ )}
diff --git a/components/Carts/component/NavBarDownCart/page.jsx b/components/Carts/component/NavBarDownCart/page.jsx
index 2eb7e6f..9661bda 100644
--- a/components/Carts/component/NavBarDownCart/page.jsx
+++ b/components/Carts/component/NavBarDownCart/page.jsx
@@ -3,7 +3,7 @@ import PersianNumber from "plugins/PersianNumber";
const NavBarDownCart = ({ calculateTotalCost, event, permissionGoPay }) => {
return (
-
+
{/* */}
diff --git a/components/Navbar/SideBarNavBarMobile/page.jsx b/components/Navbar/SideBarNavBarMobile/page.jsx
index 5658919..a33cc8d 100644
--- a/components/Navbar/SideBarNavBarMobile/page.jsx
+++ b/components/Navbar/SideBarNavBarMobile/page.jsx
@@ -13,7 +13,9 @@ const SideBarNavBarMobile = () => {
const [firstChild, setFirstChild] = useState([]);
const [firstChildIndex, setFirstChildIndex] = useState(-1);
- const dataNav = CTX.state.navData;
+ const dataNav = CTX?.state?.navData?.filter(
+ (item) => item.name !== "بهداشت خانه و آشپرخانه"
+ );
const isSearched = CTX.state.isSearched;
const searchResultCategoryData = CTX.state.searchResultData.categories;
const searchResultProductData = CTX.state.searchResultData.products;
diff --git a/components/Navbar/page.jsx b/components/Navbar/page.jsx
index 2f24cc3..8f8fc14 100644
--- a/components/Navbar/page.jsx
+++ b/components/Navbar/page.jsx
@@ -21,7 +21,10 @@ const Navbar = ({ theme }) => {
const CTX = useContext(AppContext);
const router = useRouter();
- const dataNav = CTX.state.navData;
+
+ const dataNav = CTX?.state?.navData?.filter(
+ (item) => item.name !== "بهداشت خانه و آشپرخانه"
+ );
const profile = CTX.state.profile;
const cart = CTX.state.cart;
const searchResultCategoryData = CTX.state.searchResultData.categories;
diff --git a/src/app/cart/page.jsx b/src/app/cart/page.jsx
index 72bae1b..523f4f5 100644
--- a/src/app/cart/page.jsx
+++ b/src/app/cart/page.jsx
@@ -4,10 +4,28 @@ import React from "react";
export const metadata = {
title: "سبد خرید",
};
-const page = () => {
+
+const fetchSpecialOffer = async (categoryId) => {
+ try {
+ const res = await fetch(
+ `${process.env.NEXT_PUBLIC_API_URL}/product?page=0&specialOffer=true`
+ );
+ const specialOffer = await res.json();
+
+ console.log("===================", specialOffer.products);
+ return specialOffer;
+ } catch (error) {
+ console.error("Error fetching fetchSpecialOffer:", error);
+ return [];
+ }
+};
+
+const page = async () => {
+ const products = await fetchSpecialOffer();
+
return (
<>
-
+
>
);
};
diff --git a/src/app/profile/orders/page.jsx b/src/app/profile/orders/page.jsx
index 97d0413..5e5ca9a 100644
--- a/src/app/profile/orders/page.jsx
+++ b/src/app/profile/orders/page.jsx
@@ -90,7 +90,7 @@ const Page = () => {
تاریخ سفارش
- تاریخ تحویل
+ کد سفارش{" "}
|
مرحله سفارش
@@ -119,7 +119,9 @@ const Page = () => {
.format("jYYYY/jM/jD")}
/>
- | - |
+
+ {e.factorCode}
+ |
|