WooCommerce Shippo Shipping Integration

Заказчик: AI | Опубликовано: 18.11.2025
Бюджет: 250 $

Project Brief: Dynamic Shipping Calculation for WooCommerce Composite Products 1. Project Overview & Core Problem We have a WooCommerce store in the USA selling pet products. The core issue is a major discrepancy between the shipping rates calculated and displayed to the customer at checkout versus the actual cost we pay to purchase the shipping label via Shippo. Currently, the system is not dynamically calculating shipping based on the final package's weight and dimensions, leading to significant financial losses as customers are charged incorrect rates. 2. Current Product & Shipping Structure We sell products in pre-defined bundles/packages. Customers cannot buy individual items; they must choose from the following "Composite Products": Mix and Match 5: Customer selects any 5 individual products. Shipped in a box: 18" x 4" x 18". Smarter Pack 18: A fixed set of 18 products. Shipped in a box: 16" x 12" x 12". Mix and Match 50: Customer selects any 50 individual products. Shipped in a box: 20" x 20" x 20". Mix and Match 100: Customer selects any 100 products. Shipped as two separate boxes, each 20" x 20" x 20". Individual Product Weights (for calculation): S1: 205g, S2: 240g, S3: 285g M1: 390g, M2: 465g, M3: 505g L1: 610g, L2: 670g, L3: 790g 3. The Objective / Final Goal The final objective is to have 100% accurate, real-time shipping rates on the website that match what we will pay in the Shippo dashboard after the order is placed. The calculation MUST consider: Dynamic Weight: The total weight must be the sum of the individual products the customer selects inside a composite product, plus the weight of the packaging. Dimensional Weight: The system must calculate the dimensional weight of the predefined box for each package type and charge the customer based on the greater value between the actual weight and the dimensional weight. Correct Box Assignment: The correct box dimensions must be assigned based on the product type in the cart (e.g., a "Mix and Match 5" always uses the 18x4x18 box). Multiple Packages: The "Mix and Match 100" must be recognized as two separate packages for shipping calculation. 4. What Has Been Tried & Failed Custom Code in functions.php: We implemented code to try and set package dimensions and weights dynamically using WooCommerce hooks (woocommerce_shipping_packages). While it works for simple cases, it fails to accurately communicate with the Shippo API for complex, dynamic composites and multiple packages. Shippo Plugin (Free Version): The native integration does not natively understand our "composite product" structure. It cannot dynamically calculate the weight of the selected components or reliably handle our multi-package scenario for the 100-unit pack. Configuration-Only Approaches: Using fixed weights or simple shipping classes has proven inaccurate because the weight varies drastically based on customer selection (e.g., 5 small items vs. 5 large items). 5. Proposed Solution Paths (For Freelancer to Evaluate & Implement) We are open to the best technical solution. The freelancer should propose the most robust and maintainable approach. Potential paths include: Path A: Advanced Plugin Stack WooCommerce Composite Products (Official Extension) for robust dynamic weight and price calculation. WooCommerce Table Rate Shipping (Official Extension) to create precise shipping rules based on total cart weight and destination, manually defining the rates for each of our package types. This bypasses Shippo for the customer-facing quote but guarantees accuracy. Shippo would then be used only post-purchase to buy the actual label at the correct, pre-calculated rate. Path B: Custom Shippo Integration Develop a custom integration that correctly passes the final, calculated package parameters (dynamic weight + fixed dimensions) to the Shippo API to retrieve the live rate. This is complex and must handle multiple packages. Path C: Hybrid Plugin + Custom Code Use a robust plugin like "WooCommerce Product Bundles" or the official "Composite Products" and write minimal, targeted code to ensure the final shipping package data is structured perfectly for the Shippo API. 6. Key Deliverables A fully functional shipping calculation on the cart/checkout page. Accuracy: The displayed rate must be within a small margin of the final Shippo label cost for the same address and package data. Dynamic Updates: The shipping cost must update instantly when the user changes their product selections within a composite product. Multi-Package Support: The "Mix and Match 100" must generate a shipping cost for two packages. Documentation: Brief documentation on how the solution works for future maintenance. 7. Technical Environment Platform: WordPress E-commerce: WooCommerce Composite Plugin: Currently using "Composite Products" (unsure of the specific developer) Shipping Integration: Shippo (Plugin and API connected) Theme: Astra (Child Theme)