Medical marijuana dispensaries distribute flower by weight, usually in grams. This tutorial will demonstrate how to: create a weight attribute in WooCommerce, create a variable product in WooCommerce, and configure weight variations: 1 g., 1/8 oz., 1/4 oz., 1/2 oz., 1 oz.
Part 1: Creating a WooCommerce Attribute – Weight
Before creating a variable product, you must first create the weight attribute which will be used for creating the product later.
Step 1
From the WordPress Dashboard go to: Dashboard > Products > Attributes
You can log into your WordPress Dashboard via: yourdomainname.com/wp-login.php
Step 2
The weight attribute will be called “Weight” and will have a slug of “weight”. After entering these values, click “Add attribute” button.
Step 3
Now that you’ve created our attribute called Weight, you may add terms. Hover your cursor over the newly created attribute and click on the “Configure terms” link.
Step 4
Adding weight attribute terms is very similar to how you initially created the weight attribute, in Step 2. Create five (5) weight attribute terms for: gram, eighth, quarter, half and ounce quantities. See screenshot (left) and example table (below)
Weight Attribute Terms
RECOMMENDED name and slug structure for Flower Inventory Manager and Daily Reconcile Report – Flower plugins.
Name | Slug |
---|---|
1 g. | 1-g |
1/8 oz. | 1-8-oz |
1/4 oz. | 1-4-oz |
1/2 oz. | 1-2-oz |
1 oz. | 1-oz |
Step 5
After you’ve created all your weight terms, your term list should have five (5) listed weights.
Step 6
You may also rearrange your terms by clicking and dragging, from the stack icon (on the right side of each row) to arrange your weights in order. For this tutorial, weights are arranged in ascending order.
Part 2: Creating a WooCommerce Variable Product
Now that you’ve created the weight attribute and added the weight attribute terms, you may create the variable product.
Step 8
To create a new flower product, first enter a product title; “Blue Dream” in the example. Select a product category; “Flower” the designated flower product category in the example. Select product type; change selection from “Simple product” to “Variable product”
Step 9
After setting the product type as “Variable product,” click the Attribute tab and select your attribute “Weight”
Step 10
You may now select your weight attribute terms. To select all, click the “Select all” button. Check the box “Used for variations,” and click the “Save attributes” button.
Step 11
After saving the attributes, click the Variations tab and select your “Create variations from all attributes.”
Step 12
WooCommerce will show a variation alert, click “OK”.
This is shown in case you’ve included multiple attributes to be used for product variations. For example, two attributes each with five terms would generate 25 variations.
Step 13
Five (5) variations will be created for each of the selected weight terms: 1 g., 1/8 oz., 1/4 oz., 1/2 oz., 1 oz.
Step 14
You may click and drag your variations to rearrange, similar to how weight attribute terms were rearranged in Step 6.
Step 15
Click on each respective row to expand the variation details. You will now update the information for each variation. See screenshot (left) and example table (below).
Variation Options – 1 g. Example
Flower Inventory Manager and Daily Reconcile Report – Flower plugins auto-calculate flower variation weight based on plugin settings, but can be overridden using the variation “Weight” option.
Label | Value | Description |
---|---|---|
SKU | FL-H-BLUEDREAM-1_g | SKU is used internally to uniquely identify each product and variation. |
Manage inventory? | Choose to manage this variation’s inventory. | |
Variation Price | 20.00 | Amount to charge for this variation. |
Sale Price | 15.00 | Sale price for this variation. If blank, no sale. |
Stock quantity | 5 | Number of units for this variation. |
Stock status | In stock | If variation is “in stock” or “Out of stock”. |
Weight (g) | 1.1 | For the weight, we are accounting for 0.1 grams of variance*. |
Step 16
You may not offer all the weight variations for all your flowers, so you may want to set specific variation’s stock status to “Out of stock.”
Should you choose to limit the product weight variations to 1 g., 1/8 oz. and 1/4 oz., the variations for 1/2 oz. and 1 oz. would need to have their stock quantity set to 0 and stock status set to “Out of stock”
Step 17
After you’ve entered all the values for your variations: SKU, Manage inventory, Variation price, Sale price (if applicable), Stock quantity, Stock status and Weight; click the “Save variations” button.
Step 18
Now that you’ve saved the variations for your variable product, click the “Publish” button to make the product visible on the website.
Alternatively, click the “Save Draft” button to keep working without making the product visible on the website.
Step 19
Now that you’ve published the product to the frontend of the website (customers see the frontend of the website, while admins see the backend or dashboard), click the Permalink, below the title, to view the product on the frontend of the website.
You may see the variable product options in the dropdown menu labeled: Weight.
Please note that this product has a Featured Image, added outside this tutorial’s scope, between Step 18 and Step 19.
Step 20
When the 1 g. option is selected, you can see the Variation price of $20.00 has been discounted to the Sale price of $15.00. You will also see that there are 5 units in stock and that the unique SKU for the 1 g. variation is “FL-H-BLUEDREAM-1_g” as they were configured in Step 15.
Conclusion
This tutorial demonstrates how to create a WooCommerce attribute, create attribute terms and use the terms to generate product variations which may be used for medical marijuana flower variable products.
If you have a suggestion to improve this tutorial, please contact us and let us know. H32B also creates custom video tutorials for dispensary staff WordPress and WooCommerce training.