Post by skip » Wed Dec 02, 2015 7:09 am

How to convert this code from VQMOD to OCMOD:

Code: Select all

<file name="/catalog/view/theme/default/template/product/product.tpl">
	   <operation>
            <search position="replace" index="1" offset="2">
            	<![CDATA[<?php if ($review_status) { ?>]]>
            </search>
            <add>
            	<![CDATA[]]>
            </add>
        </operation>       
	</file>
thanx

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by artcore » Wed Dec 02, 2015 3:37 pm


Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by OSWorX » Wed Dec 02, 2015 4:25 pm

Because OCMod count it not as VQMod, instead using

Code: Select all

<search position="replace" index="1" offset="2">
it should read like

Code: Select all

<search position="replace" index="0" offset="2">
The rest should work untouched.

For the filename use instead

Code: Select all

<file name="catalog/view/theme/default/template/product/product.tpl">
this here (name is path)

Code: Select all

<file path="catalog/view/theme/default/template/product/product.tpl">

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Active Member

Posts

Joined
Fri Dec 23, 2011 6:03 pm

Post by OSWorX » Wed Dec 02, 2015 6:47 pm

While this here http://ocextensions.co.uk/ocmod/OCMOD_vQmod_differences is not correct, because the position can be also the same as with VQMod files.
Otherwise none of my extensions would work.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by clorne » Wed Dec 02, 2015 7:20 pm

Maybe, but currently the documentation suggests that "position" goes in the "add" tag - see

https://github.com/opencart/opencart/wi ... ion-System

Active Member

Posts

Joined
Fri Dec 23, 2011 6:03 pm

Post by OSWorX » Wed Dec 02, 2015 10:41 pm

clorne wrote:Maybe, but currently the documentation suggests that "position" goes in the "add" tag - see

https://github.com/opencart/opencart/wi ... ion-System
Sorry, my fault - your are absolutely right (had VQMod in my mind).

But I cannot trust generally this page (while they are the creator of this extension - based on VQMod), because in that 'documentation' there is one very important tag missing:
code
The while line should read like:

Code: Select all

<code>my_unique_id_here</code>
Otherwise you will get an error like:
Modification requires a unique ID code!
And this code must be unique, otherwise you will get following error:
Modification xyz is using the same ID code as the one you are trying to upload!
You see, no documentation would be better than a wrong or half.
Last edited by OSWorX on Thu Dec 03, 2015 3:38 am, edited 1 time in total.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by skip » Thu Dec 03, 2015 1:57 am

Thanx -this works for me:

Code: Select all

<file path="catalog/view/theme/*/template/product/product.tpl">
		<operation>
			<search index="0"><![CDATA[
				<?php if ($review_status) { ?>
			]]></search>
			<add position="replace" offset="2"><![CDATA[
			
			]]></add>
		</operation>
	</file>
One more question: Is there some easy way to debug OCMOD - or I must every time upload and refresh ocmod.xml file through admin. In this case VQMOD is much better option for debuging I think

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by artcore » Thu Dec 03, 2015 2:30 am

You can place your extension.ocmod.xml (has to be .ocmod.xml) in the root of the system folder for easier debugging. You still have to refresh though. Maybe a catalog-side flag to auto execute a modification refresh function would be handy!
Refreshing a page would clear mod cache like with vQmod. :)

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by skip » Thu Dec 03, 2015 2:43 am

artcore wrote: catalog-side flag to auto execute
what does you mean under this ?

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by artcore » Thu Dec 03, 2015 2:53 am

a flag or a switch in PHP that would activate auto refreshing of the cache when refreshing the browser.

Pseudo code example could be triggered from index.php

Code: Select all

<?php if($this->config->get('config_debug') $this->modification->clearCache();
Just an idea, Haven't looked at the parts.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by skip » Thu Dec 03, 2015 3:27 am

Thanx
This work with set up in root of system folder, If somebody got exatcly code for autorestart cache let it post here.

One more question about coding ocmod:
how to set up between 2 div with "BEFORE":

Code: Select all

</div>
 INSERT HERE 
        </div>
        <?php if ($column_left || $column_right) { ?>

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by artcore » Thu Dec 03, 2015 5:25 am

Check the documentation for "index"
Something like <search index="5"><![CDATA[</div>]]>...etc
Where 5 is the instance of the </div> counted from top to bottom.

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: No registered users and 5 guests