How to delete / clear all product reviews in magento? - magento

How to delete / clear all product reviews in magento?

Go to Catalog -> Reviews and Ratings -> Customer Reviews -> All Reviews
There are checkboxes and you can take the "Delete" action in the upper right.

truncate table `rating_option_vote`;
truncate table `rating_option_vote_aggregated`;
truncate table `review`;
truncate table `review_detail`;
truncate table `review_entity_summary`;
truncate table `review_store`;

You do not have to delete all of the tables, just the main one (review) and the aggregated (review_entity_summary), they use foreign keys and are set to cascade on delete of parent.
You can just run the following:
DELETE FROM review;
DELETE FROM review_entity_summary;
DELETE FROM rating_option_vote;
DELETE FROM rating_option_vote_aggregated;
That should help remove any old reviews.

Related

Laravel - Please advise on table name

I am in trouble with the name of the pivot table.
products ... Product master table
shop ... Shop master table.
shop_sales ... A table that links products and dates. It leads to another table. The column is date and shop_id.
I want to add a table to shop_sales to manage products and the number sold.
shop_sale_products vs product_shop_sale
Does laravel recommend product_shop_sale?
thanks.

One or more of the Cache Types are invalidated: Blocks HTML output

I just installed the mageneto and added my first product. It didn't show up in the font page so I went to inventory on product information and tried to set Stock Availability to in stock but I started getting this error message:
One or more of the Cache Types are invalidated: Blocks HTML output.
Click here to go to Cache Management and refresh cache types..
I did this several times, logged and tried again but it appear every time I try to change Stock Availability.
How do I fix this?
Googling I fond that's a common issue on mageneto and found this exntension and installed following this instructions but it didn't work either.
Step:01
System==> Index Management==>Select All ==>Actions(Reindex)==>Submit
Step:02
You may delete cache directory contain all file
magento directory\var\cache\
Step:03
Another way You may clean database log table
#Must Be take Backup before do it:
TRUNCATE TABLE dataflow_batch_export;
TRUNCATE TABLE dataflow_batch_import;
TRUNCATE TABLE log_customer;
TRUNCATE TABLE log_quote;
TRUNCATE TABLE log_summary;
TRUNCATE TABLE log_summary_type;
TRUNCATE TABLE log_url;
TRUNCATE TABLE log_url_info;
TRUNCATE TABLE log_visitor;
TRUNCATE TABLE log_visitor_info;
TRUNCATE TABLE log_visitor_online;
TRUNCATE TABLE report_event;
TRUNCATE TABLE log_customer;
TRUNCATE TABLE log_quote;
In my case I had to flush the cache and after that it was fine.cache error screen
flushed cache error screen

Magento automatically adds random product to cart, super weird issue

I have this website http://www.hageredskap.no. If you try to add any product to cart, you will see it automatically adds one more random product. This only happens at the first add to cart action, not after that.(so you can clear cookie to try again). In admin, these products have no connection. no related, crossell or upsell. Each time it random adds one different product, usually out of stock ones.
So far, what i have tried :
- Disabled all 3rd extensions, all keep core Magento
- Change template to RWD (default)
But it still happens.
I want to hear your theories, please. What might cause this super strange issue? This site has been upgraded from Magento 1.5 to 1.9.1 but i don't remember if this ever happened before upgrading.
I find out the solution, just truncate those quote tables
SET FOREIGN_KEY_CHECKS=0;
truncate sales_flat_quote;
truncate sales_flat_quote_address;
truncate sales_flat_quote_shipping_rate;
truncate sales_flat_quote_address_item;
truncate sales_flat_quote_item;
truncate sales_flat_quote_item_option;
truncate sales_flat_quote_payment;
SET FOREIGN_KEY_CHECKS=1;
Had the same situation with Magento 2.3.3
This solution works on Magento 2. Just need to change table names accordingly.
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;
SET FOREIGN_KEY_CHECKS = 1;

How to safely delete eav_attribute table in mysql

I want to delete eav_attribute table from Magento database.
I am getting #1217 - Cannot delete or update a parent row: a foreign key constraint fails
How can i delete it safely?
You are walking on shallow ice here.
There is a high chance that this deleting the table will break your website. There are foreign keys to that table for example from catalog_eav_attribute and customer_eav_attribute. Also all the tables that hold attribute values are linked to eav_attribute.
Like catalog_product_entity_int for example.
If you want to add or update attributes from that table you should find an other way. Like using install scripts where you use '$this->addAttribute' or $this->updateAttribute.

Can truncate Magento catalog_product_entity_int table?

In magento db table catalog_product_entity_int too much large near about 500 MB and due to this performence is low.
How we can reduce the size or can this table truncate as like we can log tables?
you can not truncate catalog_product_entity_int table.
In Magento database, an entity can have several tables that share the same prefix.
For example, the product entity has the catalog_product_entity table for its main data and several other tables prefixed with “catalog_product_” such as catalog_product_entity_int, catalog_product_entity_media_gallery, catalog_product_entity_text and so on.
To store the data more efficiently, product details are stored separately depending on their data types.
When the value of the data is an integer type, it’s saved in the catalog_product_entity_int table, and when its type is an image, it’s saved in the catalog_product_entity_media_gallery table.
if you want truncate table for performance
then you can truncate below table i think you got lots of data in this table
log_customer
log_visitor
log_visitor_info
log_url_info
log_quote
report_viewed_product_index
report_compared_product_index
-catalog_compare_item
Let me know if you have any query

Resources