Magento automatically adds random product to cart, super weird issue - magento

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;

Related

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

Changing the number precision in Oracle [duplicate]

This question already has answers here:
Changing precision of numeric column in Oracle
(3 answers)
Closed 9 years ago.
I haven't seen this exact issue... I apologize if I missed it.
I have a database I inherited from the company that created it when they lost the contract to my company. Now, the customer has an "urgent" issue to change the precision of a value. They want to change a number from 10.3 to 10.8; the field is defined in the database as 10,3. In my research of the issue, It seems I have to do quite a bit of manipulation to do this since the table needs to be empty to change the precision. I am assuming that even though the default is 10.38 (or whatever it is), since they defined it as 10,3 upon creation, if I just increase the field in the ColdFusion code, when it saves, it will truncate to 10,3? The change would involve me capturing the current data, deleting the data, changing the precision, then reloading the data, ensuring the existing data has been changed as well. Yes, I know that's not in detail, but hopefully gets the point across. Thank you.
Do you really want to change from a NUMBER(10,3) to a NUMBER(10,8)? That would significantly restrict the range of numbers that could be stored in the field - which is precisely why you can't do it when there is data in the column.
Or do you mean that you want to increase the number of decimal places from 3 to 8, while still allowing the same overall range of values? If so, then I think you want to change NUMBER(10,3) to NUMBER(15,8) - and you should be able to do that using a simple ALTER even if the column contains data.
The easiest way to handle this is to rename the column, copy the data over, then drop the original column:
alter table EVAPP_FEES rename column AMOUNT to AMOUNT_OLD;
alter table EVAPP_FEES add AMOUNT NUMBER(14,2);
update EVAPP_FEES set AMOUNT = AMOUNT_OLD;
alter table EVAPP_FEES drop column AMOUNT_OLD;
OR
alter table EVAPP_FEES add AMOUNT_TEMP NUMBER(14,2);
update EVAPP_FEES set AMOUNT_TEMP = AMOUNT;
update EVAPP_FEES set AMOUNT = null;
alter table EVAPP_FEES modify AMOUNT NUMBER(14,2);
update EVAPP_FEES set AMOUNT = AMOUNT_TEMP;
alter table EVAPP_FEES drop column AMOUNT_TEMP;

Magento: why does upgrade from 1.5 to 1.6RC1 CE take so long?

I was able to upgrade Magento from 1.4 to 1.5 in very little time, i.e. seconds. Going from 1.5 to 1.6 RC1 seems to be taking a very long time, as in hours (lost track of time, but heading for two hours and counting).
I cleared out log tables and dataflow import/export tables to leave ~10K SKUs and a few thousand customer records. The data is also on a new import, so it should not have corrupted tables or anything else abnormal. According to 'top' mysqld is going flat out, albeit on 34% wait.
Is ~2+ hours to be expected for upgrading latest Magento CE?
P.S. I know this is not really a programming question and more of an installation problem, however, I would like to know a little bit more about what it is doing to take so long.
EDIT: After many hours and many tables added, this install baled.
Any tips on how to get 1.6 working on an existing dataset will be most appreciated.
I just upgraded from 1.5 to 1.6.2 after about 10 failed attempts. I've learned a ton about the process, so hopefully someone will find this useful.
Upgrades to 1.6 are going to take ages to run. There seems to be a big difference in the database structure between versions, so there are about 6 or 8 hours of SQL commands to run. Mainly ALTER TABLE commands which can take over a hour to run (each) if the tables are full of records. To reduce the amount of time this take, run this command (make sure to change the 'sb_' table prefix to your own one)
DELETE FROM sb_sales_flat_quote WHERE updated_at < DATE_SUB(Now(),INTERVAL 7 DAY)
It will delete all shopping carts except for the last week. Will reduce to approx. 10,000 records from over 250,000 in my case. As far as I can tell, this won't affect customers.
Also, empty these tables (make sure to change the 'sb_' table prefix to your own one):
TRUNCATE `sb_log_customer`;
ALTER TABLE `sb_log_customer` AUTO_INCREMENT=1;
TRUNCATE `sb_log_quote`;
ALTER TABLE `sb_log_quote` AUTO_INCREMENT=1;
TRUNCATE `sb_log_summary`;
ALTER TABLE `sb_log_summary` AUTO_INCREMENT=1;
TRUNCATE `sb_log_summary_type`;
ALTER TABLE `sb_log_summary_type` AUTO_INCREMENT=1;
TRUNCATE `sb_log_url`;
ALTER TABLE `sb_log_url` AUTO_INCREMENT=1;
TRUNCATE `sb_log_url_info`;
ALTER TABLE `sb_log_url_info` AUTO_INCREMENT=1;
TRUNCATE `sb_log_visitor`;
ALTER TABLE `sb_log_visitor` AUTO_INCREMENT=1;
TRUNCATE `sb_log_visitor_info`;
ALTER TABLE `sb_log_visitor_info` AUTO_INCREMENT=1;
TRUNCATE `sb_report_viewed_product_index`;
ALTER TABLE `sb_report_viewed_product_index` AUTO_INCREMENT=1;
TRUNCATE `sb_report_compared_product_index`;
ALTER TABLE `sb_report_compared_product_index` AUTO_INCREMENT=1;
TRUNCATE `sb_report_event`;
ALTER TABLE `sb_report_event` AUTO_INCREMENT=1;
TRUNCATE `sb_catalog_compare_item`;
ALTER TABLE `sb_catalog_compare_item` AUTO_INCREMENT=1;
Before you start the upgrade, make sure to disable the cache! This will save headaches. Also, either uninstall/disable any extensions, or upgrade them. This includes ones manually installed, not just the ones in Magento connect.
If you want to know what SQL commands are being issues by the upgrade enable Magento debugging, by editing /lib/Varien/Db/Adapter/Pdo/Mysql.php. Change the following lines to true:
protected $_debug = true;
protected $_debuglogeverything = true;
You'll then find all commands in /var/debug/pdo_mysql.log (you can watch them on-the-fly by SSHing into your server, going to /var/debug/ and typing
tail -f *
The way I upgrade is by FTPing in and copying the newest version of Magento over the current installation. This works for me. I use CPanel's File Manager to extract the magento-1.x.x.x.tar.gz file. (BTW: TAR.GZ is better than ZIP file because it includes file permission information)
Also, add this to your .htaccess file to block everyone except your own IP (change IP to you own). You also need to create a maintenance.html file. This will stop visitors kicking off the upgrade process too early. Rename /cron.php for the same reason.
## Exception Below is your IP
RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444
RewriteCond %{REQUEST_URI} !/maintenance\.html$
RewriteRule .* /maintenance.html [R=302,L]
After the 1.6.2.0 upgrade was finished, I rebuilt Indexes. Upgrading to 1.7.0.2 from that point took about 30 seconds.

Slow query execution in an empty table. (after deleting a large amount of inserts)

I have a table in an oracle database with 15 fields.
This table had 3500000 inserts. I deleted them all.
delete
from table
After that, whenever I execute a select statement
I get a very slow response (7 sec) even though the table is empty.
I get a normal response only in the case that I search
according to an indexed field.
Why?
As Gritem says, you need to understand high water marks etc
If you do not want to truncate the table now (because fresh data has been inserted), use alter table xyz shrink space documented here for 10g
Tom Kyte has a good explanation of this issue:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:492636200346818072
It should help you understand deletes, truncates, and high watermarks etc.
In sql when you want to completely clear out a table, you should use truncate instead of delete. Let's say you have your table with 3.5 million rows in it and there is an index (unique identifier) on a column of bigint that increments for each row. Truncating the table will completely clear out the table and reset the index to 0. Delete will not clear the index and will continue at 3,500,001 when the next record is inserted. Truncate is also much faster than delete. Read the articles below to understand the differences.
Read this article Read this article that explains the difference between truncate and delete. There are times to use each one. Here is another article from an Oracle point of view.

How to delete / clear all product reviews in 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.

Resources