i need found in magento database information about users: description , status (login or not).
Where i can find this information in data base?
Thanks
Magento uses an EAV structure so finding information can be tricky.
There is a slightly out-of-date but useful overview diagram here:
http://inchoo.net/wp-content/uploads/2008/10/magento_v116-database_diagram.pdf
To answer part of your question, I don't think Magento stores the login status in the database, that would be stored in the session. Other details like description/username will be in one of the entity value tables.
Here's a good tutorial I found about EAV in Magento:
http://fishpig.co.uk/2010/06/07/magento-database-structure-eav/
You can also see a diagram of the Magento database by Googling Magento Database.
Related
I am adding regions of a country to the database in Magento so when a user selects their country a relevant list of regions will be available in a drop down menu. To do this I believe I need to add information to directory_country_region and directory_country_region_name.
The tutorial I've been looking at states that I should add them directly to the database using sql, however I remember reading that you should not place information directly into the database using raw sql when working with Magento.
My questions are:
1- to keep in line with best practices do I need to use some magento functions to add the required information to my database or can they be dropped in using raw sql?
2- if I need to use some Magento functions how do I work out which I need to use (I have heard off and noticed the lack of documentation) or is there some online reference, even if it is limited?
3- if I am not to use a sql query why is it considered bad practice to do so in Magento?
Hello, if you want to add the information just once, you can use raw sql (faster and no drawbacks), also you are right about the 2 tables (if the country is already in directory_country). If you want to make something that will be available for more Magento instalations you have to crate a new Magento module and add the sql using the installer you can read more here http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-6-magento-setup-resources
Magento wiki is a good place to start, also there are lots of blog posts.
It's considered a bad practice because Magento has its own ORM and most of the time for your new tables (entities) you only need to create models that extend magento core models and you will have access to CRUD without any development and everyone that uses your new module will understaind what's going on.
Example for a region you can use the class Mage_Directory_Model_Region or for a collection of regions Mage_Directory_Model_Resource_Region_Collection
I need to add something similar to the Review system already available on Magento. I mean, I want to add a couple of texts, reviewing capacities and alike. It should have an administration side on the backend to be able to reject/accept/edit those texts. I still do not have all the things clear so I want to ask before I embark into a wrong/closed path.
Should I reuse the existing code by copying core files into local and modifying at will?
Or should I add my own tables and link to EAV model using product ID?
On this SO question the accepted answer posts a code on how to add a new custom attribute to all products. I could use this but I would still need to add the reviews part.
I've searched for a similar functionality but can not find anything.
I've installed the sample data from the magento site. Then also
installed magento with each mysql table configured to be named
with the magento_ prefix so as to tell the magento system tables
apart from the data tables. But I have the following problem (yes,
I installed the data first, and then magento, so that's not the issue):
The main content area when I http to localhost/magento/index.php
is blank. I don't see any data. I was expecting to see the
Magento sample store with sample category pages etc...
What have I done wrong?
Been having the same problem, it seems that you cannot use a table prefix in your installation if you want the sample data to show up.
I had created a simple model and mapped this model to a custom table, i need to filter and fetch values from this table.
is there any online documentation available to perform sql like,in,join in a simple model in magento? If so please let me know..
Thank you very much..!
Check maestro of magento Alan Storm's website.
Alan Storm - Magento Articles
I found this link.
In this link there are samples for using like,in,eq etc., along with simple model as like addFieldToFilter('sku',array('eq'=>'n2610')), the actual solution will be at near to bottom of the page.
Also the Alan Strom - Magento articles link by Oğuz ÇELİKDEMİR is useful.
I followed the tutorial at http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/installing_custom_attributes_with_your_module step by step to make my module install a couple of custom attributes, using Magento CE 1.4. I get to see the custom attributes on the product edit page, but whenever I try to save them I get an SQL error complaining that column "myattrid" does not exist. I know that:
this column is part of the flat product tables and indeed, it is not there
a lot of people give the advice to create by hand, but this bypasses the point of automatic installation
Is the tutorial I followed outdated? If so, what extra steps do I need to take?
An alternative approach is outlined in this blog post. You could try that.
I agree that you should avoid creating the attributes manually, there are many keys, indexes and relationships that Magento needs to be aware of which might be bypassed if you go straight to the database.
HTH,
JD