Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Подключение мобильной версии сайта


LeoGG012
 Share

Recommended Posts

Здравствуйте. Подскажите как на ocstore версии 2.1.0.2.1. Необходимо подключить данную библиотеку https://github.com/serbanghita/Mobile-Detect

В данный момент испытываю трудности, подключаю в index.php

после 

// Configuration
if (is_file('config.php')) {
	require_once('config.php');
}

Такой код

include_once('Mobile_Detect.php');
$detect = new Mobile_Detect();

И после строки

// Affiliate
$registry->set('affiliate', new Affiliate($registry));

Такой код

//Mobile
if( class_exists('Mobile_Detect') )
{
	if( $detect->isMobile() OR $detect->isTablet() )
	{
		$config->set('config_template', 'unishop_mobile');
	}
	elseif( !$detect->isMobile() OR !$detect->isTablet() )
	{
		$config->set('config_template', 'unishop');
	}
}

Сайт функционирует нормально и все работает, но есть одно но. Крон и логи панели присылают такую ошибку постоянно

Fatal error: Call to a member function isMobile() on string in 

То есть и при первом посещении сайта показывается один раз такое уведомление, а потом нормально. Не знаю в чем проблема, помогите решить данное безумие, потому что при оплате клиентом к примеру через Робокассу, оплата проходит, но статус у заказа не изменяется из-за данной ошибки. В чем может быть беда? Знатоки, помогите пожалуйста. Спасибо!

Link to comment
Share on other sites


  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.