Jump to content

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

Errorlog And Fn.common.php Rate Topic   - - - - -

 
  • webus
  • Member
  • Members
  • Join Date: 13-Jul 13
  • 48 posts

Posted 05 April 2015 - 09:10 AM #1

error log size was 5 gb so i deleted. it always gives error like the one below, we dont use site as english. how can we fix it?

[05-Apr-2015 00:09:03] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/functions/fn.common.php on line 4743
[05-Apr-2015 00:09:03] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:03] PHP Notice: Use of undefined constant CART_SECONDARY_CURRENCY - assumed 'CART_SECONDARY_CURRENCY' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:06] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/functions/fn.common.php on line 4743
[05-Apr-2015 00:09:06] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:06] PHP Notice: Use of undefined constant CART_SECONDARY_CURRENCY - assumed 'CART_SECONDARY_CURRENCY' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:07] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/functions/fn.common.php on line 4743
[05-Apr-2015 00:09:07] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:07] PHP Notice: Use of undefined constant CART_SECONDARY_CURRENCY - assumed 'CART_SECONDARY_CURRENCY' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:07] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/functions/fn.common.php on line 4743
[05-Apr-2015 00:09:07] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:07] PHP Notice: Use of undefined constant CART_SECONDARY_CURRENCY - assumed 'CART_SECONDARY_CURRENCY' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:12] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/functions/fn.common.php on line 4743
[05-Apr-2015 00:09:12] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:12] PHP Notice: Use of undefined constant CART_SECONDARY_CURRENCY - assumed 'CART_SECONDARY_CURRENCY' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:13] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/functions/fn.common.php on line 4743
[05-Apr-2015 00:09:13] PHP Notice: Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/xxx/public_html/app/Tygh/Registry.php on line 430
[05-Apr-2015 00:09:13] PHP Notice: Use of undefined constant CART_SECONDARY_CURRENCY - assumed 'CART_SECONDARY_CURRENCY' in /home/xxx/public_html/app/Tygh/Registry.php on line 430

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

Posted 06 April 2015 - 10:45 AM #2

Please contact CS-Cart support team

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    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • webus
  • Member
  • Members
  • Join Date: 13-Jul 13
  • 48 posts

Posted 14 November 2016 - 02:59 PM #3

[14-Nov-2016 18:44:57] PHP Notice:  Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/haciser/public_html/app/functions/fn.common.php on line 4743

[14-Nov-2016 18:44:57] PHP Notice:  Use of undefined constant CART_LANGUAGE - assumed 'CART_LANGUAGE' in /home/haciser/public_html/app/Tygh/Registry.php on line 430

The problem is ongoing. Php files we been using are in the attachment

Attached Files



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

Posted 14 November 2016 - 05:52 PM #4

Some 3rd party add-on is trying to use the registry during its initialization. Addons are initialized before languages and the registry will attempt to initialize on first reference.

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.


 
  • natewallis
  • Senior Member
  • Members
  • Join Date: 11-Jan 13
  • 199 posts

Posted 13 November 2019 - 02:46 AM #5

Hi, 

 

I am also getting this occuring when making calls during 'get_route' hook. 

 

I have written a simple addon that will detect the presence of 'autocheckout' in URI and try to add product to cart and redirect to checkout.checkout. 

 

It works, but I get a heap of debug messages around CART_LANGUAGE in the php logs.  It seems that `fn_add_product_to_cart` is the culprit.   Any suggestions?  

<?php

use Tygh\Registry;

function fn_bfa_autocheckout_get_route(&$req, &$result, $area, &$is_allowed_url){

  if (($area == 'C') && !$is_allowed_url) {

    if (preg_match('!^()\/autocheckout\/(.*)\.html$!', fn_get_request_uri($_SERVER['REQUEST_URI']), $matches)){ 

      $product_id = db_get_field("SELECT object_id FROM ?:seo_names where name=?s AND company_id=?i", $matches[2], Registry::get('runtime.company_id')); 

      if ($product_id){

        fn_clear_cart(Tygh::$app['session']['cart']);
        $cart = &Tygh::$app['session']['cart'];

        $product_data = [$product_id => ['amount' => 1]];
        if (fn_add_product_to_cart($product_data, $cart, $_SESSION['auth'])){
          fn_save_cart_content($cart, $_SESSION['auth']['user_id']);
          fn_redirect('checkout.checkout');
        }else{
          fn_redirect('index.index');
        }

      }else{
        fn_redirect('index.index');
      }

    }else{
      fn_redirect('index.index');
    }
  }

}



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

Posted 13 November 2019 - 10:17 PM #6

You might try to set $product_data to fn_get_product_data($product_id, $auth); and then set the amount before calling fn_add_product_to_cart().

 

If CART_LANGUAGE is not defined, then you're getting here from 'init' and not from the dispatch.  Rather than use this hook, you might want to consider putthing this in a frontend/checkout.pre.php file instead.


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.