Enable ratings/comments on all products

How can I enable ratings/comments on all products in our store? So far I can only find a way to do it one by one, with 2000 products it’s going to take forever to do. Why is mass editing so difficult with CS Cart?!

You can use the mass edit feature to change this.


  1. Set the “Total items” in the upper-right to 100
  2. Search (I would do a category at a time)
  3. Select all products
  4. Choose ‘Edit selected’ at the "Choose action link in the lower-left
  5. Hit the"Unselect all" link
  6. Check “Reviews” and hot the “Modify selected” button
  7. Hit the “apply values to all selected products” link
  8. Check “Reviews” and choose your preference (Communication, Rating or All)
  9. Hit the “Apply” button
  10. Hit the “save” button



    Repeat steps 3-10 for each page of searched products.



    This is still time-consuming but better than one at a time.



    Bob

Thanks, never saw the “Apply values to all selected products” until now

Ok where in the database is this stored? I just want to run a simple sql update.

Oh here it is:



You need to make sure there is an entry in the discussions table. Object_id is the product_id, object_type is P for product, and type is B for both in my case. You can add comments/reviews to a product and watch the changes in this table for that product_id to figure it out.

Now my only problem is I cannot find or add a link to generate a new comment or review etc (on the product page, not in admin)

[quote name=‘jobosales’]You can use the mass edit feature to change this.


  1. Set the “Total items” in the upper-right to 100
  2. Search (I would do a category at a time)
  3. Select all products
  4. Choose ‘Edit selected’ at the "Choose action link in the lower-left
  5. Hit the"Unselect all" link
  6. Check “Reviews” and hot the “Modify selected” button
  7. Hit the “apply values to all selected products” link
  8. Check “Reviews” and choose your preference (Communication, Rating or All)
  9. Hit the “Apply” button
  10. Hit the “save” button



    Repeat steps 3-10 for each page of searched products.



    This is still time-consuming but better than one at a time.



    Bob[/QUOTE]

    Thank you Jobosales, that really worked great for me.:smiley:

I have over 12,000 products on our site and updating them all via the procedure above would be tedious, so I wrote a small PHP app that will insert rows into the cscart_discussion table to enable reviews for all active products. I wanted all products to be set to “Communication and Rating” which is the “B” attribute in the “type” column.



If you use this, I highly recommend running this in a test environment and then backing up your cscart_discussion table before proceeding in production. This is an unsupported “use at your own risk” app, but it worked just dandy for me. I am on 2.0.15, so I can’t guarantee this will work on any other version. Add values to the $username, $password, and $cscartDB variables for your installation.


```php


// login to the cscart database
$username="";
$password="";
$cscartDB="";
mysql_connect('localhost', $username, $password);
@mysql_select_db($cscartDB) or die("Unable to select $cscartDB database");

// get all the active product_id's from the cscart_products table
$query = "SELECT product_id FROM cscart_products WHERE status='A'";
$productsResult = mysql_query($query);
$numRows = mysql_numrows($productsResult);
echo "Processing $numRows product id's...\n";

while ($row = mysql_fetch_assoc($productsResult)) {
$cscart_product_id = $row['product_id'];

// see if there is a row already for this cscart_product_id
$query="select object_id from cscart_discussion where object_id=$cscart_product_id AND object_type = 'P'";
$result=mysql_query($query);

// if not, add a row to cscart_discussion
if (mysql_num_rows($result) == 0) {
echo "Inserting record into cscart_discussion for $cscart_product_id\n";
$query="INSERT INTO cscart_discussion (object_id, object_type, type) VALUES ($cscart_product_id, 'P', 'B')";
$result=mysql_query($query);

if (!$result)
echo "Query failed: ($query): " . mysql_error(). "\n";
}
}
?>

```

[quote name='ChrisW' timestamp='1297364713' post='103593']

If you use this, I highly recommend running this in a test environment and then backing up your cscart_discussion table before proceeding in production. This is an unsupported “use at your own risk” app, but it worked just dandy for me. I am on 2.0.15, so I can't guarantee this will work on any other version. Add values to the $username, $password, and $cscartDB variables for your installation.

[/quote]

Just to reiterate, definitely back up your cscart_discussion table (at the very least) before running this. Best to be safe than sorry! I just created a file at the store root called enablereviews.php, put your code in, edited the login details for the database, browsed to example.com/enablereviews.php and the script ran flawlessly - now Communication & Reviews are enabled on all the stores products without having to enable this one by one or page by page bulk edit (which, with 5000+ products, is still 50+ bulk edits to do).



Is there any way to set this setting to Communcation and Reviews as default, so any new products I add are automatically set to this setting?



I used this on CS Cart 2.2.3 and compared the cscart_discussion table with a manually enabled and a script enabled row, both are correct - excellent stuff, thank you!

Just a quick comment for anyone who doesnt want to fool with the db or php. Where the chooser is for amount of products displayed on a page just hover over the 100 and copy the link to the clipboard, then paste this in your browser and change the 100 at the end to 500 or whatever higher amount your server will handle in 1 go It will take a little longer to chew through the info but works fine.



http://www. somesite . com/admin.php?dispatch=products.manage&items_per_page=100

John

[quote name=‘jobosales’ timestamp=‘1264642374’ post=‘68491’]

You can use the mass edit feature to change this.




  1. Set the “Total items” in the upper-right to 100


  2. Search (I would do a category at a time)


  3. Select all products


  4. Choose ‘Edit selected’ at the "Choose action link in the lower-left


  5. Hit the"Unselect all" link


  6. Check “Reviews” and hot the “Modify selected” button


  7. Hit the “apply values to all selected products” link



    8) Check “Reviews” and choose your preference (Communication, Rating or All)


  8. Hit the “Apply” button


  9. Hit the “save” button





    Repeat steps 3-10 for each page of searched products.





    This is still time-consuming but better than one at a time.





    Bob

    [/quote]



    I don’t see “Reviews” after following step by step process. Why is that?

[quote name='mifzal' timestamp='1319992781' post='124899']

I don't see “Reviews” after following step by step process. Why is that?

[/quote]





You sure you'[attachment=4666:reviews.JPG]re looking properly ? or maybe you ar eon community version, I dont know if community version has it?

reviews.JPG