Post by nicexe » Sat Aug 25, 2018 11:18 pm

Hello,
I'm having some trouble with my custom vqmod xml and I'm not even sure why it doesn't work.
I'm basically trying to replace a line in a tpl file with a different line.
This is my mod:

Code: Select all

<modification>
	<id><![CDATA[header mod]]></id>
	<version><![CDATA[1.0]]></version>
	<vqmver><![CDATA[2.3.0]]></vqmver>
	<author><![CDATA[nicexe]]></author>
	<file name="catalog/view/theme/basel/template/common/headers/header2.tpl">
		<operation>
			<search position="replace" error="log"><![CDATA[        <div class="dropdown-wrapper-click from-top hidden-sx hidden-sm hidden-xs">]]></search>
			<add><![CDATA[        <div class="dropdown-wrapper-click from-top hidden-sx hidden-xs">]]></add>
		</operation>
	</file>
</modification>
I cleared vqmod cache and enabled the mod but when I visit the page I can definitely see that the code isn't replaced.
I checked the logs and I see no error related to my mod or the file it messes with.
I also checked the vqmod cache and the modified file is missing so that tells me that my mod never took place.

What am I doing wrong?

Newbie

Posts

Joined
Sun Feb 19, 2017 12:59 am

Post by straightlight » Sun Aug 26, 2018 12:08 am

<file name="catalog/view/theme/basel/template/common/headers/header2.tpl">
for:
<file path="catalog/view/theme/basel/template/common/headers/header2.tpl">
I would suggest the use of the VQMod Manager from the Marketplace to debug your XML files with VQMod.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by thekrotek » Sun Aug 26, 2018 12:10 am

straightlight wrote:
Sun Aug 26, 2018 12:08 am
<file name="catalog/view/theme/basel/template/common/headers/header2.tpl">
for:
<file path="catalog/view/theme/basel/template/common/headers/header2.tpl">
I would suggest the use of the VQMod Manager from the Marketplace to debug your XML files with VQMod.
No, this is not the issue, because "name" is valid for VQMod, "path" is required by OCMod only, since it doesn't support "name" attribute.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by straightlight » Sun Aug 26, 2018 12:11 am

Right. I may have mixed both on this one. However, I did suggested the use of VQMod Manager to confirm the results.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kestas » Sun Aug 26, 2018 3:32 am

nicexe wrote:
Sat Aug 25, 2018 11:18 pm

<operation>
<search position="replace" error="log">
error="log"
must be in
<operation error="log">
so first you should read how to use vqmod. Next... maybe you have copied wrong line to replace.


Cheers

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by IP_CAM » Sun Aug 26, 2018 4:39 am

AVOID any empty SPACE(s) or TAG(s) in SEARCH Command Content, like shown here,
BEFORE and/or AFTER an ANCHOR/TAG LINE, like, in this case, this one:
<div class="dropdown-wrapper-click from-top hidden-sx hidden-sm hidden-xs">
as shown here:

Code: Select all

<search position="replace"><![CDATA[        <div class="dropdown-wrapper-click from-top hidden-sx hidden-sm hidden-xs">]]></search>
by better doing it like this:

Code: Select all

<search position="replace"><![CDATA[<div class="dropdown-wrapper-click from-top hidden-sx hidden-sm hidden-xs">]]></search>
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by nicexe » Wed Aug 29, 2018 10:58 pm

Thanks people.
I took into account what you replied.
The script now looks a bit like this:

Code: Select all

<modification>
	<id><![CDATA[header mod]]></id>
	<version><![CDATA[1.0]]></version>
	<vqmver><![CDATA[2.6.0]]></vqmver>
	<author><![CDATA[nicexe]]></author>
	<file name="catalog/view/theme/basel/template/common/headers/header2.tpl,catalog/view/theme/basel/template/common/headers/header2.twig">
		<operation>
			<search position="replace" error="log"><![CDATA[<div class="dropdown-wrapper-click from-top hidden-sx hidden-sm hidden-xs">]]></search>
			<add><![CDATA[<div class="dropdown-wrapper-click from-top hidden-sx hidden-xs">]]></add>
		</operation>
	</file>
</modification>
For one reason or another I am still having problems.
I do not see any related entry in the logs so I assume that the file I'm modding is not really the one responsible for what I'm trying to change.
Is there any way to make sure what piece of code is responsible for a piece of html in order to target with a VQMod?

Newbie

Posts

Joined
Sun Feb 19, 2017 12:59 am

Post by kestas » Thu Aug 30, 2018 4:05 am

did you tried
error="log"
move to
<operation error="log">

in your code are:

Code: Select all

<search position="replace" error="log"> 
should be:

Code: Select all

<operation error="log">
<search position="replace">

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by nicexe » Mon Oct 15, 2018 11:29 pm

kestas wrote:
Thu Aug 30, 2018 4:05 am
did you tried
error="log"
move to
<operation error="log">
Thanks. This was what caused the problem.

Newbie

Posts

Joined
Sun Feb 19, 2017 12:59 am
Who is online

Users browsing this forum: No registered users and 69 guests