Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Where is Cost price value held? 
 
Vicky P
Sr. Member
 
Total Posts:  93
Joined:  2008-02-27
Devon, UK
 

Can anyone tell me which database table the product Cost price value is held please?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

It does not work like that. EAV databases are not so easy. You had best stick to the methods used to get info in and out. What you tring to do?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vicky P
Sr. Member
 
Total Posts:  93
Joined:  2008-02-27
Devon, UK
 

I want to work out the total value of my stock.  All my products have a cost price, so I wanted to run a query (and maybe create a report if I can) to multiply the inventory value by the cost price for each product and then add those to come up with an overall total.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

Try:
http://www.magentocommerce.com/wiki/doc/webservices-api/api/catalog_product#catalog_product.list

Use catalog_product.list to retrieve all products

Then foreach loop through them

Call catalog_product.info on each, this will retrieve an array with a product type, you want just the ‘simple’ and not the ‘configurable’. The array will also have ‘cost’ in there and the quantity in stock. Multiply the two and add to total.

Print out this information to a csv file with quotes around your fields and column headers for sku, product, cost and rrp. You can then just open this in Excel.

Since the above method takes ages you may want to create the report with a cron job, so it is made overnight.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top