Hi you all.
Is there any place where ubercart registers how many units have been sold of every product?
|
Ubercart |
|
|
|
||
|
Mon, 11/12/2007 - 19:26
Hi you all. Is there any place where ubercart registers how many units have been sold of every product?
Re: Units sold of every product?
It is quite easy to do: have hook_order 'Update' && status == pendung and uc_balance($order)<=1 to ensure an order really is once stored. Then you you scan once again the products of the order and add each to by sql UPATE into the table uc_product_totals..
It is not done?
Hi oslinux and thanks for your answer. I don't have any uc_product_totals table on my database, what you answered me means that I should code that because it's not done? I mean, ubercart doesn't register anywhere how many units have been sold of every product to have a statistical control? I just ask that to be sure and doesn't repeat something which is already done
hey jorditr,
you'll be
hey jorditr, you'll be happy to know that a reports module does exactly this. Not only does it keep track of how many of each product has sold, it also keeps track of how much have customers have purchased, and how much revenue your store has produced. You can get it from the latest bazaar update or you can get the separate contrib module if you're using a live site.
Great module
Wow, I've installed it and it's really great I wanted to track some kind of sales results by product inside my customized Simple Stock Levels module, instead I've added the (customized) menus of the inventory managent to the Reports area on the Store Admin page. Please don't forget to keep your module updated Thanks a lot.
Easier way?
Hi oslinux for your answer. I installed the Shawn module and forgot to attend your proposal. I didn't understand it at first now I see you are saying to send that data to a new table still not created (uc_product_totals). Well, it's not a bad idea, but it's somewhat out of my scoop, since I just wanted to know if it was already registered somewhere to be able to read that data for a block of best sellers products I'm placing somewhere else. Uhmm, well, I'm trying to find another solution
Re: Easier way?
it is yet about 3 lines of php code like <?phpfor sql table makeup uc_product_total you need a field for the user_id, timestamp (when are 3 months over to delete it via cron), current_total. <?php
Re: Re: Easier way?
Hi oslinux and thanks for your proposal. Anyway, the only thing I dont't understand is that you insist on reading the table uc_product_totals which it's not present on my schema. Is it present on next release? By now I'm working with that code: $sql2 = 'SELECT nd.nid, nd.title,which reads all the products inside orders and get the total quantity of each one. I've been thinking on considering if the orders where each one is completed or not but I'm not succeding on an internal join on the select sum, but maybe it's not important for a block which pretends to show the most sold products, we could consider the products inside orders still not completed as valid for such analysis. |
|