Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

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

 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 102 posts

Posted 04 August 2020 - 08:14 AM #1

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?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20934 posts

Posted 04 August 2020 - 01:20 PM #2

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 102 posts

Posted 04 August 2020 - 01:54 PM #3

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.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 04 August 2020 - 04:12 PM #4

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.

 

 


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20934 posts

Posted 05 August 2020 - 05:27 AM #5

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • bebopboy
  • Advanced Member
  • Trial users
  • Join Date: 04-Feb 20
  • 102 posts

Posted 05 August 2020 - 08:59 AM #6

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.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11762 posts

Posted 05 August 2020 - 06:28 PM #7

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.