Almost have this working the displaying of reviews based on the custom product define
products_review_id is working.
I have products_review_id in TABLE
products and in TABLE
reviews. I imported my reviews that were from a different source into the reviews table and added the table field products_review_id there. The displaying of the reviews based on this is done using the code below:
PHP Code:
$reviews = $db->Execute('SELECT SUM(reviews_rating) AS rating, COUNT(reviews_id) AS total_review FROM ' . TABLE_REVIEWS . ' WHERE status = 1 AND (products_id = ' . (int)$productId . ' OR products_review_id IN (SELECT products_review_id FROM ' . TABLE_PRODUCTS . ' WHERE products_id = ' . (int)$productId . '))');
Now the issue going forward is that every new review made within Zencart I will need to write to TABLE
reviews the
products_review_id based on the
product_id the review is being made for. The code needs to reference the TABLE
products and get the products_review_id from there to write it to the TABLE
reviews.
I can not get it to work can you give an example of the code that will do this?
Then if not to much trouble a second piece of code I can use as an if statement to hide the reviews from products that the
products_review_id in TABLE
products is empty?
Thanks for your help!
Bookmarks