I've been doing some research to try and help find a solution to these problems.
For the attributes problem, I found this post, which explains the string appended to the product id. http://www.zen-cart.com/forum/showthread.php?t=139912
It is as I suspected, an MD5 hash added to uniquely identify the attribute combination.
I'm not very skilled with PHP, but I was playing around with fedexground.php
Code:
// Get products in cart
$products = $_SESSION['cart']->get_products();
$origins = array();
// loop through each product and make a array for each origin
foreach($products as $product){
// $sql = $db->Execute("SELECT products_weight, products_origin_zip, products_origin_state FROM " . TABLE_PRODUCTS . " WHERE products_id = " . $product['id'] . " LIMIT 1"); //orignal code
$productID = explode(':', $product['id'], 2); //take product id and break it apart at before md5 hash
$sql = $db->Execute("SELECT products_weight, products_origin_zip, products_origin_state FROM " . TABLE_PRODUCTS . " WHERE products_id = " . $productID[0] . " LIMIT 1");
// set values from database for this product
$weight = $sql->fields['products_weight'] * $product['quantity'];
$zip = $sql->fields['products_origin_zip'];
$state = $sql->fields['products_origin_state'];
This got rid of the error, but I don't see anything that takes the attribute weights into account. It looks like you are pulling the weight listed for the product. So with my little hack, I'm completely ignoring any attribute hacks.
But at least now we know for sure what is causing the error.
Bookmarks