A bulk stock updater module for Ubercart

Sunday, 29 August 2010 - 6:44 pm - by ram

On a recent Drupal project I was asked to build an interface whereby administrators could easily bulk-edit the stock levels for all their Ubercart products. I had a look on the web for something which already did this. I found Multiple stock edit – which only really worked with Ubercart 1.x and Drupal 5 (not to mention that it used the standard Drupal form submission mechanism, thus making it difficult to quickly bulk-edit large numbers of items). Stock and Price updater only worked by importing CSV files. And Views Bulk Operations would only let you set the stock level to the same value across a range of products.

So I decided to build Bulk Stock Updater. It not only allows you to bulk-edit the stock levels for your entire product catalogue but uses AJAX for the editing process, thus allowing you to quickly change the values across multiple items without having to wait for page reloads. You can view your product catalogue one page at a time (the number of items per page being configurable via a variable) or you can view all the items on a single page. In the single-page view there is a Javascript-powered filter field which you can use to filter the list down to only show the items you want to edit.

I think there is scope for extending this module to allow bulk-editing of prices and perhaps other product attributes too. The AJAX-powered updating really does speed things up compared to normal form submissions.

Finally, I’m especially pleased as it’s my first published module on Drupal.org :)

Tags:   ,
  • Will

    Hi Ram! I stumbled across Ubercart Bulk Stock Updater last night, well done on your first published module! I was wondering if you'd consider adding the ability to edit the product sell price as well as stock? That's a feature my client is requesting and one which would be very valuable for a lot of users. I've had a look at the module but before I go hacking it I thought I'd ask :)

  • http://hiddentao.com/ Ram

    Hey Will, thanks for using it. Yeah, I've thought about adding price-editing before. Let me have a look at it and get back to you.

  • Will

    Excellent news, would be great if you can. Let me know either way :)

  • http://hiddentao.com/ Ram

    Hey Will, I've committed updates to the module which allow for editing the selling price as well as the stock threshold. These should be available via the development snapshot release (http://drupal.org/node/896762) within a day. Let me know if it works for you.

  • Will

    That was quick! I've downloaded the module but with any version I've tried I go to admin/store/stock and it doesn't list any products at all. Could it be conflicting with another module? Anything I can do to debug?

  • Will

    Sorted, I just hadn't enabled stock on any product. This could be a bit of an issue as my customer doesn't use stock control but I'll have a look at working around that. Would be good to make the module flexible enough to be a stock updater or price updater or both.

  • http://hiddentao.com/ Ram

    That's a fair point. I'll look into it.

  • Mullumc

    Hi Ram

    Thanks for the module. The issue I have is that I am importing thousands of products. I then need to bulk set them to active so that I can update the stock levels. Do you know how to do this or can you add it to your module. Thanks.

  • http://hiddentao.com/ Ram

    Hey Mullumc, if you wish to perform the same action in bulk mode on all the products there are probably other modules out there which already do this. I'm not sure but the Views Bulk Operations module (http://drupal.org/project/views_bulk_operations) may be of use.

  • http://www.pbsapos.com.au/inventorycontrol.aspx Inventory Control

    i suggest to get some more test the system, this is very critical as for my opinion.

  • Jon

    Thank-you so much for this module. It is one of the very few options that really works for updating attributes with sub-skus. It doesn't seem to handle the stocks well for attributes (at least in the first 5min I've played with it). Anyone else have problems with stocks on sub-skus

  • http://sepehr.ws/ Sepehr Lajevardi

    Thanks for your great contribution.

  • http://www.epsell.com/ Epsell Com

    i downloaded it does it work ok for you though?

  • http://hiddentao.com/ Ram

    Hey I actually haven’t used this module in a while so I’m not sure. Though I don’t see why it wouldn’t still work.

  • http://twitter.com/iapplecenter iapplecenter

    good

  • Myfr34150

    Hello Is this going to be ported to D7?thanks

  • http://hiddentao.com/ Ram

    Hi, I’m no longer actively working on this module and am looking for a new maintainer.