Shipping Books, DVDs, and More? Set Up WooCommerce with Media Mail!
Are you selling books, DVDs, CDs, or other media through your WooCommerce store? Then you’re missing out on a major shipping cost-saving opportunity: Media Mail! This service offered by the USPS is specifically designed for shipping educational materials at a significantly lower rate than standard shipping. This article walks you through how to configure WooCommerce to use Media Mail.
Why Use Media Mail?
Imagine you’re selling a textbook. A standard shipping label might cost $8-$15, especially for heavier books. Media Mail, on the other hand, could be as low as $3-$5 for the same package. That’s a HUGE difference that impacts your bottom line and makes your products more attractive to customers.
The benefits are clear:
- Lower shipping costs: Attract more customers by offering affordable shipping.
- Increased sales: Lower prices overall due to reduced expenses.
- Happier customers: Everyone loves saving money!
- Competitive edge: Stand out from other sellers with better shipping options.
- Permitted items: Books (at least 8 pages), sound recordings, video recordings, printed music, and other educational materials.
- Prohibited items: Advertising, magazines, computer games, video games, and anything that isn’t primarily educational.
- WooCommerce Weight Based Shipping: This is a simple plugin allowing you to set shipping rates based on weight, and you can create a specific rate for Media Mail.
- WooCommerce Table Rate Shipping by Codection: Powerful plugin where you can create rules based on different parameters, including weight and shipping classes.
- Advanced Shipping Packages: An advanced plugin with the ability to control the package and shipping method.
- Go to WooCommerce > Learn more about Woocommerce How To Remove Pictures From Reviews Settings > Shipping > Weight Based Shipping.
- Click Add rate.
- Title: Enter “Media Mail”.
- Status: Enabled.
- Weight: Define weight ranges and their corresponding prices (e.g., 0-1 lb = $3, 1-2 lbs = $4.50, etc.). Research USPS Media Mail rates to determine the correct pricing.
- Condition: You can add condition rules such as, shipping class is “Media Mail”.
- Click Save changes.
Understanding Media Mail Restrictions
Before diving in, it’s crucial to understand what qualifies for Media Mail. The USPS has specific rules:
Why is this important? The USPS can inspect packages shipped via Media Mail. If you include prohibited items, you risk your package being returned or having to pay the higher standard shipping rate. Be honest and accurate about your contents!
Setting up Media Mail in WooCommerce
Here’s a step-by-step guide to add Media Mail as a shipping option in your WooCommerce store:
Method 1: Using a WooCommerce Shipping Plugin (Recommended)
This is the easiest and most reliable way to integrate Media Mail. Plugins offer features like real-time rate calculations and label printing, saving you time and effort.
1. Choose a plugin: There are several WooCommerce shipping plugins that support Media Mail. Popular options include:
2. Install and activate the plugin: Go to Plugins > Add New in your WordPress dashboard, search for your chosen plugin, install, and activate it.
3. Configure the plugin: The configuration process will vary depending on the plugin you choose. Here’s a general example using WooCommerce Weight Based Shipping:
Method 2: Creating a Custom Shipping Method (For Advanced Users)
If you’re comfortable with coding and prefer a more hands-on approach, you can create a custom shipping method using PHP.
1. Access your theme’s `functions.php` file: Be cautious! Editing this file incorrectly can break your site. It’s always recommended to create a child theme first to avoid losing changes during theme updates. You can find your `functions.php` file in your theme’s directory: `/wp-content/themes/[your-theme-name]/functions.php`.
2. Add the following code to your `functions.php` file:
add_filter( 'woocommerce_shipping_methods', 'add_media_mail_shipping_method' ); function add_media_mail_shipping_method( $methods ) { $methods['media_mail'] = 'WC_Media_Mail_Shipping'; return $methods; }
add_action( ‘woocommerce_init’, ‘init_media_mail_shipping_method’ );
function init_media_mail_shipping_method() {
class WC_Media_Mail_Shipping extends WC_Shipping_Method {
/
* Constructor for your shipping class
*
* @access public
* @return void
*/
public function __construct() {
$this->id = ‘media_mail’; // ID for shipping method. Should be UGLY!
$this->method_title = __( ‘Media Mail’, ‘woocommerce’ ); // Title shown in admin
$this->method_description = __( ‘Shipping via USPS Media Mail.’, ‘woocommerce’ ); // Description shown in admin
$this->enabled = $this->get_option( ‘enabled’ ); // This can be ‘yes’ if the method is enabled, or ” if not.
$this->title = $this->get_option( ‘title’ ); // This is the name of the shipping shown to the end users
$this->init();
}
/
* Init settings
*
* @access public
* @return void
*/
function init() {
// Load the settings API
$this->init_form_fields = array(
‘enabled’ => array(
‘title’ => __( ‘Enable/Disable’, ‘woocommerce’ ),
‘type’ => ‘checkbox’,
‘label’ => __( ‘Enable Media Mail’, ‘woocommerce’ ),
‘default’ => ‘yes’
),
‘title’ => array(
‘title’ => __( ‘Method Title’, ‘woocommerce’ ),
‘type’ => ‘text’,
‘description’ => __( ‘This controls the title which the user sees during checkout.’, ‘woocommerce’ ),
‘default’ => __( ‘Media Mail’, ‘woocommerce’ ),
‘desc_tip’ => true
),
‘cost’ => array(
‘title’ => __( ‘Cost’, ‘woocommerce’ ),
‘type’ => ‘text’,
‘description’ => __( ‘Enter a cost (weight based or static).’, ‘woocommerce’ ),
‘default’ => __( ’10’, ‘woocommerce’ ),
‘desc_tip’ => true
),
);
// Save settings in admin if you have any defined
$this->init_settings();
// Save settings.
add_action( ‘woocommerce_update_options_shipping_’ . $this->id, array( $this, ‘process_admin_options’ ) );
}
/
* calculate_shipping function.
*
* @access public
* @param mixed $package
* @return void
*/
public function calculate_shipping( $package ) {
$weight = 0;
foreach ( $package[‘contents’] as $item_id => $values ) {
$_product = wc_get_product( $values[‘data’] );
$weight = $weight + $_product->get_weight() * $values[‘quantity’];
}
$cost = floatval($this->get_option( ‘cost’ )); // Explore this article on How To Edit Woocommerce Account Page With Elementor You’ll need to adjust this based on weight.
$this->add_rate( Read more about How To Remove Wishlist From Woocommerce array(
‘id’ => $this->id,
‘label’ => $this->title,
‘cost’ => $cost,
‘calc_tax’ => ‘per_item’
) );
}
}
}
3. Adjust the Code: The code above provides a basic Media Mail shipping method. You’ll need to customize it further to calculate shipping costs based on weight. The ‘cost’ section contains the logic to adjust it. For a more complex weight-based calculation, you may need to use conditional statements and the `weight` variable in the code. You also can store the cost in an array based on the weight.
4. Configure the Shipping Method: Go to WooCommerce > Settings > Shipping > Shipping Zones. Choose your shipping zone and click the Add shipping method button. Select “Media Mail” from the dropdown and click Add shipping method. Then click on the “Media Mail” shipping method to configure the title and cost.
Method 3: Shipping Classes
Shipping classes are a great way to assign a product to a category, such as the Media Mail class. You can then select the Check out this post: How To Set Up Paypal To Work With Woocommerce class to a shipping option.
1. Go to WooCommerce > Settings > Shipping > Shipping Classes
2. Add a shipping class named Media Mail with the slug ‘media-mail’
3. Go to Products > All Products
4. Edit each product with the shipping class of Media Mail
5. Go to WooCommerce > Settings > Shipping Zones
6. If creating a Shipping Method via code, inside “`public function calculate_shipping( $package )“` you can grab the shipping classes for all items, and if one of them is ‘media-mail’, then use the media mail.
$shipping_classes = array(); foreach ( $package['contents'] as $item_id => $values ) { $_product = wc_get_product( $values['data'] ); $product_shipping_class_id = $_product->get_shipping_class_id(); if($product_shipping_class_id) { $term = get_term( $product_shipping_class_id, 'product_shipping_class' ); $shipping_classes[] = $term->slug; } } if (in_array('media-mail', $shipping_classes)) { // Media Mail Price calculation }
Setting Shipping Restrictions
If you’re only using Media Mail for certain products, you’ll need to add a way to restrict it:
* Shipping Classes: As shown in Method 3, create a “Media Mail” shipping class and assign it to eligible products. Then, configure your shipping method to only offer Media Mail if the cart contains products in that shipping class.
* Plugin Solutions: Some WooCommerce shipping plugins allow you to restrict shipping methods based on product categories or attributes. Look for plugins with advanced rule-based shipping configurations.
Testing and Troubleshooting
After setting up Media Mail, it’s crucial to test it thoroughly:
1. Add a Media Mail-eligible product to your cart.
2. Go to the checkout page.
3. Verify that Media Mail is displayed as a shipping option and that the cost is accurate.
4. If Media Mail isn’t showing, check the following:
- Is the shipping method enabled?
- Are there any weight or dimensional restrictions preventing it from displaying?
- Are you selling to another country? Media Mail does not go to countries outside of the USA.
Optimizing Your Listings for Media Mail
To further encourage customers to choose Media Mail, you can highlight it in your product descriptions and during checkout.
- Product Descriptions: Mention “Affordable Media Mail shipping available!” in your product descriptions.
- Checkout Page: Add a note to the shipping options, such as “Save money with Media Mail – ideal for books and educational materials!”
Conclusion
By adding Media Mail to your WooCommerce store, you can significantly reduce shipping costs, attract more customers, and boost your sales. Remember to research the USPS Media Mail guidelines, choose the right shipping method, and test your setup thoroughly. Happy shipping!