Your cart is currently empty!
Overview
Custom Per Product Units for WooCommerce is a versatile plugin that lets you display product dimensions and weight in custom units on a per-product basis. This tool allows you to meet regional measurement standards and enhance the customer experience. Moreover, it easily overrides WooCommerce’s default settings. In short, our plugin ensures every product listing meets your specific market needs and improves conversion rates.
Key Features
- Custom Weight Units: Choose from a wide range of weight measurements such as kilograms, grams, pounds, and ounces.
- Custom Dimension Units: Select from various dimension units like meters, centimeters, inches, feet, and yards.
- Admin Preview: Enjoy a live preview that instantly shows how your custom unit selections will appear on the front end.
- Easy Integration: Seamlessly work with WooCommerce product settings to override global defaults on a per-product basis.
- Extendable: Expand the functionality by adding or modifying units and adjusting display settings using custom code snippets.
Configuring the Plugin
Installation
- Download the plugin ZIP file.
- Navigate to WordPress Admin > Plugins > Add New.
- Click Upload Plugin, choose the ZIP file, then click Install Now.
- Activate the plugin.
Setting Custom Units for a Product
Follow these steps to configure custom units for a WooCommerce product:
Step 1: Edit a Product
- Go to WooCommerce > Products.
- Click Add New or select an existing product to edit.
- Scroll down to the Product Data panel.
Step 2: Configure Custom Units
- Click the Shipping tab.
- Locate the Custom Units section.
- Select a Custom Weight Unit from the dropdown (e.g., grams, pounds, ounces).
- Select a Custom Dimension Unit from the dropdown (e.g., inches, centimeters, feet).
- Adjust the Decimal Precision if desired.
Step 3: Save and Preview
- Click Save Changes.
- Use the Admin Preview to view the custom units on the front end.
- Click Publish (or Update if editing an existing product).
Front-End Display
Once you configure the custom units, they display on the Single Product Page. In the Additional Information tab, the product’s weight and dimensions show up using your selected units and conversions.
Single Product Page
- Your product details now reflect the custom weight and dimension units.
Available Filters
Developers can modify the plugin using various filters:
Weight Filters
cumfw_weight_units
– Change the available weight units.cumfw_convert_weight
– Adjust the weight conversion logic.cumfw_weight_decimals
– Set the decimal precision for weight values.
Dimension Filters
cumfw_dimension_units
– Modify the list of available dimension units.cumfw_convert_dimension
– Customize the dimension conversion logic.
Extending the Plugin with Custom Filters
Developers can extend this plugin by adding custom filters. For example, you can add new weight or dimension units, modify conversion rules, or adjust decimal precision.
Example: Adding a Custom Weight Unit
For instance, to add ounces (oz) as a weight unit, use the filter below. First, add your custom unit, then adjust conversion rates accordingly.
Example: Adjusting Decimal Precision for Weight Units
Alternatively, remove decimals for grams by modifying the precision filter:
Example: Adding a Custom Dimension Unit
Finally, to introduce a new dimension unit like yards (yd), implement this filter:
Implementing Custom Code
You can insert these code snippets into your theme’s functions.php
file or manage them with a plugin such as Code Snippets for better control.
Questions & Support
If you have any questions or need further assistance with woocommerce custom per product units, please Contact our Support. You may also visit the WooCommerce official website for additional resources.