Jump to content
Sign in to follow this  
lagerz666

Лимит выпадающего списка в админке.

Recommended Posts

Здравствуйте! У меня есть модификатор, но не хочу его устанавливать. Хочу руками поправить все в движке.

Суть такая. Хочу что бы в карточке товара, в характеристика при их добавлении вылезал список не из 5-ти предложенных, а более, например 15.

Вот код модификатора. Кто может его разобраться и расписать мне, что и где нужно изменить? С меня спасибка :rolleyes:

 

<?xml version="1.0" encoding="utf-8"?>
<modification>
  <name>Лимит Автодополнения</name>
  <code>Limit Autocomplete</code>
  <version>3.0</version>
  <author>opencart3x.ru</author>
  <link>https://opencart3x.ru/</link>
  
  <file path="admin/controller/setting/setting.php">
	<operation error="skip">	
	  <search><![CDATA[
		if (isset($this->error['encryption'])) {
	  ]]></search>
	  <add position="before" trim="true"><![CDATA[
		if (isset($this->error['autocomplete_limit'])) {
		  $data['error_autocomplete_limit'] = $this->error['autocomplete_limit'];
		} else {
		  $data['error_autocomplete_limit'] = '';
		}
	  ]]></add>
	</operation>	
	<operation error="skip">	
	  <search><![CDATA[
		if (isset($this->request->post['config_product_count'])) {
	  ]]></search>
	  <add position="before" trim="true"><![CDATA[
		if (isset($this->request->post['config_autocomplete_limit'])) {
		  $data['config_autocomplete_limit'] = $this->request->post['config_autocomplete_limit'];
		} else {
		  $data['config_autocomplete_limit'] = $this->config->get('config_autocomplete_limit');
		}
	  ]]></add>
	</operation>	
	<operation error="skip">	
	  <search><![CDATA[
		if (!$this->request->post['config_limit_admin']) {
	  ]]></search>
	  <add position="before" trim="true"><![CDATA[
		if (!$this->request->post['config_autocomplete_limit']) {
		  $this->error['autocomplete_limit'] = $this->language->get('error_limit');
		}
	  ]]></add>
	</operation>
  </file> 
  <file path="admin/language/ru-ru/setting/setting.php">
	<operation error="skip">
	  <search><![CDATA[
		$_['entry_limit_admin']
	  ]]></search>
	  <add position="before" trim="true"><![CDATA[
		$_['entry_autocomplete_limit']              = 'Лимит в полях Автозаполнения (Admin)';
	  ]]></add>
	</operation>	
	<operation error="skip">
	  <search><![CDATA[
		$_['help_limit_admin']
	  ]]></search>
	  <add position="before"><![CDATA[
		$_['help_autocomplete_limit']  = 'Определяет, сколько элементов отображать при автозаполении (в панели администрирования: товары, категории и т.д).';
	  ]]></add>
	</operation>
  </file>
  <file path="admin/language/en-gb/setting/setting.php">
	<operation error="skip">
	  <search><![CDATA[
		$_['entry_limit_admin']
	  ]]></search>
	  <add position="before"><![CDATA[
		$_['entry_autocomplete_limit']              = 'The limit in the autocomplete field. (Admin)';
	  ]]></add>
	</operation>	
	<operation error="skip">
	  <search><![CDATA[
		$_['help_limit_admin']
	  ]]></search>
	  <add position="before"><![CDATA[
		$_['help_autocomplete_limit']  = 'Determines how many items to display in autocomplete. (in the admin panel: Products, Categories, Clients, etc.).';
	  ]]></add>
	</operation>
  </file>
  <file path="admin/view/template/common/header.twig">
  <operation error="skip">
	  <search><![CDATA[
		<link type="text/css" href="view/stylesheet/stylesheet.css" rel="stylesheet" media="screen" />
	  ]]></search>
	  <add position="after"><![CDATA[
		<link type="text/css" href="view/stylesheet/autocomplete.css" rel="stylesheet" media="screen" />
	  ]]></add>
  </operation>
  </file>
  <file path="admin/view/template/setting/setting.twig">
	<operation error="skip">
	  <search><![CDATA[
		<legend>{{ text_review }}</legend>
	  ]]></search>
	  <add position="before" offset="2"><![CDATA[
		<div class="form-group required">
		  <label class="col-sm-2 control-label" for="input-autocomplete-limit"><span data-toggle="tooltip" title="{{ help_autocomplete_limit }}">{{ entry_autocomplete_limit }}</span></label>
		  <div class="col-sm-10">
			<input type="text" name="config_autocomplete_limit" value="{{ config_autocomplete_limit }}" placeholder="{{ entry_autocomplete_limit }}" id="input-autocomplete-limit" class="form-control" />
			{% if (error_autocomplete_limit) %} 
			  <div class="text-danger">{{ error_autocomplete_limit }}</div>
			{% endif %} 
		  </div>
		</div>
	  ]]></add>
	</operation>
  </file>	
  <file path="admin/controller/*/*.php">
	<operation error="skip">
	  <search><![CDATA[
		'limit'       => 5
	  ]]></search>
	  <add position="replace" trim="true"><![CDATA[
		'limit'        => $this->config->get('config_autocomplete_limit')
	  ]]></add>
	</operation>
	<operation error="skip">
	  <search><![CDATA[
		$limit = 5;
	  ]]></search>
	  <add position="replace" trim="true"><![CDATA[
		$limit = $this->config->get('config_autocomplete_limit');
	  ]]></add>
	</operation>
	<operation error="skip">
	  <search><![CDATA[
		'limit'        => 5
	  ]]></search>
	  <add position="replace" trim="true"><![CDATA[
		'limit'        => $this->config->get('config_autocomplete_limit')
	  ]]></add>
	</operation>
  </file>
</modification>

 

limit-autocomplete_oc3.ocmod.zip

Share this post


Link to post
Share on other sites

del

Edited by Pavel666

Share this post


Link to post
Share on other sites

Пять секунд в гуглах:

 

  • +1 1

Share this post


Link to post
Share on other sites
2 часа назад, lagerz666 сказал:

Вот код модификатора

 

а вот тема про то как отличить помойку от нормального ресурса

 

  • +1 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.