We are creating an event registration system with limited availability of seats. Hence the use of the Commerce Stock module.

We need to be able to waitlist (backorder) people when the event is sold out in case of cancellations or when we can arrange for additional space.

The features we need are:
- ability to place people on a waiting list (backorder a product)
- ability to add new stock and give priority to those on the waiting list (backordered customers)
- ability to place seats back to inventory upon cancellation; and subsequently give the seat to the backordered customer
- ability to let the customer chose whether or not to go on the waiting list (backorder)
- ability to process a hold payment for backordered customers and fully process the payment upon filling the order

There are probably many more features that would be helpful but these are the ones we need to implement for now.

Is there anything realtyed to Drupal Commerce that has similar functionality. Or, is this something that should be added to Commerce Stock?

Comments

guy_schneerson’s picture

@esper_ottawa As far as I am aware there is nothing out of the box that would meet your requirements, however I am hoping to release version 2 of the stock module in the next week and this will provide a framework that can be used (alongside other modules) to develop your required functionality.
Important to note that version 2 will need some testing (as its new) and someone with technical abilities to develop you custom implementation.
I can also provide custom development and if you are interested you can contact me through drupal.org my contact form or through www.blue-bag.com.

george esper’s picture

Thanks for your prompt reply, guy_schneerson. I eagerly await your next release. We'll definitely upgrade and test drive the new version.

And thanks also for your offer. We'll take you up on that if we find we need help.

iwant2fly’s picture

Ubercart, but I need something similar. Just posting this here for cross reference to anyone else looking for the same thing. http://drupal.org/node/1613268

audster’s picture

Sometimes, you need to be able to sell stuff you don't have in stock but still need to track stock and backorders. (for example, items that are built-to-order and so are, by definition, not in stock)

This would really help us too as we have products custom manufactured as they are ordered so we would like to be able to have backorders WITHOUT billing the back-ordered item and when the item is shipped to the customer (releasing the backorder) have the billing processed for that item.

This also raises a question of shipping charges... should the customer have to pay shipping fir the backorder or not? (in our industry, photography equipment and repairs) it is common to bill all of the shipping at order, but for the other side of our business (parts) it is common to charge shipping only when items are actually shipped - so charging again when back-ordered parts are released)

So it would be very very very nice (and pretty darn slick too) if there was a means to setup charge/not charge shipping on released backorders already built in to this as well.

guy_schneerson’s picture

I am planning to look into developing custom stock actions for handling cases like back order however those will likely to be vary basic i.e. add user email to inform him when stock is back in.

In order to have physical back orders we would need something like Alternative line item basket and this is not likely to be part of stock but a separate project.

guy_schneerson’s picture

thanks @brunorios1 for pointing out the ubercart Stock Notification module
see http://drupal.org/project/uc_stock_notify

brunorios1’s picture

do you know this "commerce waitlist" sandbox project: http://drupal.org/sandbox/itamar/1772176 ???
i'll test it now.

guy_schneerson’s picture

@brunorios1, thanks looks interesting will play around with it when I get more time.

rar’s picture

Did you get a chance to test it out? Any progress?

guy_schneerson’s picture

hi @rar
Had a look but didn't get a chance to properly test. I created an issue with my comments http://drupal.org/node/1837774

I like the approach but needs more time evaluating and possibly working on but may prove a workable sandbox solution for people

astutonet’s picture

Any news about this feature? I'm also interested.

jmasiello’s picture

I am just chiming in on my interest on backorder functionality. Thank you for all the work you have done already!

giuvax’s picture

subscribe

or maybe I have to create a rule by myself

danharper’s picture

Has anybody considered using rules and flag to achieve this?

http://drupal.org/project/flag

Dan

giuvax’s picture

I solved this just the way you say. I created a flag then I added some rules to deal with flag behaviors.

giuvax’s picture

I wrote a topic to explain this in italian. Maybe if I have some time today I'm going to translate and put it here.
http://www.drupalitalia.org/node/19763

giuvax’s picture

Finally I wrote myself this couple of rules, just using Flag, Mime Mail e Commerce Stock.

  1. I created a flag named in_stock_notify. A Commerce Products flag.
    I defined Flag messages, product types I want the flag to be shown on, and disabled 'Display link on entity' option, since I wanted to set myself where to display the flag link.
  2. I edited the defaul Commerce Stock rule, the one that disables the Add to cart botton, so that I can display the flag instead of it..
    I didn't delete the 'Set the state of the Add to cart form' action, who knows, maybe can help in the future, but I added another action to it:

    Advanced configuration of the add to cart form
    - I selected 'Hide the Quantity field if it is visible '
    - I set 'The text to set the action to' writing the text I wanted to show, i.e. 'Notify me when it's back in stock' (actually it's useless, since I'm going to show flag javascript, but it's mandatory)
    - I set the 'Add a class to the add to cart form' class on 'out-of-stock'
    - I set 'Stock action' to 'Custom HTML' and disabled Add to cart, so that, below:
    - Where it says 'Custom HTML', I put this code lines that I found on this page:

    <?php
    print flag_create_link('in_stock_notify', $commerce_product->product_id);
    ?>

    i.e. I'm printing my flag, since in_stock_notify is my flag's name.

  3. I created a rule to send an email to all users subscribed to this product.
    My rule can be connected to the only event after which a product stock could be modified, i.e. an existing product editing. But 'after updating an existing product' doesn't work as well, since I need to compare two values, before and after saving. So:

    Event
    Before saving commerce product

    Condition
    - product has stock enabled
    - product has not stock disabled by an override
    - data comparison: commerce-product-unchanged:commerce-stock = 0 (= before saving it, product stock was 0)
    - data comparison: commerce-product:commerce-stock is greater than 0 (= after saving it, product stock is greater than 0)

    Action
    - fetch entity by id ('Node', commerce-product-unchanged:field-product-node:0:nid, Fetched variable label 'Loaded node' and Variable value 'loaded-node'). This is useful to let you have NODE and not just PRODUCTS token, when you will have to write the email.
    - fetch users who have flagged a commerce_product (this action tells it itself, I'm loading users list and I have to give them a Label and a Value so tha I can have them in available tokens when I have to create a loop to send to all subscribed user my email.
    - loop of users, inside which I put the action -->
    - send html mail (or other, depending on the module you use to send emails) where you can use the tokens you need. I needed Node because I want to send the exact node url (=product display) related to the flagged product. I inserted something like '[site:url]/node/[loaded-node:nid].

    (I tried attaching the rule but I get a 'file too large' error)

guy_schneerson’s picture

I think the "commerce waitlist" sandbox project: http://drupal.org/sandbox/itamar/1772176 also uses flags.
I really like @giuvax approach in #17 would be nice to get the rules export

giuvax’s picture

I'm pasting the rule since I can't upload it as attachment.

{ "rules_in_stock_notify" : {
    "LABEL" : "In stock notify",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "commerce_ss", "rules", "flag", "mimemail", "entity" ],
    "ON" : [ "commerce_product_presave" ],
    "IF" : [
      { "commerce_ss_stock_enabled_on_product" : { "commerce_product" : [ "commerce_product" ] } },
      { "commerce_ss_stock_not_disabled" : { "commerce_product" : [ "commerce_product" ] } },
      { "data_is" : {
          "data" : [ "commerce-product-unchanged:commerce-stock" ],
          "value" : "0"
        }
      },
      { "data_is" : {
          "data" : [ "commerce-product:commerce-stock" ],
          "op" : "\u003E",
          "value" : "0"
        }
      }
    ],
    "DO" : [
      { "entity_fetch" : {
          "USING" : {
            "type" : "node",
            "id" : [ "commerce-product-unchanged:field-product-node:0:nid" ]
          },
          "PROVIDE" : { "entity_fetched" : { "nodo" : "Loaded node" } }
        }
      },
      { "flag_fetch_users_commerce_product" : {
          "USING" : {
            "flag" : "in_stock_notify",
            "commerce_product" : [ "commerce_product" ]
          },
          "PROVIDE" : { "users" : { "users" : "Users that flagged a product" } }
        }
      },
      { "LOOP" : {
          "USING" : { "list" : [ "users" ] },
          "ITEM" : { "flag_user" : "User to send email notify" },
          "DO" : [
            { "mimemail" : {
                "to" : "[flag_user:mail]",
                "from_name" : "[site:name]",
                "from_mail" : "XXXXX@XXXXXX.XXX",
                "subject" : "YYYYYYYYYYYYYYYYYYYYYYYYYY [commerce-product:title]",
                "body" : "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
                "plaintext" : "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
              }
            }
          ]
        }
      }
    ]
  }
}
spacerex’s picture

I am building a store for a clothing manufacturer to sell retail and wholesale online. When they sell wholesale, they do it on a backorder-like basis, collecting orders for a given number of dress or coat and then manufacturing the items and filling the orders. It would be neat, from a stock management standpoint, if the in-stock items (they use the term "Open To Buy") and the new designs (pre-order) could coexist side-by side. If someone put 3 in-stock items and one pre-order item in their cart they would get a message regarding the pre-order item "you have added [product_preorder_x] to your cart, which will is available on a pre-order basis only and will ship [delivery_date].

What I'd like is a ruleset/module configuration that allows backordering items that can be flagged as "pre-order" by term references (delivery date) -- as distinct from "out of stock" items, which should be treated in the standard way (out-of the box commerce 2 -- disable add to cart). To be clear, once they manufacture something and it's used up (out-of-stock) it should no longer be available for pre-order (due to limited supply of fabric etc.) It's something like the built-to-order scenario described by audster in #4 comment on the previously mentioned thread.

In a nutshell, we want to be able to sell in-stock items that will sell out traditionally, and simultaneously collect, possibly as a negative stock number, orders for things to produce. I suspect that this is something that I'm going to have to pay someone else to create, as I'm still a newby.

brunorios1’s picture

I'm trying to do the step by step in #17 but i can't bring the product display node to the scope so i can use it's values as tokens in the e-mail.

i can't do this step below because i don't have a field "field-product-node" in my commerce product entity:

- fetch entity by id ('Node', commerce-product-unchanged:field-product-node:0:nid, Fetched variable label 'Loaded node' and Variable value 'loaded-node'). This is useful to let you have NODE and not just PRODUCTS token, when you will have to write the email.

how can i bring the product node to the scope of the rule?

Thanks!

giuvax’s picture

Brunorios1, don't you have a node type related to a product type by a reference entity field?

jenlampton’s picture

I'm also doing something similar using flags.

I hadn't found the comerce_waitlist sandbox (https://drupal.org/sandbox/itamar/1772176) for whatever reason, so just built the flag and views myself, and then used a theme-override for the "add to cart" button to show the flag link instead when products were out of stock. Also added the flag link manually into the product-display node template.

Worked like a charm.

kopeboy’s picture

Issue summary: View changes

How to do this for a specific attribute? Or you don't have attributes in Commerce? (I'm using Drupal)

promount’s picture

I tried #17 and it works great but anybody could help on how to do it without using the PHP filter?

hansrossel’s picture