Mystery Gift Box for WooCommerce

Mystery Gift Box for WooCommerce allows you to sell loot boxes (like in video games) that contain high-value prizes in your WooCommerce shop.

Installation

↑ Back to top

1. Download the mystery-gift-box-for-woocommerce.zip file from your WooCommerce account.

2. Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.

3. Install Now and Activate the extension.

More information at: Install and Activate Plugins/Extensions.

Creating a Mystery Gift Box Product

↑ Back to top

Go to Products > Add New and set the Product Type as “Mystery Gift Box”. Configure the product details as per your requirement (Price, Inventory, Shipping, etc.), then go to the “Mystery Gift Box” section.

Product Selection Method: Select the algorithm used for picking the gift item(s) given to the customer:

  • Completely Random – The gift item(s) are picked randomly.
  • Current Stock – The gift item with the highest current stock is given first. Gift items with “Unlimited” stock are picked first.
  • Priority – Set a priority for each gift item. The item with the highest priority is given first until its stock reaches 0, then the next one. The lower the number, the higher the priority (for example, priority “1” is picked first).
  • Probability – Set a probability (%) for each gift item. Items are picked based on their probability, so you can make premium items rare and low-cost items common. The total probability must be equal to 100.

Note: In all the methods, if more than one gift item is given per purchase, the same gift item will not be given more than once (unless the number of items to be given is more than the number of available gift items).

Number of Item(s) to be Rewarded for Purchasing Per Mystery Gift Box: Set how many gift items the customer receives for each mystery box purchased. If set as “1”, the customer receives 1 item from the list of gift items.

Schedule this Mystery Gift Box: Optionally set the start and end date between which the mystery gift box can be purchased. Leave empty to allow purchase at any time.

List of Gift Items: Click Add New to add a gift item, select its Type (Product, Coupon or Wallet Balance) and select the product or coupon, or enter the wallet amount. Depending on the selection method, set the Priority or Probability of each item. The Current Stock of each product is displayed for reference. Drag the rows to sort them, and click Remove to delete an item.

Import / Export: Import or export the list of gift items as a CSV file. Import and export work only when the product is published.

Finally, click Publish.

Note:

  • Coupon and Wallet Balance types are not applicable for the “Current Stock” selection method.
  • The Wallet Balance type is displayed only when the “Wallet for WooCommerce” plugin is active and the Allow Guest Users to Purchase Mystery Gift Box Products option is disabled.
  • Make sure the inventory of the mystery gift box product is always less than the inventory of the gift products linked to it.

Setup and Configuration

↑ Back to top

To configure the plugin, go to “Mystery Gift Box > Settings”.

General

↑ Back to top

General Settings

Enable Mystery Gift Box: When enabled, mystery gift box products can be purchased by the customers.

Number of Gift Items to be Displayed in a Single Page: Set the number of gift items displayed per page in the list of gift items on the product page.

Allow Mystery Gift Box Purchase with Other Products: When enabled, customers can purchase mystery gift box products and other products in a single order. When disabled, mystery gift boxes must be purchased separately.

Order to Process Gift Items: Select Separate order to process the gift items in a new order, which is generated automatically when the mystery box purchase order status becomes Processing/Completed. Select Mystery box purchase order to add the gift items to the same order as the mystery box when the order status becomes Processing/Completed.

Default Order Status of Gift Product Order when Generated: If “Separate order” is selected, choose the status of the gift items order when it is generated.

Payment Methods to be Hidden for Mystery Gift Box Purchase: The selected payment methods will be hidden on the checkout page if the cart contains mystery gift box products.

Display Settings

Show or hide the following details on the mystery gift box single product page:

Gift Items Price Range Message: The message showing the number of gifts and their price range.

Mystery Gift Box Schedule Message: The message showing the start and end date of the mystery gift box.

List of Gift Items: The table listing the gift items in the mystery box.

Gift Items Stock: The current stock column in the list of gift items.

Gift Type: The type column (Product, Coupon or Wallet Balance) in the list of gift items.

Gift Value: The value column in the list of gift items.

Gift Items with Out of Stock Status: Whether the gift items which are out of stock are listed.

Restriction Settings

Show Mystery Gift Box Products For: Select All Users, Include Users, Exclude Users, Include User Roles or Exclude User Roles to control who can purchase mystery gift box products, and select the users or user roles in the option displayed below.

Allow Guest Users to Purchase Mystery Gift Box Products: When enabled, guest users can purchase mystery gift box products. Note: Wallet balance can’t be set as a gift if this option is enabled.

Mystery Gift Box Purchase Per Product Per Customer: By default, customers can purchase a mystery gift box any number of times (Unlimited). Select Limited to limit the purchases.

Mystery Gift Box Purchase Per Product Limit Per Customer: If “Limited” is selected, set the number of times a customer can purchase each mystery gift box product.

Custom CSS

Custom CSS: Add your own CSS to customize the frontend styles.

Localization

↑ Back to top

In this section, you can customize the labels displayed in the frontend.

Messages

↑ Back to top

In this section, you can customize the messages displayed in the frontend.

Shortcodes

↑ Back to top

The shortcodes available in the plugin are listed in this tab.

[mgb_orders]: Displays the mystery gift box purchases table of the customer. No parameters.

[mgb_price_ranges]: Displays the gift products price range message. Parameter: product_id.

[mgb_schedule]: Displays the mystery gift box schedule message. Parameter: product_id.

[mgb_reward_products]: Displays the list of gift items table. Parameter: product_id.

When used on a mystery gift box product page, [mgb_price_ranges], [mgb_schedule] and [mgb_reward_products] work without the product_id parameter and use the current product automatically. Example: [mgb_reward_products product_id=”123″].

Email

↑ Back to top

Mystery Gift Box – Customer Acknowledgement: This email is sent to the customer when they purchase a mystery gift box product, listing the gift items they will receive. Configure it in WooCommerce > Settings > Emails. It supports the WooCommerce email preview.

Mystery Gift Box Orders

↑ Back to top

Go to “Mystery Gift Box > Orders” to view and process the mystery gift box purchases. The table displays the Order ID, User Details, Mystery Box Name, Rewarded Items, Reward Worth, Reward Order Number/Status and Date.

Usage

↑ Back to top
  • Once the mystery gift box has been configured, the product is ready for purchase.
  • On the single product page, the list of gift items along with the price range and schedule is displayed, based on the Display Settings.
  • When the order status becomes Processing/Completed, the gift items are selected using the product selection method and processed in a separate order or the same order, based on the settings.
  • An email is sent to the customer with information about the gift items they will receive.
  • The purchases made by the customer are listed in the “Mystery Box Purchases” section on the My Account page.
  • The purchases are displayed in the Mystery Gift Box > Orders table for the admin to process the orders.

Translation

↑ Back to top

Mystery Gift Box for WooCommerce is translation ready, meaning you can edit the po files by which you can translate the text to any language. Steps to perform the translation are as follows. For example, a translation to French.

  • Download and install Poedit
  • Open the file mystery-gift-box-for-woocommerce > languages > mystery-gift-box-for-woocommerce.pot using Poedit.
  • Create a new translation file by clicking Create new translation button.
  • Choose the Source text and set its corresponding French text in Translation Text Area.
  • Save the changes.
  • Save the file name as mystery-gift-box-for-woocommerce-fr_FR.po.
  • Then go to WordPress dashboard > Settings > General and select the Site Language as French.

Related Products

WooCommerce Subscriptions is a WooCommerce extension that lets customers subscribe to your products or...

Offer add-ons like gift wrapping, special messages or other special options for your products.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.