Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

VQmod не изменяет файл catalog/view/javascript/common.js


Sappheiros
 Share

Recommended Posts

Добрый гдень. Решил написать для себя xml файл со своими правками по движку,  но столкнулся с тем что vqmod не хочет изменять файл catalog/view/javascript/common.js или я что то гделаю не правильно. В журнно ошипотому чток vqmod manager ничего нет. Не рилииет налиная с "// Добавляем всплывающую подсказку poshytips.".

Да же возникло несколько вопросов по xml:

1) как правильно комментировать? можно ли использовать "//" или это не правильно? но по крайне мере врогде рилииет...

2) возможно ли как то прописывать что бы искать код не обращая на отступы? Поскольку порой очень не удобно придумывать обходные пути в духе, найти строчку 1, удалить после неё ещё 4и вместо всего это добавить свою... (это я про position="replace" offset="4", если конечно правильно понял для чего это)

например имеем

	$('.success img, .warning img, .attention img, .information img').live('click', function() {
		$(this).parent().fadeOut('slow', function() {
			$(this).remove();
		});
	});	

а пишем просто:

$('.success img, .warning img, .attention img, .information img').live('click', function() {
$(this).parent().fadeOut('slow', function() {
$(this).remove();
});
});	

Собственно сам XML:

<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<id><![CDATA[<span style="color: #66AB3C; font-weight: bold; font-size: 18px;">Мои изменения CMS</span>]]></id>
	<version><![CDATA[<span style="text-align: center;"><b>v1.0.0</b><br /><br /><b>ocStore</b><br />(1.5.5.1.2)</span>]]></version>
	<author><![CDATA[<span style="text-align: center;">Maxim Anishchenko aka Sappheiros<br />(<a href="mailto:[email protected]">[email protected]</a></span>)]]></author>
	<vqmver></vqmver>
	
// Добавить "нет изображения" в модуле "Последние" (последние поступления).
	
	<file name="catalog/controller/module/latest.php">
		<operation error="log">
			<search position="after"><![CDATA['thumb'   	 => $image,]]></search>
			<add><![CDATA[				'no_image'   => $this->model_tool_image->resize('no_image.jpg', $setting['image_width'], $setting['image_height']),]]></add>
		</operation>
	</file>
	
	<file name="catalog/view/theme/*/template/module/latest.tpl">
		<operation error="log">
			<search position="after"><![CDATA[<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>]]></search>
			<add><![CDATA[							<?php } else { ?>
								<div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['no_image']; ?>" alt="<?php echo $product['name']; ?>" /></a></div>]]></add>
		</operation>
	</file>

// Изменяем языковые файлы.	
	
	<file name="catalog/language/russian/russian.php">
		<operation error="log">
			<search position="replace"><![CDATA[$_['text_none']             = ' --- Не выбрано --- ';]]></search>
			<add><![CDATA[$_['text_none']             = ' - Не выбрано - ';]]></add>
		</operation>
	</file>
	
	<file name="catalog/language/russian/russian.php">
		<operation error="log">
			<search position="replace"><![CDATA[$_['text_select']           = ' --- Выберите --- ';]]></search>
			<add><![CDATA[$_['text_select']           = ' - Выберите - ';]]></add>
		</operation>
	</file>	

	<file name="catalog/language/russian/common/footer.php">
		<operation error="log">
			<search position="replace"><![CDATA[$_['text_voucher']      = 'Подарочные сертификаты';]]></search>
			<add><![CDATA[$_['text_voucher']      = 'Сертификаты';]]></add>
		</operation>
	</file>
	
	<file name="catalog/language/russian/common/footer.php">
		<operation error="log">
			<search position="replace"><![CDATA[$_['text_affiliate']    = 'Партнёрская программа';]]></search>
			<add><![CDATA[$_['text_affiliate']    = 'Партнёрка';]]></add>
		</operation>
	</file>	

// Добавляем всплывающую подсказку poshytips.

	<file name="catalog/view/javascript/common.js">
		<operation error="log">
			<search position="replace" offset="4"><![CDATA[$('.success img, .warning img, .attention img, .information img').live('click', function() {]]></search>
			<add><![CDATA[
	$('.poshytips').poshytip({
		className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'center',
		offsetY: 5,
		allowTipHover: false
	});
	
	$('.poshytips-bottom').poshytip({
		className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'center',
		alignY:	'bottom',
		offsetX: 5,
		allowTipHover: false
	});
	
	$('.poshytips-left').poshytip({
		className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'left',
		alignY:	'center',
		offsetX: 5,
		allowTipHover: false
	});
	
	$('.poshytips-right').poshytip({
		className: 'tip-twitter',
		showTimeout: 1,
		alignTo: 'target',
		alignX: 'right',
		alignY:	'center',
		offsetX: 5,
		allowTipHover: false
	});]]></add>
		</operation>
	</file>
	
</modification>
Link to comment
Share on other sites


Vqmod рилииет исклюлительно с php файлами. 

$replacesPath = self::path(self::$pathReplaces);
$replaces = array();
if($replacesPath) {
include_once($replacesPath);



Использование его для правки .js и .css  абсурдно.

Link to comment
Share on other sites


Да, врогде, js тоже правит. 

Внесите руками изменения, в чем проблема?

Проблем ни каких, это скорее просто изучение данного вопроса. Плюс было интересно возможно ли используя vqmod внести изменения в движок в 1 клик.

Link to comment
Share on other sites


Vqmod рилииет исклюлительно с php файлами. 

$replacesPath = self::path(self::$pathReplaces);
$replaces = array();
if($replacesPath) {
include_once($replacesPath);

Использование его для правки .js и .css  абсурдно.

 

Ясно, спасипотому что за объяснения. Использование его для правки css и js мне в принципе не нужно, просто было интересно, возможно или нет.

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.