Woocommerce lottery – same stock

by user2868900   Last Updated September 11, 2019 12:08 PM

I am trying to create a woocommerce-site which is going to be a simple lottery with 1000 tickets. Each month there is one item being drawn, and there are four different products:

1 Ticket

5 Tickets

10 tickets

20 tickets

These need to be separate products since they have different prices,but I want to link them to the same stock inventory.

I have got this WooCommerce Lottery plugin, but it is built so that every single product is its own lottery, and there's no way to link all products to the same lottery.

I have realized I might need to code something on my own for this, but I have some concerns I really would need help with:

  1. Would the hook woocommerce_reduce_order_stock be sufficient to use to link products into the same lottery?

  2. Once the lottery is finished, I want to gather all 1000 entries and randomize a winner. When reopening the lottery I would like to reset the order count for said product, in order to separate the orders from the past lottery with the new lottery. How would the best way to go about this be?

I would be happy for any input in order to get started. Thanks.



Related Questions



Offer or Purchasing page - WooCommerce

Updated July 10, 2018 09:08 AM

WooCommerce Stripe Extension Checkout Error

Updated June 24, 2017 07:08 AM

Class doesn't save values (instance doesn't persist?)

Updated November 18, 2017 16:08 PM