Found a bug where non shippable products are passed to ShipWire. This causes the order to be 'held' at ShipWire because the products are not in warehouses and causes a delay in shipment. Because of the need for manual intervention and delay in shipping I have marked this as a major bug. It can be easily fixed by adding uc_cart_product_is_shippable($product) to the foreach $order->products section of function uc_shipwire_action_order.

function uc_shipwire_action_order($order) {
//...
  foreach ($order->products as $num => $product) {
    // ADDED
    if (uc_cart_product_is_shippable($product)) {
    // ADDED
      // Override the product variable and use the additional metadata
      $bundle = node_load($product->nid);

      if ($bundle->field_computed_skus[0]['value']) {
        $skus = explode(",", $bundle->field_computed_skus[0]['value']);
        foreach ($skus as $sku) {
          $xml .= '<Item num="'. $bundle->nid .'">';
          $xml .= '<Code>' . $sku . '</Code>';
          $xml .= '<Quantity>'. $bundle->pkg_qty .'</Quantity>';
          $xml .= '</Item>';
        }
      }
      else {
        $xml .= '<Item num="'. $product->nid .'">';
        $xml .= '<Code>' . $product->model . '</Code>';
        $xml .= '<Quantity>'. $product->qty .'</Quantity>';
        $xml .= '</Item>'; 
      }
    }
  // ADDED
  }
  // ADDED
//...
}

Patch provided against DEV version and tested in live environment. Please review and incorporate. I would recommend releasing a new version with this patch.

CommentFileSizeAuthor
uc_shipwire_6.x-1.x-dev_products.patch1.84 KBtinker

Comments

tinker’s picture

This patch is working successfully on a production site for over six weeks. This is a serious issue since non-shippable product are passed to ShipWire causing the order to be held. Any chance of a commit?

zkrebs’s picture

subscribe

tr’s picture

Status: Needs review » Fixed

Fixed in 6.x-1.x-dev and 7.x-1.x-dev. Thanks.

tinker’s picture

Thank for applying the fix.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.