How to create an attribute-specific shipping in WooCommerce
Attribute-specific shipping allows you to apply different shipping fees based on product attributes such as size, color, or material.
For example:
- Charge extra shipping for large-sized products.
- Offer free shipping for Cotton material items.
- Add a higher fee for Fragile items.
In The Article
Why use attribute-specific shipping?
- Fair pricing: Cover additional costs for products with special handling needs (e.g., fragile or oversized).
- Promotions: Offer free shipping for products with specific attributes (e.g., eco-friendly).
- Transparency: Customers see clear shipping charges tied to their chosen product variations.
- Flexibility: Apply rules to specific attributes without affecting other products.
Configuration steps
1. Add or edit a flat rate shipping method
- Navigate to WooCommerce → Settings → Shipping → Flat Rate Shipping (Dotstore).
- Click Add New Shipping Method or edit an existing one.
2. Add an attribute-specific rule
- In the shipping method settings, go to the Shipping Rules tab.
- Click Add New Rule.
- From the Condition dropdown, select Product Attribute.
- Choose the attribute (e.g., Size, Color, Material) and select the value (e.g., Large, Red, Cotton).
Enter the shipping fee you want to apply.
3. Save and test
- Click Save Changes.
- Add a product with the chosen attribute to the cart.
The attribute-specific shipping method should appear at checkout.
Two real examples
Example 1: Large-sized products
- Product Attribute: Size = Large
Rule: Apply $15 shipping
Checkout result:
- Customer buys a Large T-shirt ($30) → Shipping = $15
- Customer buys a Small T-shirt ($30) → Shipping = Standard rate
Example 2: Fragile items
- Product Attribute: Material = Glass
Rule: Apply $20 shipping
Checkout result:
- Customer buys a Glass Vase ($50) → Shipping = $20
- Customer buys a Wooden Vase ($50) → Shipping = Standard rate
Expected outcome
Once configured, WooCommerce will apply shipping fees only when products with the specified attributes are in the cart. This ensures accurate shipping costs and more transparent pricing for customers.