Error: Call to undefined function fn_get_products_companies()

Another one that occurred after the update probably when an order was placed.

PHP 8.2
Standard CSC 4.18.4

 [22-Jun-2025 13:12:27 America/Chicago] Error: Call to undefined function fn_get_products_companies() in /home/user/domains/example.com/public_html/app/addons/paypal_checkout/controllers/frontend/orders.post.php:36
Stack trace:
#0 /home/user/domains/example.com/public_html/app/functions/fn.control.php(728): include()
#1 /home/user/domains/example.com/public_html/app/functions/fn.control.php(459): fn_run_controller()
#2 /home/user/domains/example.com/public_html/index.php(19): fn_dispatch()
#3 {main}

The best I can tell is this error occurs on orders that fail/declined by PayPal.

Thank you for the report. We have confirmed the issue, and it will be addressed in one of our next releases.

1 Like

I have orders coming in but I have a customer that is having trouble with the checkout and I am assuming it something to do with this error because it showed up at the same time the customer had an issue checking out.

I went ahead and commented the offending line but have not heard from the customer yet. Is this okay for a work around?


/*        if (!isset($order_info['companies'])) {
            $order_info['companies'] = fn_get_products_companies($order_info['products']);
        }*/

This same error occurs when:

  1. Create a new order
  2. Select a customer and products
  3. Select PayPal as the payment method
  4. Save the order
  5. Log in as customer and view Order > the new Open Order #
  6. URL is /index.php?dispatch=orders.details&order_id=10100
  7. Service Unavailable page presented.
    The customer cannot complete the order.
    Also, if a different Payment Method is selected for the order, PayPal is not able to be selected. Other methods can be selected, but PayPal button does nothing.
    Under normal conditions, the PayPal button has to be selected TWICE for it to enable PayPal as payment. To work around this, I make PayPal the default selection, so it requires one click to function as it initially loads nothing when the page is completely loaded.
    CS-Cart 4.18.4
    PHP 8.1.33
    Payment methods modules:
    PayPal Complete Payments
    Stripe for CC
    Stripe for ApplePay
    Stripe for GooglePay

Hello!

You can use the following quickfix for this:

Replace this:

        if (!isset($order_info['companies'])) {
            $order_info['companies'] = fn_get_products_companies($order_info['products']);
        }

with this:

        if (fn_allowed_for('MULTIVENDOR')) {
            if (!isset($order_info['companies'])) {
                $order_info['companies'] = fn_get_products_companies($order_info['products']);
            }
        }

In the app/addons/paypal_checkout/controllers/frontend/orders.post.php file.