Cart: show variant label

This commit is contained in:
2025-11-11 15:47:07 +03:00
parent dc18d84ac8
commit 42a70affe2
4 changed files with 33 additions and 26 deletions

View File

@@ -17,33 +17,30 @@ const ProCheckboxGroups = ({ options, ...props }: ProCheckboxGroupsProps) => {
> >
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
{options.map((option: any) => ( {options.map((option: any) => (
<> <Checkbox
<Checkbox key={option.value}
key={option.value} value={option.value}
value={option.value} // style={{ width: 24, height: 24, borderRadius: 30 }}
// style={{ width: 24, height: 24, borderRadius: 30 }} >
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
width: "100%",
padding: "8px 0",
}}
> >
<div <ProText
style={{ style={{
display: "flex", fontSize: "1rem",
flexDirection: "row",
justifyContent: "space-between",
width: "100%",
padding: "8px 0",
}} }}
> >
<ProText {option.label}
style={{ </ProText>
fontSize: "1rem", <ProText style={{ fontSize: "1rem" }}>{option.price}</ProText>
}} </div>
> </Checkbox>
{option.label}
</ProText>
<ProText style={{ fontSize: "1rem" }}>{option.price}</ProText>
</div>
</Checkbox>
{/* {index !== options.length - 1 && <Divider style={{ margin: 0 }} />} */}
</>
))} ))}
</Space> </Space>
</Checkbox.Group> </Checkbox.Group>

View File

@@ -42,6 +42,7 @@ export default function CartMobileTabletLayout({
}: CartMobileTabletLayoutProps) { }: CartMobileTabletLayoutProps) {
const { t } = useTranslation(); const { t } = useTranslation();
const { items, collectionMethod, orderType } = useAppSelector(selectCart); const { items, collectionMethod, orderType } = useAppSelector(selectCart);
const { isRTL } = useAppSelector((state) => state.locale);
const { subdomain } = useParams(); const { subdomain } = useParams();
const { isMobile, isTablet } = useBreakPoint(); const { isMobile, isTablet } = useBreakPoint();
@@ -146,7 +147,16 @@ export default function CartMobileTabletLayout({
fontWeight: 600, fontWeight: 600,
}} }}
> >
{item.name} {item.name}{" "}
<span
style={{
fontWeight: 400,
}}
>
{isRTL
? item.variant?.optionsAR[0].value
: item.variant?.options[0].value}
</span>
</ProText> </ProText>
<br /> <br />
<ProText <ProText

View File

@@ -67,7 +67,7 @@ export default function ProductFooter({
image: product?.image, image: product?.image,
description: product?.description, description: product?.description,
comment: specialRequest, comment: specialRequest,
variant: selectedVariant?.id, variant: selectedVariant,
extras: selectedExtras, extras: selectedExtras,
extrasgroup: selectedGroups, extrasgroup: selectedGroups,
isHasLoyalty: product?.isHasLoyalty, isHasLoyalty: product?.isHasLoyalty,

View File

@@ -321,7 +321,7 @@ export interface CartItem {
image: string; image: string;
quantity: number; quantity: number;
description: string; description: string;
variant?: string; variant?: Variant;
extras?: Extra[]; extras?: Extra[];
extrasgroup?: Extra[]; extrasgroup?: Extra[];
isHasLoyalty?: boolean; isHasLoyalty?: boolean;