Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Oops, sorry, I misread that.

 

So the data is in the database, and all of the code is correct, but it's not showing up when it's called. Odd. Let's go back to orders.php and see if the data is there. Find

      $products = $cart->get_products();

and add the code to print the $products array just below that line. That will let us know whether the problem is in the Cart class or further down.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

In catalog/includes/classes/order.php

 

placed

      $products = $cart->get_products();

print '<pre>';
print_r ($products);
print '</pre>';

 

2 products in cart, one from each vendor, when proceed to shipping.php, here is the array at the top

 

Array
(
   [0] => Array
       (
           [id] => 24
           [name] => Disciples: Sacred Lands
           [model] => PC-DISC
           [image] => gt_interactive/disciples.gif
           [discount_categories_id] => 
           [price] => 90.0000
           [quantity] => 1
           [weight] => 8.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 90
           [tax_class_id] => 1
           [vendors_id] => 
           [vendors_name] => 
           [attributes] => 
       )

   [1] => Array
       (
           [id] => 12
           [name] => Die Hard With A Vengeance
           [model] => DVD-DHWV
           [image] => dvd/die_hard_3.gif
           [discount_categories_id] => 
           [price] => 39.9900
           [quantity] => 1
           [weight] => 7.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 39.99
           [tax_class_id] => 1
           [vendors_id] => 
           [vendors_name] => 
           [attributes] => 
       )

)

-Dave

Link to comment
Share on other sites

and if I add a 3rd item that has a prod attribute...

 

[2] => Array
       (
           [id] => 26{3}9
           [name] => Microsoft IntelliMouse Explorer
           [model] => MSIMEXP
           [image] => kyaearlydayschop.jpg
           [discount_categories_id] => 
           [price] => 64.9500
           [quantity] => 1
           [weight] => 8.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 70.95
           [tax_class_id] => 1
           [vendors_id] => 
           [vendors_name] => 
           [attributes] => Array
               (
                   [3] => 9
               )

 

just to show if the attributes were being picked up, if relevant

-Dave

Link to comment
Share on other sites

No vendors_id or vendors_name. That means that $cart->get_products() is not returning any vendor data. It should be getting that data straight out of the database, and we have proven that data exists. Therefore the problem lies in the get_products method of the cart class. The plot thickens.

 

In catalog/includes/classes/shopping_cart.php, find these lines (508ff in the distribution)

//MVS start
                                   'vendors_id' => $products['vendors_id'],
                                   'vendors_name' => $products['vendors_name'],
//MVS end
                                   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
       }
     }

Just after that, add in the print_r() code to print out $products_array. It should show up at the same place as the previous array print.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

well I tried, but do not get an array to show. Placed like this

 

                                    'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
       }
     }
print '<pre>';
print_r ($products_array);
print '</pre>';

     return $products_array;
   }

 

I then tried adding exit; but no array print or exit occured.

-Dave

Link to comment
Share on other sites

I just tried that code in my test site and it prints correctly. Are you certain that you put it in the get_products method and not the get_vendors_products method? Yes, I should have made that clear previously. Sorry.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I just tried that code in my test site and it prints correctly. Are you certain that you put it in the get_products method and not the get_vendors_products method? Yes, I should have made that clear previously. Sorry.

 

Regards

Jim

 

get_products the one nearest the end of file?

I placed print_r ($products_array); there and wham... arrays galore. The output:

 

Array
(
   [0] => Array
       (
           [id] => 26{3}9
           [name] => Microsoft IntelliMouse Explorer
           [model] => MSIMEXP
           [image] => kyaearlydayschop.jpg
           [discount_categories_id] => 
           [price] => 64.9500
           [quantity] => 1
           [weight] => 8.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 70.95
           [tax_class_id] => 1
           [vendors_id] => 
           [vendors_name] => 
           [attributes] => Array
               (
                   [3] => 9
               )

       )

   [1] => Array
       (
           [id] => 19
           [name] => There's Something About Mary
           [model] => DVD-TSAB
           [image] => dvd/theres_something_about_mary.gif
           [discount_categories_id] => 
           [price] => 49.9900
           [quantity] => 1
           [weight] => 7.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 49.99
           [tax_class_id] => 1
           [vendors_id] => 
           [vendors_name] => 
           [attributes] => 
       )

   [2] => Array
       (
           [id] => 18
           [name] => Speed 2: Cruise Control
           [model] => DVD-SPEED2
           [image] => dvd/speed_2.gif
           [discount_categories_id] => 
           [price] => 42.0000
           [quantity] => 1
           [weight] => 7.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 42
           [tax_class_id] => 1
           [vendors_id] => 
           [vendors_name] => 
           [attributes] => 
       )

)

-Dave

Link to comment
Share on other sites

Still no vendors_id. Check the $products_query SQL string just above the print code you added (still in the get_products method.) Is vendors_id in the string?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

ok, so remember about a zillion posts :) back I mentioned that include/classes/shopping_cart.php was a tricky merge. I think Qty Price Break for SPPC had me remove the query!, not exactly sure yet, but I do think that that query is non-existent. You may kick me in the head now. Here's the section in my current file

 

    function get_products() {
     global $languages_id, $pfs; // PriceFormatterStore added

// BOF Separate Pricing Per Customer
 $this->cg_id = $this->get_customer_group_id();
// EOF Separate Pricing Per Customer

     if (!is_array($this->contents)) return false;
// BOF QPBPP for SPPC
     $discount_category_quantity = array();
     foreach ($this->contents as $products_id => $contents_array) {
         if(tep_not_null($contents_array['discount_categories_id'])) {
           if (!isset($discount_category_quantity[$contents_array['discount_categories_id']])) {
               $discount_category_quantity[$contents_array['discount_categories_id']] = $contents_array['qty'];
           } else {
               $discount_category_quantity[$contents_array['discount_categories_id']] += $contents_array['qty'];
           }
         }
     } // end foreach

     $pf = new PriceFormatter;
// EOF QPBPP for SPPC

     $products_array = array();
     reset($this->contents);
     while (list($products_id, ) = each($this->contents)) {
//MVS
//upsxml dimensions - added  p.products_length, p.products_width, p.products_height, p.products_ready_to_ship, 
// BOF QPBPP for SPPC
     $pf->loadProduct($products_id, $languages_id); // does query if necessary and adds to 
     // PriceFormatterStore or gets info from it next
     if ($products = $pfs->getPriceFormatterData($products_id)) {
      if (tep_not_null($this->contents[$products_id]['discount_categories_id'])) {
         $nof_items_in_cart_same_cat =  $discount_category_quantity[$this->contents[$products_id]['discount_categories_id']];
         $nof_other_items_in_cart_same_cat = $nof_items_in_cart_same_cat - $this->contents[$products_id]['qty'];
       } else {
         $nof_other_items_in_cart_same_cat = 0;
       }
         $products_price = $pf->computePrice($this->contents[$products_id]['qty'], $nof_other_items_in_cart_same_cat);
// EOF QPBPP for SPPC

         $products_array[] = array('id' => $products_id,
                                   'name' => $products['products_name'],
                                   'model' => $products['products_model'],
                                   'image' => $products['products_image'],
// BOF QPBPP for SPPC
                                   'discount_categories_id' => $this->contents[$products_id]['discount_categories_id'],
// EOF QPBPP for SPPC
                                   'price' => $products_price,
                                   'quantity' => $this->contents[$products_id]['qty'],
                                   'weight' => $products['products_weight'],
//upsxml dimensions start
                                   'length' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_length']),
         			                'width' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_width']),
         			                'height' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_height']),
                                   'ready_to_ship' => $products['products_ready_to_ship'],
//uspxml dimensions end
                                   'final_price' => ($products_price + $this->attributes_price($products_id)),
                                   'tax_class_id' => $products['products_tax_class_id'],
//MVS start
                                   'vendors_id' => $products['vendors_id'],
                                   'vendors_name' => $products['vendors_name'],
//MVS end
                                   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
       }
     }
// print '<pre>';
// print_r ($products_array);
// print '</pre>';

     return $products_array;
   }

 

For reference, I referred back to the instructions for QPBPP for SPPC:

 

REPLACE

        $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
       if ($products = tep_db_fetch_array($products_query)) {
         $prid = $products['products_id'];
         $products_price = $products['products_price'];

// BOF Separate Pricing Per Customer
  $specials_price = tep_get_products_special_price($prid);
 if (tep_not_null($specials_price)) {
    $products_price = $specials_price;
     } elseif ($this->cg_id != 0){
       $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$prid . "' and customers_group_id =  '" . $this->cg_id . "'");
       if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
       $products_price = $customer_group_price['customers_group_price'];
         }
 }
// EOF Separate Pricing Per Customer

 

WITH

// BOF QPBPP for SPPC
     $pf->loadProduct($products_id, $languages_id); // does query if necessary and adds to 
     // PriceFormatterStore or gets info from it next
     if ($products = $pfs->getPriceFormatterData($products_id)) {
      if (tep_not_null($this->contents[$products_id]['discount_categories_id'])) {
         $nof_items_in_cart_same_cat =  $discount_category_quantity[$this->contents[$products_id]['discount_categories_id']];
         $nof_other_items_in_cart_same_cat = $nof_items_in_cart_same_cat - $this->contents[$products_id]['qty'];
       } else {
         $nof_other_items_in_cart_same_cat = 0;
       }
         $products_price = $pf->computePrice($this->contents[$products_id]['qty'], $nof_other_items_in_cart_same_cat);
// EOF QPBPP for SPPC

Now that I see that the query is missing, either the instructions for QPBPP mistakenly delete the query when it should not, or maybe it should have been ADD AFTER or ADD BEFORE instead of REPLACE... I do not know yet.

 

comparing your file and mine with winmerge shows this section missing (well, um, "replaced" in the confusion

 

        $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_length, p.products_width, p.products_height, p.products_ready_to_ship, p.products_tax_class_id, v.vendors_id, v.vendors_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_VENDORS . " v where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and v.vendors_id = p.vendors_id and pd.language_id = '" . (int)$languages_id . "'");
       if ($products = tep_db_fetch_array($products_query)) {
         $prid = $products['products_id'];
         $products_price = $products['products_price'];

         $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
         if (tep_db_num_rows($specials_query)) {
           $specials = tep_db_fetch_array($specials_query);
           $products_price = $specials['specials_new_products_price'];
         }

 

arghh! So now to sort my mess out properly... how would you suggest?

 

Sincere thanks! I never would have sorted this alone

-Dave

Link to comment
Share on other sites

Ah yes, the old Price Formatter class. That thing is a mess. I didn't realize that SPPC had incorporated that. I've used it before, so I dug out the code for you. This replaces the $products_array[] section. I think. This should give you an idea at least.

         $vendors_query = tep_db_query("select v.vendors_id,
                                               v.vendors_name
                                        from " . TABLE_PRODUCTS . " p,
                                             " . TABLE_VENDORS . " v
                                        where p.products_id = '" . (int)$products_id . "'
                                          and v.vendors_id = p.vendors_id"
                                      );
         $vendors = tep_db_fetch_array($vendors_query);
         $products_array[] = array('id' => $products_id,
                                   'name' => $products['products_name'],
                                   'manufacturer' => $products['manufacturers_name'],
                                   'model' => $products['products_model'],
                                   'image' => $products['products_image'],
                                   'price' => $products_price,
                                   'quantity' => $this->contents[$products_id]['qty'],
                                   'weight' => $products['products_weight'],
                                   'final_price' => ($products_price + $this->attributes_price($products_id)),
                                   'tax_class_id' => $products['products_tax_class_id'],
                                   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),                                    'vendors_id' => $products['vendors_id'],
                                   'vendors_id' => $vendors['vendors_id'],
                                   'vendors_name' => $vendors['vendors_name']
                                  );

It looks right to me anyway. Let me know if it works.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

woot!

 

Array
(
   [0] => Array
       (
           [id] => 12
           [name] => Die Hard With A Vengeance
           [manufacturer] => 
           [model] => DVD-DHWV
           [image] => dvd/die_hard_3.gif
           [discount_categories_id] => 
           [price] => 39.9900
           [quantity] => 1
           [weight] => 7.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 39.99
           [tax_class_id] => 1
           [attributes] => 
           [vendors_id] => 3
           [vendors_name] => Vendor 2
       )

   [1] => Array
       (
           [id] => 26{3}9
           [name] => Microsoft IntelliMouse Explorer
           [manufacturer] => 
           [model] => MSIMEXP
           [image] => kyaearlydayschop.jpg
           [discount_categories_id] => 
           [price] => 64.9500
           [quantity] => 1
           [weight] => 8.00
           [length] => 
           [width] => 
           [height] => 
           [ready_to_ship] => 
           [final_price] => 70.95
           [tax_class_id] => 1
           [attributes] => Array
               (
                   [3] => 9
               )

           [vendors_id] => 1
           [vendors_name] => My Store
       )

)

 

Should Manufacturer be there? thats the only line that was not in the original $products_array[]

Does the order matter? your post has attributes above vendor_id, mine had it below vendors_name. Does it matter?

the query from your file was:

         $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_length, p.products_width, p.products_height, p.products_ready_to_ship, p.products_tax_class_id, v.vendors_id, v.vendors_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_VENDORS . " v where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and v.vendors_id = p.vendors_id and pd.language_id = '" . (int)$languages_id . "'");

 

Im about to run some test orders... thank you!!

Edited by Roaddoctor

-Dave

Link to comment
Share on other sites

I may have added manufacturer for some reason. I think I needed the manufacturer's name in the cart. If you don't need it, take it out. I took that code sample from a store that has a lot of mods, so there may be extraneous stuff in there. I didn't take the time to compare it to stock osC code.

 

Order does not matter. It's a name indexed array, so as long as the name on the left is correct the data can be retrieved. That's the advantage of using name => value pairs.

 

Glad to hear it's working now. And now you know a bit more about debugging. Well, the way I do it anyway. There may well be better methods.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks Jim - I did learn quite a bit.

 

Take a look at the array back in admin/orders.php

 

Array
(
   [0] => Array
       (
           [Vid] => 3
           [Vname] => Vendor 2
           [Vmodule] => flat
           [Vmethod] => Best Way
           [Vcost] => 6.0000
           [Vship_tax] => 0.0000
           [Vorder_sent] => no
           [Vnoname] => Shipper
           [spacer] => -
           [orders_products] => Array
               (
                   [0] => Array
                       (
                           [qty] => 1
                           [name] => Die Hard With A Vengeance
                           [tax] => 0.0000
                           [model] => DVD-DHWV
                           [price] => 39.9900
                           [vendor_name] => 
                           [vendor_ship] => 
                           [shipping_method] => 
                           [shipping_cost] => 
                           [final_price] => 39.9900
                           [spacer] => -
                       )

               )

       )

   [1] => Array
       (
           [Vid] => 1
           [Vname] => My Store
           [Vmodule] => item
           [Vmethod] => Best Way
           [Vcost] => 3.5000
           [Vship_tax] => 0.0000
           [Vorder_sent] => no
           [Vnoname] => Shipper
           [spacer] => -
           [orders_products] => Array
               (
                   [0] => Array
                       (
                           [qty] => 1
                           [name] => Microsoft IntelliMouse Explorer
                           [tax] => 0.0000
                           [model] => MSIMEXP
                           [price] => 64.9500
                           [vendor_name] => 
                           [vendor_ship] => 
                           [shipping_method] => 
                           [shipping_cost] => 
                           [final_price] => 70.9500
                           [spacer] => -
                           [attributes] => Array
                               (
                                   [0] => Array
                                       (
                                           [option] => Model
                                           [value] => USB
                                           [prefix] => +
                                           [price] => 6.0000
                                       )

                               )

                       )

               )

       )

)

 

How's that look?

 

from quick glance over

i've noticed that clicking the line item packingslip is not showing Product or Model now (worked before)

Here is how the page looks now. Is this correct?

mvsfix1.jpg

-Dave

Link to comment
Share on other sites

sorry, and for the benefit of others who use SPPC + Price Break for SPPC + MVS

Here is what I have in includes/classes/shopping_cart.php somewhere around line 738, below the priceformatter block

 

         $vendors_query = tep_db_query("select v.vendors_id,
	                                v.vendors_name
					from " . TABLE_PRODUCTS . " p,
					     " . TABLE_PRODUCTS_DESCRIPTION . " pd,
					     " . TABLE_VENDORS . " v
					where p.products_id = '" . (int)$products_id . "'
					and pd.products_id = p.products_id
					and v.vendors_id = p.vendors_id
					and pd.language_id = '" . (int)$languages_id . "'"
				);
         $vendors = tep_db_fetch_array($vendors_query);
         $products_array[] = array('id' => $products_id,
	                    'name' => $products['products_name'],
			    'model' => $products['products_model'],
			    'image' => $products['products_image'],
// BOF QPBPP for SPPC
                                   'discount_categories_id' => $this->contents[$products_id]['discount_categories_id'],
// EOF QPBPP for SPPC
			    'price' => $products_price,
			    'quantity' => $this->contents[$products_id]['qty'],
			    'weight' => $products['products_weight'],
//upsxml dimensions start
                                   'length' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_length']),
         			    'width' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_width']),
         			    'height' => ($products['product_free_shipping'] == '1' ? 0 : $products['products_height']),
                                   'ready_to_ship' => $products['products_ready_to_ship'],
//uspxml dimensions end
			    'final_price' => ($products_price + $this->attributes_price($products_id)),
			    'tax_class_id' => $products['products_tax_class_id'],
			    'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),
			    'vendors_id' => $products['vendors_id'],
			    'vendors_id' => $vendors['vendors_id'],
		            'vendors_name' => $vendors['vendors_name']
			   );
       }
     }

     return $products_array;
   }

 

Jim if anything looks amiss please correct.

-Dave

Link to comment
Share on other sites

				    'vendors_id' => $products['vendors_id'],
			    'vendors_id' => $vendors['vendors_id'],

The first line there is not needed and could cause problems. The use of TABLE_PRODUCTS_DESCRIPTION in the query is also not necessary. It won't break anything, but it will slow the page down slightly. The query I posted is the minimum needed.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

ok - got that sorted.

 

One last detail... when clicking the line item PackingSlip link that goes to vendors_packingslip.php, the Qty, Product, and Model are not appearing. The osc packingslip is ok.

 

Otherwise all seem good. Thank you again.

-Dave

Link to comment
Share on other sites

Ok trying to sort out the vendor_packinglist and why the qty product model details are not being shown

 

in admin/orders.php

// MVS start
   //   echo '<br> the $order->orders_shipping_id : ' . $order->orders_shipping_id;
   if (tep_not_null($order->orders_shipping_id)) {
     require_once ('vendor_order_info.php');
   } else { 
// MVS end

 

which sends me to /vendor_order_info.php

placing at the top

 

print '<pre>';
print_r ($order->products);
print '</pre>';

 

Output

Array
(
   [0] => Array
       (
           [Vid] => 1
           [Vname] => My Store
           [Vmodule] => item
           [Vmethod] => Best Way
           [Vcost] => 3.5000
           [Vship_tax] => 0.0000
           [Vorder_sent] => no
           [Vnoname] => Shipper
           [spacer] => -
           [orders_products] => Array
               (
                   [0] => Array
                       (
                           [qty] => 1
                           [name] => Speed 2: Cruise Control
                           [tax] => 0.0000
                           [model] => DVD-SPEED2
                           [price] => 42.0000
                           [vendor_name] => 
                           [vendor_ship] => 
                           [shipping_method] => 
                           [shipping_cost] => 
                           [final_price] => 42.0000
                           [spacer] => -
                       )

               )

       )

)

 

Within vendor_order_info is the link to the vendor_packingslip

 

    echo '          <tr class="dataTableRow">' . "\n" .
        '            <td class="dataTableContent" valign="top">' . $order->products[$l]['Vname'] . '<br>' . $ship_data_text . '<br><a href="' . tep_href_link('vendor_packingslip.php', 'oID=' . $oID . '&vID=' . $order->products[$l]['Vid'] . '&text=' . $ship_data_text) . '">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a></td>' . "\n";

 

the link shows as

http://www.xxx/admin/vendor_packingslip.php?oID=33&vID=1&text=Shipment Number 1 of 1

 

looking to the /admin/vendors_packingslip.php there is this code

  $package_num = sizeof ($order->products);
 $box_num = $l +1;
 for ($i = 0, $n = sizeof ($packslip_products); $i < $n; $i++) {
   echo '      <tr class="dataTableRow">' . "\n" .
        '        <td class="dataTableContent" valign="top" align="left">' . $packslip_products[$i]['qty'] . ' x  ' . $packslip_products[$i]['name'];
   if (isset ($packslip_products[$i]['packslip_attributes']) && (sizeof($packslip_products[$i]['packslip_attributes']) > 0)) {
     for ($j = 0, $k = sizeof($packslip_products[$i]['packslip_attributes']); $j < $k; $j++) {
       echo '<br><nobr><small> <i> - ' . $packslip_products[$i]['packslip_attributes'][$j]['option'] . ': ' . $packslip_products[$i]['packslip_attributes'][$j]['value'];
       echo '</i></small></nobr>';
     }
   }
   echo '</td>' . 
        '        <td class="dataTableContent" valign="top" align="left">' . $packslip_products[$i]['spacer'] . '</td>' . "\n" .
        '        <td class="dataTableContent" valign="top">' . $packslip_products[$i]['spacer'] . '</td>' . "\n" .
        '        <td class="dataTableContent" valign="top">' . $packslip_products[$i]['model'] . '</td>' . "\n" .
        '      </tr>' . "\n";
 }

 

Where do I go from here? Im lost. Another priceformatter class side effect?

 

Thank you for the help.

-Dave

Link to comment
Share on other sites

Probably another error in vendors_packingslip.php. The link passes the Order ID (oID) and the file retrieves the rest of the data. I would start with the database query. If that's been removed, you will need to put back the vendor part, like I showed previously.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Our admin/vendor_packingslip.php files are identical.

 

Before we made the fix to includes/classes/shopping_cart.php, the items were showing up in vendors_packingslip, although all items were showing and not just that vendors specific items (expected, with vID missing). after the fix, no items appear.

 

The queries in admin/vendor_packingslip.php

 

above HEAD

  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $oID . "'");

 

and within BODY

<?php

 $index = 0;
 $order_packslip_query = tep_db_query("select vendors_id, orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $oID . "' and vendors_id = '" . $vID . "'");
 while ($order_packslip_data = tep_db_fetch_array($order_packslip_query)) {
   $packslip_products[$index] = array (
     'qty' => $order_packslip_data['products_quantity'],
     'name' => $order_packslip_data['products_name'],
     'model' => $order_packslip_data['products_model'],
     'tax' => $order_packslip_data['products_tax'],
     'price' => $order_packslip_data['products_price'],
     'final_price' => $order_packslip_data['final_price']
   );

   $subindex = 0;
   $packslip_attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $oID . "' and orders_products_id = '" . (int) $order_packslip_data['orders_products_id'] . "'");
   if (tep_db_num_rows($packslip_attributes_query)) {
     while ($packslip_attributes = tep_db_fetch_array($packslip_attributes_query)) {
       $packslip_products[$index]['packslip_attributes'][$subindex] = array (
         'option' => $packslip_attributes['products_options'],
         'value' => $packslip_attributes['products_options_values'],
         'prefix' => $packslip_attributes['price_prefix'],
         'price' => $packslip_attributes['options_values_price']
       );

       $subindex++;
     }
   }
   $index++;
 }
?>

 

Where would a $vendors_query go? if that is what you are referring to

-Dave

Link to comment
Share on other sites

Oops, my mistake. I should have taken a closer look at this. It appears that it is also getting vID through the URL, and that is not being set. The first query is also never being used, and would be useless in any case. So, in admin/vendor_packingslip.php, find this code:

 

 $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
 $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $oID . "'");

and change it to this:

 

 $oID = (int) $_GET['oID'];
 $vID = (int) $_GET['vID'];

Let me know if that helps.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

While your at it... another tiny bug in admin/vendor_packingslip.php

 

I believe your line 147 is unnescessary and causes a column offset issue. in IE at least, havent tried others. please confirm, or correct me.

 

Thanks!

-Dave

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...