Skip to content

[Bug] Card component fabricates ratings, review counts, and discounts from product ID hash — deceptive to users #230

@vedant7007

Description

@vedant7007

Description

while auditing the product display layer I noticed Card.jsx generates fake ratings (3.5-5.0), fake review counts (45-195), fake discount percentages (10-40%), and fake dispatch times from a deterministic hash of the product ID. none of these come from the database.

The Problem

Card.jsx lines 127-143: a useMemo block computes fabricated metrics using a pseudo-random seed from the product ID. the 'original price' is computed from the fake discount inflating a fictional 'was' price. the product schema already has rating and reviewCount fields populated by the review controller but Card.jsx ignores them entirely.

users see '4.2 stars (123 reviews)' and 'Save 340 rupees' on products with zero actual reviews and no real discount.

Proposed Fix

  • pass actual rating and reviewCount from product data as props
  • remove the entire useMemo pseudo-random block
  • only show discount when product model has explicit originalPrice or discountPercent set by admin
  • show 'No reviews yet' when reviewCount is 0
  • hide dispatch time badges until real estimation exists

every product shows fabricated metrics — deceptive and potentially violates consumer protection regulations.

I would like to work on this under GSSoC 26. please assign!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions