Why Is This Line In Tygh/shippings/shippings.php Causing An Error?

Hi, so I recently upgraded my site to the most updated version of CS Cart, I've been running into an error in my checkout where the Shipping methods don't show at all. I've been digging through the code and found that in Tygh/Shippings/Shippings.php in the the function getShippingsList this line

fn_set_hook('shippings_get_shippings_list', $group, $shippings, $condition);

somehow makes the $shippings array empty. $shippings is an array of the shipping ids for that vendor.

I checked $shippings right before and right after that line, and before that there are contents and afterwards the array is empty.

The thing is, the contents of this file is exactly the same as the previous working version of the site I have (I backed up before upgrading). So I don't know what could be causing this to break. It works fine if I comment it out, but I'd like to know why this was happening. Anyone have any ideas?

Do you use any 3rd party addons related with shipping methods?

No, we don't have any 3rd part addons that have to do with shipping. We do have some custom code, but it's all in the checkout controller php file, and I've traced the problem from there to Shippings.php.

I checked the contents of $cart['product_groups'] and saw that the 'shippings' array in that was empty, so I checked the function fn_calculate_cart_content in fn.cart.php because that's what inserts values into $cart['product_groups']. And then from there I saw that the function that actually inserted the contents of 'shippings' was getShippingsList from Shippings.php in Tygh/Shippings. At the very beginning of the process, it breaks things for some reason.

Suggest under SSH your do the following:

# cd app/addons

# grep -R 'fn.*shippings_get_shippings_list' .

This will return you any addons that are using the hook. Someone is obviously affecting the shippings. On my development site it returns:

root@ezms4 [addons]# grep -R  'fn.*shippings_get_shippings_list' .
./mobile_admin_app/func.php: function fn_mobile_admin_app_shippings_get_shippings_list($group, $shippings, &$condition)
./twigmo/func.php: function fn_twigmo_shippings_get_shippings_list($group, $shippings, &$condition)
./payment_dependencies/func.php:function fn_payment_dependencies_shippings_get_shippings_list_conditions(&$group, &$shippings, &$fields, &$join, &$condition, &$order_by)
./payment_dependencies/func.php:function fn_payment_dependencies_shippings_get_shippings_list_post(&$group, &$lang, &$area, &$shippings_info)
./suppliers/func.php:function fn_suppliers_shippings_get_shippings_list(&$group, &$shippings)

All are standard cs-cart addons. Note that I sell electronic products so I don't see shipping issues directly. But if you see any addons outside this list, they would be suspect.

Agree with Tony. Disable mentioned modules one-by-one to find a reason

This is what I get when I run the grep

./payment_dependencies/func.php:function fn_payment_dependencies_shippings_get_shippings_list_conditions(&$group, &$shippings, &$fields, &$join, &$condition, &$order_by)
./payment_dependencies/func.php:function fn_payment_dependencies_shippings_get_shippings_list_post(&$group, &$lang, &$area, &$shippings_info)
./mobile_admin_app/func.php: function fn_mobile_admin_app_shippings_get_shippings_list($group, $shippings, &$condition)
./suppliers/func.php:function fn_suppliers_shippings_get_shippings_list(&$group, &$shippings)

It's pretty much the same as yours except without the twigmo.

Given those are all standard distributed addons, I'm guessing either you've had a developer make modifications to one of them or you've had some kind of upgrade failure. What does your Administration/Files Change detector show? If nothing, then you should either do as Ecom suggested and disable them one by one or submit to helpdesk since they are all cs-cart modules.