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

Uncaught SyntaxError: Invalid or unexpected token


Recommended Posts

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

после установки перестала работать кнопка "Добавить баннер"

консоль выдает такую ошибку

https://hkar.ru/11g7b

Uncaught SyntaxError: Invalid or unexpected token
index.php?route=design/banner/edit&token=BH1HQl8wDHB5NVxRhaIpyz8BtVRhjGZg&banner_id=6:461 Uncaught ReferenceError: addImage is not defined
    at HTMLButtonElement.onclick (index.php?route=design/banner/edit&token=BH1HQl8wDHB5NVxRhaIpyz8BtVRhjGZg&banner_id=6:461)

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

Спойлер
<?xml version="1.0" encoding="utf-8"?>
<modification>
	<name>Description for banners</name>
	<version>1.0</version>
	<author>Ravilr</author>
	<link>http://myopencart.com</link>
	<code>Description_for_banners_23</code>
	
	<file path="admin/controller/design/banner.php">
		<operation>
			<search><![CDATA[
			$data['button_remove'] = $this->language->get('button_remove');
			]]></search>
			<add position="after"><![CDATA[
			$data['entry_description'] = $this->language->get('entry_description');
			]]></add>
		</operation>
		<operation>
			<search><![CDATA[
			$data['banner_images'][$key][] = array(
			]]></search>
			<add position="after"><![CDATA[
			'description'      => $banner_image['description'],
			]]></add>
		</operation>
	</file>
	
	<file path="admin/model/design/banner.php">
		<operation>
			<search><![CDATA[
			title = '" .  $this->db->escape($banner_image['title']) . "', 
			]]></search>
			<add position="replace"><![CDATA[
			title = '" .  $this->db->escape($banner_image['title']) . "', description = '" .  $this->db->escape($banner_image['description']) . "', 
			]]>
			</add>
		</operation>
		<operation>
			<search><![CDATA[
			'title'      => $banner_image['title'],
			]]></search>
			<add position="after"><![CDATA[
			'description'      => $banner_image['description'],
			]]></add>
		</operation>
	</file>
	
	<file path="admin/language/ru-ru/design/banner.php">
		<operation>
			<search><![CDATA[
			$_['entry_title']       = 'Заголовок';
			]]></search>
			<add position="after"><![CDATA[
			$_['entry_description']       = 'Описание';
			]]></add>
		</operation>
	</file>
	
	<file path="admin/view/template/design/banner_form.tpl">
		<operation>
			<search><![CDATA[
			<td class="text-left"><?php echo $entry_title; ?></td>
			]]></search>
			<add position="after"><![CDATA[
			<td class="text-left"><?php echo $entry_description; ?></td>
			]]></add>
		</operation>
		<operation>
			<search><![CDATA[
			[<?php echo $image_row; ?>][link]
			]]></search>
			<add position="before"><![CDATA[
				<td class="text-left" style="width: 30%;">
				<textarea style="height:300px;" name="banner_image[<?php echo $language['language_id']; ?>][<?php echo $image_row; ?>][description]" placeholder="<?php echo $entry_description; ?>" class="form-control"><?php echo $banner_image['description']; ?></textarea>
				</td>
			]]></add>
		</operation>
		<operation>
			<search><![CDATA[
			[' + image_row + '][title]
			]]></search>
			<add position="after"><![CDATA[
			html += '  <td class="text-left">
			<textarea style="height:300px;" name="banner_image[' + language_id + '][' + image_row + '][description]" value="" placeholder="<?php echo $entry_description; ?>" class="form-control"></textarea>
			</td>';	
			]]></add>
		</operation>
	</file>
	
	<file path="catalog/controller/extension/module/{banner,slideshow}.php">
		<operation>
			<search><![CDATA[
			'title' => $result['title'],
			]]></search>
			<add position="after"><![CDATA[
			'description' => html_entity_decode($result['description']),
			]]></add>
		</operation>
	</file>
	

</modification>

 

 

Edited by qpldl
Link to comment
Share on other sites


20 минут назад, chukcha сказал:

Вы ставите на тройку, то что должно работать на двойке

 

версия 2.3
какая тройка?

Link to comment
Share on other sites


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.