? ecommerce-parcelVid.patch
Index: parcel.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/parcel/Attic/parcel.module,v
retrieving revision 1.27.2.3.2.2.2.5
diff -u -p -r1.27.2.3.2.2.2.5 parcel.module
--- parcel.module	20 Nov 2007 12:39:24 -0000	1.27.2.3.2.2.2.5
+++ parcel.module	22 Jan 2010 20:43:44 -0000
@@ -99,7 +99,6 @@ function parcel_productapi(&$node, $op, 
       $nids = explode(',', $node->mnid);
       foreach ($nids as $nid) {
         $nid = trim($nid);
-        if (product_is_shippable($nid)) {
           // Somehow in the loop the foo object
           // gets modified to include an vid field
           // (some weird php thing?)
@@ -107,10 +106,11 @@ function parcel_productapi(&$node, $op, 
           $foo = new StdClass;
           $foo->nid = $nid;
           $product = product_load($foo);
-          // The productapi of for example the tangible and apparel
-          // products will adjust the stock level automagically
-          $product->qty = 1;
-          module_invoke($product->ptype, 'productapi', $product, 'on payment completion', $error);
+          if (product_is_shippable($product->vid)) {
+            // The productapi of for example the tangible and apparel
+            // products will adjust the stock level automagically
+            $product->qty = 1;
+            module_invoke($product->ptype, 'productapi', $product, 'on payment completion', $error);
         }
       }
       break;
