How do magento convert EAV data to Flat data? - magento

Can anyone please explain me this?
Which classes and methods are related to updating the EAV attribute values in the flat catalog tables?
What factors allow for attributes to be added to flat catalog tables?
Yes I did the homework, searched on net and checked the Magento source code but unable to come with any satisfactory answer.
Thanks!

Related

How to change in the Magento DB the prices of the product

I've troubles to figure out how to change the prices of a product in the magento DB.
I tryed to change the prices in the catalog_product_index_price table but the price doesn't change.
There is a website here that explains it in more detail, but the short answer is that you need to change the price in the catalog_product_entity_decimal table and then reindex Product Prices in the backend (and potentially Product Flat Data as well)
Magento uses variety of indexing and caching methods that make simply changing the value directly in the database not a good idea.
If you look, you can see the prices are also defined in the Price Index tables:
catalog_product_index_price_idx
And also the flat tables (if you use them):
catalog_product_flat_1 (number 1 depends on store)
If you're trying to mass update prices, I recommend either using a tool such as Magmi or the built in Magento import methods to update prices. Directly modifying the database is generally not a good idea with Magento, given it's complex database structure.

Category coming at inappropriate place

I worked on this and it is live now. Please have a look at it. The problem is that the category named "Carbide rod" is not assigned to that "PCD inserts" category. But still showing. I don't know whats the problem in it. Please help me on it.
You probably have enabled flat tables to be used on front, which is generally a good idea. The thing to remember, though, is to perform a Category Flat Data re-index in Admin Panel. Go to System > Index Management and do a reindex of Category Flat Data.
Next you should Flush Cache Storage at System > Cache Management.
If that won't help, then check how your category tree looks on a Store View level. Magento allows to have different category trees for each store view.
Carbide rods category is not displayed under PCD inserts, whats your question exactly I'm not getting it.

Magento coupon entities in database

I'm trying to develop a Magento plugin which involves using coupons. Apparently after looking around I found a source that mentions use of a 'salesrule' table for coupons. However when I looked at my database i couldn't find it. However I did find 3 tables that had mention 'coupon' called 'coupon_aggregated', 'coupon_aggregated_order', and 'coupon_aggregated_updated'.
I just wanted to know what is the difference between the 3 tables so I can start using them? I am on the latest version of Magento.
The table you're looking for is indeed named
salesrule
There's also a table named salesrule_coupon, which contains specific coupon codes linked back to the main salesrule definition.
If your database is missing this table, something bad has happened to your system. Go to
Promotions -> Shopping Cart Price Rules
and create a new coupon code with a distinct title. Then dump your database content and search for the text of your distinct title. That will let you know which table your system is storing salesrules in.
The tables you mentioned above are aggregate data tables used for reporting only.

Can I Make A Product Collection Use Flat Tables in Magento

In my Magento store I currently have Flat Catalog Product turned Off because it breaks some custom code I have on my site.
However, I am have a single instance where it would greatly help me to have the collection use the flat table as opposed to the EAV tables.
Is there a way I can tell the product collection to use the flat tables as opposed to the EAV tables in my code?
This is a great opportunity to fix your custom code :) In the default system, flat catalog is either turned on or off, not with any level of granularity. Depending on the nature of the hack that breaks the flat catalog, it may be possible to avoid that issue and just it turned on globally.
Perhaps more detail into the issue that caused you to leave it turned off?

Insert categories into Magento Database directly

I have a bidding(phpprobid) site with categories and product. I've extracted the categories from the database table and put it in a csv file. I was wondering if I can insert those values (categories) into Magento's Database so that I don't have to create each categories one by one.
Is it possible to do so? If yes in which table do I have to insert and what other attributes I need to maintain ?
Thank you
chipShot's comment is the right direction. While you can insert them directly at the DB level, that tends to avoid important tables in Magento's EAV layout. You're better off writing an import using the framework or downloading someone else's module to the same effect.
Hope that helps!
Thanks,
Joe

Resources