Add products reviews so later we can short by reviews.
Star system + Comment.
Only after purchase you can add 1 review.
Review option to disable. Doesn't appear in the product page or to add the review in the user panel.e
Add field Rank/rate to products. it recalculates after new review its posted.
mysql_query("CREATE TABLE IF NOT EXISTS ".$_POST['TABLE_PREFIX']."reviews (
id_review int(10) unsigned NOT NULL AUTO_INCREMENT,
id_user int(10) unsigned NOT NULL,
id_product int(10) unsigned NOT NULL,
rate int(2) unsigned NOT NULL DEFAULT '0',
description text NOT NULL,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ip_address float DEFAULT NULL,
status tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (id_review) USING BTREE,
KEY ".$_POST['TABLE_PREFIX']."reviews_IK_id_user (id_user),
KEY ".$_POST['TABLE_PREFIX']."reviews_IK_id_product (id_product)
) ENGINE=InnoDB DEFAULT CHARSET=".$POST['DBCHARSET'].";");```