After a lengthy hiatus I've come back to this problem.
I've made the following changes to the code (1.3.5): (Link to the edited version, if you don't know how or care to apply the diff: here)
Code:
155,162c155,173
< $orders_products_query = "select orders_products_id, products_id, products_name,
< products_model, products_price, products_tax,
< products_quantity, final_price,
< onetime_charges,
< products_priced_by_attribute, product_is_free, products_discount_type,
< products_discount_type_from
< from " . TABLE_ORDERS_PRODUCTS . "
< where orders_id = '" . (int)$order_id . "'";
---
>
> $orders_products_query = "select " . TABLE_ORDERS_PRODUCTS . ".orders_products_id as orders_products_id, "
> . TABLE_ORDERS_PRODUCTS . ".products_id as products_id, "
> . TABLE_ORDERS_PRODUCTS . ".products_name as products_name, "
> . TABLE_ORDERS_PRODUCTS . ".products_model as products_model, "
> . TABLE_ORDERS_PRODUCTS . ".products_price as products_price, "
> . TABLE_ORDERS_PRODUCTS . ".products_tax as products_tax, "
> . TABLE_ORDERS_PRODUCTS . ".products_quantity as products_quantity, "
> . TABLE_ORDERS_PRODUCTS . ".final_price as final_price, "
> . TABLE_ORDERS_PRODUCTS . ".onetime_charges as onetime_charges, "
> . TABLE_ORDERS_PRODUCTS . ".products_priced_by_attribute as products_priced_by_attribute, "
> . TABLE_ORDERS_PRODUCTS . ".product_is_free as product_is_free, "
> . TABLE_ORDERS_PRODUCTS . ".products_discount_type as products_discount_type, "
> . TABLE_ORDERS_PRODUCTS . ".products_discount_type_from as products_discount_type_from, "
> . TABLE_PRODUCTS . ".master_categories_id as master_categories_id "
> . " from " . TABLE_ORDERS_PRODUCTS .
> " left join " . TABLE_PRODUCTS .
> " on " . TABLE_ORDERS_PRODUCTS. ".products_id = " . TABLE_PRODUCTS . ".products_id "
> . TABLE_ORDERS_PRODUCTS . "where orders_id = '" . (int)$order_id . "'";
199c210,211
< 'products_discount_type_from' => $orders_products->fields['products_discount_type_from']);
---
> 'products_discount_type_from' => $orders_products->fields['products_discount_type_from'],
> 'master_categories_id' => $orders_products->fields['master_categories_id']);
433a446
> 'master_categories_id' => $products[$i]['master_categories_id'],
727a741
> 'master_categories_id' => $this->products[$i]['master_categories_id'],
981c995
< ?>
\ No newline at end of file
---
> ?>
I went ahead and did a print_r on the object when it's passed to the shipping estimator, and I got this:
Code:
order Object
(
[observers] => Array
(
)
[info] => Array
(
[order_status] => 1
[currency] => USD
[currency_value] => 1.00000000
[payment_method] =>
[payment_module_code] =>
[coupon_code] =>
[shipping_method] =>
[shipping_module_code] =>
[shipping_cost] =>
[subtotal] => 39.97
[tax] => 0
[total] => 39.97
[tax_groups] => Array
(
[Sales Tax] => 0
)
[comments] =>
[ip_address] => 255.255.255.255
)
[totals] => Array
(
)
[products] => Array
(
[0] => Array
(
[qty] => 1
[name] => Jon Amraphel At Early Morning Practice Print
[model] =>
[tax] => 0
[tax_description] => Sales Tax
[price] => 10.0000
[final_price] => 10
[onetime_charges] => 0
[weight] => 0.5
[products_priced_by_attribute] => 0
[product_is_free] => 0
[products_discount_type] => 0
[products_discount_type_from] => 0
[master_categories_id] =>
[id] => 19
[rowClass] => rowEven
)
[1] => Array
(
[qty] => 2
[name] => Exploitation Now, Volume Two
[model] =>
[tax] => 0
[tax_description] => Sales Tax
[price] => 9.9900
[final_price] => 9.99
[onetime_charges] => 0
[weight] => 0.382
[products_priced_by_attribute] => 0
[product_is_free] => 0
[products_discount_type] => 0
[products_discount_type_from] => 0
[master_categories_id] =>
[id] => 57
[rowClass] => rowOdd
)
[2] => Array
(
[qty] => 1
[name] => Errant Story, Volume Two
[model] =>
[tax] => 0
[tax_description] => Sales Tax
[price] => 9.9900
[final_price] => 9.99
[onetime_charges] => 0
[weight] => 0.5625
[products_priced_by_attribute] => 0
[product_is_free] => 0
[products_discount_type] => 0
[products_discount_type_from] => 0
[master_categories_id] =>
[id] => 4
[rowClass] => rowEven
)
)
[customer] => Array
(
[firstname] => Michael
[lastname] => Reilly
[company] =>
[street_address] => 143 Scottwood Dr
[suburb] =>
[city] => Ft. Walton Beach
[postcode] => 32548
[state] => Florida
[zone_id] => 18
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[format_id] => 2
[telephone] => 850-555-5555
[email_address] => OmnipotentEntity######################
)
[delivery] => Array
(
[firstname] => Michael
[lastname] => Reilly
[company] =>
[street_address] => 123 Anonymous Way
[suburb] =>
[city] => The Burbs
[postcode] => 12321
[state] => Florida
[zone_id] => 18
[country] => Array
(
[id] => 223
[title] => United States
[iso_code_2] => US
[iso_code_3] => USA
)
[country_id] => 223
[format_id] => 2
)
[content_type] => physical
[email_low_stock] =>
[products_ordered_attributes] =>
[products_ordered] =>
[products_ordered_email] =>
[billing] => Array
(
[firstname] =>
[lastname] =>
[company] =>
[street_address] =>
[suburb] =>
[city] =>
[postcode] =>
[state] =>
[zone_id] =>
[country] => Array
(
[id] =>
[title] =>
[iso_code_2] =>
[iso_code_3] =>
)
[country_id] =>
[format_id] =>
)
)
The one I added (master_categories_id) is coming up null, and I don't believe it's the query, I think I missed something I have to edit or something. Any ideas?