Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Sep 2011
    Posts
    135
    Plugin Contributions
    0

    Default Re: Show number of units sold next to product names in categories

    See post number 7 above, that fixed the problem you are having for me.

    Now I want to be able to sort the listings by clicking the number sold and see the best sellers at the top... And a few other tricks like multiply number sold by the price to see total revenue etc.

  2. #12
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Show number of units sold next to product names in categories

    Quote Originally Posted by Chargin View Post
    See post number 7 above, that fixed the problem you are having for me.....
    My apologies, I overlooked that last

    Code:
     
                        echo $total_products_on . TEXT_PRODUCTS_STATUS_ON_OF . $total_products . TEXT_PRODUCTS_STATUS_ACTIVE; 
                      } 
                      ?> 
                         
                    </td> 
                    <td class="dataTableContent" align="center">&nbsp;</td> 
                    <td class="dataTableContent" width="50" align="left">
    Perfect - thanks

  3. #13
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: Show number of units sold next to product names in categories

    My server is currently on PHP 5.2.17, I know it needs to be upgraded and it will once I have gotten my site to 1.5.4.

    The other requests can be done, it would be possible to add a sorting function which I believe would be quite useful. I think there is a profit margin and markup module that will do what you are looking for regarding total revenue plus sales report does that too and gives you better granular control of reporting parameters.

    Zen Cart and it's community are the best!!

  4. #14
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Show number of units sold next to product names in categories

    Quote Originally Posted by Chargin View Post
    Now I want to be able to sort the listings by clicking the number sold and see the best sellers at the top...
    This will require a whole new approach to the problem because the number sold data is never all in memory at any given time using the current approach.

    Quote Originally Posted by Chargin View Post
    And a few other tricks like multiply number sold by the price to see total revenue etc.
    This will be a trivial addition because all the needed data is available in the while (!$products->EOF) {} loop, so it is just a matter of performing the calculations and adding the new data field to display the result.

    Cheers
    RodG

  5. #15
    Join Date
    Sep 2011
    Posts
    135
    Plugin Contributions
    0

    Default Re: Show number of units sold next to product names in categories

    A bit off topic but I have another similar idea...

    Id like to do the same thing we did above but to show the cost price of the product.
    Ive added the Products Cost Display mod to my site. Its meant for 1.5 but it seems to work ok with 1.39h.
    Basically it allows you to add a product cost field, but it only shows up on the product page in admin.
    Heres the mod http://www.zen-cart.com/downloads.php?do=file&id=1444

    The sql part shows this:

    ALTER TABLE `products` ADD `products_cost` DECIMAL( 15, 4 ) DEFAULT '0.0000' NOT NULL AFTER `products_price` ;

    So how do we show products_cost in a column the same as we did above for total_sold.

    I tried getting my head around how the code would work but my php is just too limited.

  6. #16
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: Show number of units sold next to product names in categories

    You could try copying Rod's 3 steps and make the little adjustments I added if needed. For step 2 you could try this
    PHP Code:
    $products_query_cost $db->Execute("SELECT products_cost AS unit_cost, products_id FROM  ".TABLE_PRODUCTS." WHERE products_id = ".$products->fields['products_id']."") ; 
    Then in step 3 it would change to
    PHP Code:
    <td class="dataTableContent" align="right"><?php echo $products_query_cost->fields['unit_cost']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    I haven't tried it, this is just a stab.

    Zen Cart and it's community are the best!!

  7. #17
    Join Date
    Sep 2011
    Posts
    135
    Plugin Contributions
    0

    Default Re: Show number of units sold next to product names in categories

    Thanks, Ill try this today and report back.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. To show "In stock" but not number of units?
    By Marre in forum Basic Configuration
    Replies: 6
    Last Post: 2 May 2011, 11:03 PM
  2. Product Names Module that replaces Product_id Number?
    By boukmn in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 3 Sep 2008, 12:38 AM
  3. Model Number and # of Units of Product info
    By bjraines in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 30 Jul 2007, 04:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR