I'm facing a strange issue or may be i'm not clear about how magento saves values in to DB.
I have created a custom attribute for the product namely "seller_id" its properties are as follows.
Please read my Edit.
And i'm using a custom code to save product to the DB. Where i use
The code seems to be working properly. After running the code when i check the product details from adminpanel, i can see that value is set for seller_id.
The problem is when i try to access this attribute from the product listing page it is not returning the saved value. So i went to Attribute configuration section and set "Used in Product Listing Page" to "Yes". You can see this in the second image. But still its not returning the saved value.
As per my understanding since seller_id's input type is "TextField", the value should be saved in "catalog_product_entity_varchar". Querying the "eav_attribute" table reveled that seller_id's attribute_id is 136. So i executed following sql in the Db.
SELECT * FROM `catalog_product_entity_varchar` WHERE attribute_id=136
To my surprise it returned an empty result set. So i went back to the adminpanel opened a product details page (Catalog->Manage Products) clicked "Edit" and Clicked "Save" button for a product (Please note that i can see value for seller_id in Adminpanel for a product).
After saving the details for product i tried executing the above query once again and now its returning a row for product which i have just saved. And also now i'm able to get the value for seller_id in the product listing page.
So question is why values is not getting saved in "catalog_product_entity_varchar" table even if i'm doing $product->save();. How the value is showing in adminpanel even though its not getting saved table?
EDIT : This particular attribute "seller_id" was created long time ago. While the attribute created the option "Used in Product Listing" was set to "No". But now i need to access it in the Product Listing page. So i set this option to Yes and did Reindexing. But still seller_id is not accessible in the product listing page.