Itemcard Mrp display
This commit is contained in:
parent
65eb86ffdd
commit
2cf8d10feb
|
|
@ -5203,7 +5203,33 @@ const BSItemCard = (props) => {
|
||||||
return null; // or any other value you want to return
|
return null; // or any other value you want to return
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const ItemMRP = (item) => {
|
||||||
|
// const variantWithDetails = item?.ProductDetail?.find((variant) => variant?.ProdVariantDetails?.length > 0);
|
||||||
|
|
||||||
|
if (preferenceSingleSales && item.OnePcsAvailable === 'Y') {
|
||||||
|
return (
|
||||||
|
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||||
|
?.OnePcsPrice || null
|
||||||
|
);
|
||||||
|
// OnePcsPrice
|
||||||
|
}
|
||||||
|
|
||||||
|
const variantWithDetails = item?.ProductDetail?.find(
|
||||||
|
(variant) =>
|
||||||
|
variant?.ProdVariantDetails?.length > 0 &&
|
||||||
|
variant?.ProdVariantDetails?.[0]?.StockDetails?.[0]?.MRP
|
||||||
|
);
|
||||||
|
if (variantWithDetails) {
|
||||||
|
// Access the details of the first variant with ProdVariantDetails
|
||||||
|
const firstVariantDetails =
|
||||||
|
variantWithDetails?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||||
|
?.MRP;
|
||||||
|
return firstVariantDetails;
|
||||||
|
} else {
|
||||||
|
// Handle the case where no variant satisfies the condition
|
||||||
|
return null; // or any other value you want to return
|
||||||
|
}
|
||||||
|
};
|
||||||
const ItemSize = (item) => {
|
const ItemSize = (item) => {
|
||||||
if (preferenceSingleSales && item?.OnePcsAvailable === 'Y') {
|
if (preferenceSingleSales && item?.OnePcsAvailable === 'Y') {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -6429,6 +6455,40 @@ const BSItemCard = (props) => {
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
{cardFunction?.MRP &&
|
||||||
|
((item?.OverAllQty !== undefined &&
|
||||||
|
(!preferenceSingleSales
|
||||||
|
? item?.OverAllQty !== 0
|
||||||
|
: item?.OverAllPcs !== 0) &&
|
||||||
|
item?.OverAllQty !== null) ||
|
||||||
|
item?.ProductDetail?.some(
|
||||||
|
(item) =>
|
||||||
|
item?.StockAvailable !== 'Y'
|
||||||
|
)) && (
|
||||||
|
<p
|
||||||
|
className="BSItemCard-itemPrice"
|
||||||
|
style={{
|
||||||
|
fontSize:
|
||||||
|
!cardFunction?.SmallImage
|
||||||
|
? cardFunction?.BigImage &&
|
||||||
|
'12px'
|
||||||
|
: '12px',
|
||||||
|
textAlign: 'center',
|
||||||
|
lineHeight: '2',
|
||||||
|
fontFamily: SelectedCardFont
|
||||||
|
? SelectedCardFont
|
||||||
|
: '',
|
||||||
|
color: SelectedCardColor
|
||||||
|
? SelectedCardColor?.[
|
||||||
|
'FontColor'
|
||||||
|
]
|
||||||
|
: '',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
MRP: ₹ {ItemMRP(item)}
|
||||||
|
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
{cardFunction?.Price &&
|
{cardFunction?.Price &&
|
||||||
((item?.OverAllQty !== undefined &&
|
((item?.OverAllQty !== undefined &&
|
||||||
(!preferenceSingleSales
|
(!preferenceSingleSales
|
||||||
|
|
@ -6842,6 +6902,40 @@ const BSItemCard = (props) => {
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
{cardFunction?.MRP &&
|
||||||
|
((item?.OverAllQty !== undefined &&
|
||||||
|
(!preferenceSingleSales
|
||||||
|
? item?.OverAllQty !== 0
|
||||||
|
: item?.OverAllPcs !== 0) &&
|
||||||
|
item?.OverAllQty !== null) ||
|
||||||
|
item?.ProductDetail?.some(
|
||||||
|
(item) =>
|
||||||
|
item?.StockAvailable !== 'Y'
|
||||||
|
)) && (
|
||||||
|
<p
|
||||||
|
className="BSItemCard-itemPrice"
|
||||||
|
style={{
|
||||||
|
fontSize:
|
||||||
|
!cardFunction?.SmallImage
|
||||||
|
? cardFunction?.BigImage &&
|
||||||
|
'12px'
|
||||||
|
: '12px',
|
||||||
|
textAlign: 'center',
|
||||||
|
lineHeight: '2',
|
||||||
|
fontFamily: SelectedCardFont
|
||||||
|
? SelectedCardFont
|
||||||
|
: '',
|
||||||
|
color: SelectedCardColor
|
||||||
|
? SelectedCardColor?.[
|
||||||
|
'FontColor'
|
||||||
|
]
|
||||||
|
: '',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
MRP: ₹ {ItemMRP(item)}
|
||||||
|
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
{cardFunction?.Price &&
|
{cardFunction?.Price &&
|
||||||
((item?.OverAllQty !== undefined &&
|
((item?.OverAllQty !== undefined &&
|
||||||
(!preferenceSingleSales
|
(!preferenceSingleSales
|
||||||
|
|
@ -7146,6 +7240,28 @@ const BSItemCard = (props) => {
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
{cardFunction?.MRP && ((item?.OverAllQty !== undefined &&
|
||||||
|
!preferenceSingleSales
|
||||||
|
? returnCount(
|
||||||
|
item?.ProductDetail?.[0]?.ProdName,
|
||||||
|
item?.OverAllQty,
|
||||||
|
CartOrderDetails,
|
||||||
|
item
|
||||||
|
)
|
||||||
|
: returnOnepcCount(
|
||||||
|
item?.ProductDetail?.[0]?.ProdName,
|
||||||
|
item?.OverAllPcs,
|
||||||
|
CartOrderDetails
|
||||||
|
) > 0) ||
|
||||||
|
item?.ProductDetail?.some(
|
||||||
|
(item) => item?.StockAvailable !== 'Y'
|
||||||
|
)) && (
|
||||||
|
<div className="card4PriceUom">
|
||||||
|
<div className="card4MRP">
|
||||||
|
MRP: ₹ {ItemMRP(item)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{ ((item?.OverAllQty !== undefined &&
|
{ ((item?.OverAllQty !== undefined &&
|
||||||
!preferenceSingleSales
|
!preferenceSingleSales
|
||||||
? returnCount(
|
? returnCount(
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@ function dynamicComponentProps(sessionName, data, componentName) {
|
||||||
ImageUp: false,
|
ImageUp: false,
|
||||||
ImageDown: false,
|
ImageDown: false,
|
||||||
BigImage: false,
|
BigImage: false,
|
||||||
|
MRP: false,
|
||||||
|
|
||||||
};
|
};
|
||||||
let output = {};
|
let output = {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -975,6 +975,17 @@
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.card4MRP {
|
||||||
|
font-size: 0.80rem;
|
||||||
|
line-height: 0.80rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #059669;
|
||||||
|
-webkit-text-stroke-width: 0.3px;
|
||||||
|
|
||||||
|
@media (max-width: 500px) {
|
||||||
|
font-size: 0.50rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.card4Uom {
|
.card4Uom {
|
||||||
background-color: #f3f4f6;
|
background-color: #f3f4f6;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue