Magento reports empty rows - magento

When I'm generating a report of the most viewed products there are a lot of empty rows. So from some day's I cant get any data of the most viewed products. There is reasonable traffic on the site and I know for sure that every day products are viewed.
It is a Magento 1.6 webshops. Other reports are working correctly.
Does anyone know what the problem could be?

The issue is most likely coming from the DB which is used to generate this report.
Browse the table generating reports for Most Viewed Product and if you find “store_id” empty, edit and select the correct store_id for your store.
I run the following query to update all order items:
UPDATE table_name SET store_id=1 WHERE store_id =null;
This is assuming you only have 1 store and its store id = 1.
Also, take backup before running.

Related

Magento 2 different prices on page product and search results

For some reason I have for some,different prices on page product and search results.
The correct one is on the product page.
For example product page is 1.60 and search result page 1.20.
What I have done:
I have Magento 2.4.4
Change the product price in admin,I check the catalog_product_entity_decimal table to see the changes and it is update, then I see that I have to reindex the catalog_product_price index.
Once that is done the price is updated in the catalog_product_index_price table, but when I check the _replica one (catalog_product_index_price_replica) it is not updated.
This only happends to some products.Not sure what is happening
Because this is a search result page, I am using Amasty Elastic Search
I figured it out,it seems that in my case , when I updated a specific third party module, there was some sort of update on the table catalog_product_index_price_tmp.
I deleted the table and created it manually, bad mistake, this table is used for updating the catalog product index (not sure if others), it stores the information on that table and then copies its values to the _replica one, this table is always emptied when reindexing the price.
Solution was to delele the table
DROP TABLE `catalog_product_index_price_tmp`;
And then run the setup:upgrade , this table is created by magentos db_schema.xml in this file vendor/magento/module-catalog/etc/db_schema.xml
Hope this helps others

Magento 1.9 Missing products

I have imported 16990 products to my website via Import All products Profile
Its divided info 9 files
8 files contains 2000 products
and 1 file contains 990 products
All files imported successfully with no error messages
After checking the total number of records from catalog, about 1500 products are Missing
I have double check the CSVs files its correct with no issues
Could you please help me to explorer the issue?
Well, I have prepared a workaround for this problem. First of all, check if your missing products are showing in the database. If yes, try to do the following:
Sign in to Magento Admin Panel
Go to Catalog > Manage Products
Your current URL will look like this:
yourdomain.com/index.php/admin/catalog_product/index/key/[your_key]/
Change your URL to:
yourdomain.com/index.php/admin/catalog_product/edit/id/[product_id]/key/[your_key]/
You can find the product_id in the database. When you enter this URL, you will be able to edit the product. Now, check product attributes and make sure that you check all the values which are empty or not filled properly. In this way, you can clearly see all little mistakes by the Values in the CSV.

Products are not displaying in Frontend after import in Magento

I have imported products using System - Import/Export - Import option.
I can see my products in Admin panel, but not in Frontend.
I tried Re-indexing, cache clear, cache refresh, physical cache remove.
also checked product stock status, availability etc. Everything is ok.
But they are not displaying in frontend. I marked onething, If I open product that I imported using csv, just saved without any change, it starts displaying. But I have 100s of products. So I can't use this solution.
So please help me where I am going wrong in csv. below is my csv screenshot.
You need to ensure that the products are attached to a website.
This can be done via a bulk update:
Access the product listm select all
Alter attribute
Products information -> websites
It can also be done in the csv by using a "_product_websites" field and setting it to the website name or 'base'.
I forgot which CSV columns are mandatory but I do remember that if some are missing the importer does not tell you that but instead you get the behaviour that you are describing.
The simplest way to find out what is mandatory is to:
Fix bugs in Magento ImportExport module
Create a new product in admin
Check that the new product is visible on front-end
Export the new product with Magento ImportExport exporter
Delete created product
Import the previously exported product csv
Clear cache and reindex data
Check that product is visible on front-end (it should be)
Compare your CSV with the exported one and try to figure out what is missing from it
Try to import your CSV with added/fixed columns and add data untill the product is imported so that it is visible on front-end
This requires allot of trial and error...
The missing columns in my case had always the same value so if this will be the case with your problem as well you can simply extend CSV importer and hard code those values in there instead of fixing your CSV manually.
Since your product gets saved correctly if you open it in admin and save it you can also:
Import a product
Export that product
Open that product in admin and save it
Export newly saved product
Compare exported CSV-s where they differ
Fixing Magento ImportExport bugs:
First bug is that if you import multiple products the quantity informatino from the first product is used for all the products. To fix this you have to add $row = array(); right before $row['product_id'] = $this->_newSku[$rowData[self::COL_SKU]]['entity_id']; in Mage_ImportExport_Model_Import_Entity_Product::_saveStockItem() function.
The second bug causes Magento ImportExport module to return a foreign key constraint error when importing multiple products. Error happens because magento splits products data into multiple segments and if one product is located in two segments importer will delete data that was imported for the product in first segment before importing the second segment thereby causing database corruption (see this link for detailed explanation - this is where I got the solution below).
Note that removing foreign key constraint will not fix the problem but will instead make it worse since the database will contain corrupt data.
To fix it you have to change the code in Mage_ImportExport_Model_Import_Entity_Abstract::_saveValidatedBunches() function:
After if ($startNewBunch || !$source->valid()) { add
if ($startNewBunch && count($bunchRows) > 1) {
$arrKeys = array_keys($bunchRows);
$arrNew = array();
while(($tRow = array_pop($bunchRows))) {
$tKey = array_pop($arrKeys);
$arrNew[$tKey] = $tRow;
if ($tRow['sku']) {
break;
}
}
$nextRowBackup = array_reverse($arrNew, TRUE) + $nextRowBackup;
}
Hope this helps.
I had the same problem recently and I spent some time tring to figure it out...
Looks like magento needs a status flag for every product otherwise magento will not show it in the dashboard.
Solution : add a "status" column to your CSV file and set all the statuses to "Enabled"
(yes it's not a boolean. Just use the string inside the quotes as it is :)
I was stuck with the same problem, i then visited my var/export/export_all_products file, downloaded it again and uploaded the same back through import, logged out of my account and logged-in back, all products were back. This worked as a backup for me and i could see all the products back at the back-end.
Import as you have. If they are enabled, but not showing...
then you can fix this by clicking "select all" products in the "manage products" table and then "change status" and then select "enabled." This process might take a minute.
Visit your store and you should see your frontend with products.
Some kind of bug with the status/enabled setting.
You must have next fields in CSV
sku
_attribute_set
_type
_category
description
image
name
price
short_description
status
tax_class_id
thumbnail
visibility
weight
qty
_product_websites
is_in_stock
Please note that field is_in_stock is mandatory even if qty more then 1
In magento 2 we need to reindex in index management to display the products in frontend.
We can reindex through cmd.like the given example we need to enter magento file directory after that cmd php -f bin/magento indexer:reindex to reindex .
When I first started importing products via csv although I set the product to enabled, I figured out that even though it shows in the magento back end as enabled, it actually isnt - think its to do with setting the field contents as "1" or "0" rather than "enabled" or "disabled/null".
To get around this, after a import I simply selected all the products in the back end and change status to enabled - it fixes issue.
But, I do think if I simply changed the data in the csv import it would save me this minor in-convenience.

Where is Magento order data stored?

I am running Magento 1.6.2 and have an intermittent error cropping up with some sales orders. The customer is being charged correctly, but the Magento admin page when viewing the sale reports incorrect values. I understand why it is doing it incorrectly - I have a 10% discount off a full section of products on my website, and it is because of this that something is going wrong.
Again, the customer is paying the correct (discounted) amount, but the data must be being stored incorrectly in the magento database because looking at it in the admin system doesn't total the values correctly. The Catalog Price Rule that applies the 10% discount is not accounted for in the displayed totals.
To add to my woes, we use Zynk to bring data in from Magento to our Sage 200 backoffice system, and the data getting imported into that system is also missing the 10% discount, making reconciliation of order payments and Sage invoices a complete pain.
The only thing I can think is that somewhere somehow the data is being stored in the magento database incorrectly (not having had the 10% discount applied to it) so when Zynk collects the data, it is incorrect.
Can anyone help me understand where I can find the order data in the Magento database so I can see what was stored for a specific Magento order number - I can at least begin to debug this then, maybe?
If someone has details of where to find the code used by Magento to perform the order database transactions, specifically where the discounts should be applied before storing the data, that would be a big help too.
Cheers!
Orders data are saved in database tables sales_flat_order and sales_flat_order_item
Discounts are applied in Mage_SalesRule_Model_Validator
You can find orders and order items data in your (tables prefix)_sales_flat_order and (tables prefix)_sales_flat_order_item respectively. but remember that when an order is placed Magento simply copies the data from its respective quote. so in my opinion you should be checking (table prefix)_sales_flat_quote and (table prefix)_sales_flat_quote_item first.

Magento: Revert price data from index. False price data saved, but not indexed

i hope i am able to describe the problem correctly here, as it is quite complex. I guess you guys are my last chance.
We have ca. 120 config products based on 600 simple products. Some days ago, we accidently overwrote all the prices of the simple products with false prices. We did not notice as in the frontend every price is still ok, they are not indexed.
So we now have the correct prices in the frontend, but the wrong prices for the simple products in the backend.
Is there any method the get the prices from the indexed frontend and write them back in the backend?
Until i reindex all proces should be ok in the frontend.
Does anyone have any idea what i could do to get the prices right again?
If you browse the database, there should be a catalog_product_flat_1 table - this is basically your product index. You should have columns for all the product attributes (including SKU and Price) so you could export this table, then do a product export from Magento, then update all the prices/SKUs accordingly and re-import. Or duplicate the flat_1 table, then write a PHP script to loop through it, updating all the prices, then re-index your data (after checking it's worked of course!)

Resources