Post by leew87 » Tue Jan 17, 2012 8:07 pm

hi

i wonder if anyone can help me i am trying to write my 1st vqmod to add meta keywords field to the admin side of opencart.

i am trying to make the following changes to my opencart store running 1.5.1.2 found in http://www.guru.net.nz/blog/2011/11/met ... ncart.html

but when i upload my xml file to the /vqmod/xmland reload my ste my site does not load and i get a white page i have checked for the vqmod.og file to show me where the errors aare but this is empty.

Code: Select all

<modification>

	<id>metakeywords 2 admin</id>
	<version>1.0</version>
	<vqmver>2.0</vqmver>
	
	<file name="admin/controller/setting/setting.php">
		<operation>
			<search position="after"><![CDATA[
			$this->data['entry_meta_description'] = $this->language->get('entry_meta_description');
			]]></search>
			<add><![CDATA[
			$this->data['entry_meta_keywords'] = $this->language->get('entry_meta_keywords');
			]]></add>
		</operation>
	</file>
	
	<file name="admin/controller/setting/setting.php">
		<operation>
			<search position="after"><![CDATA[
			config_meta_description 
			]]></search>
			<add><![CDATA[
			if (isset($this->request->post['config_meta_keywords'])) {
	$this->data['config_meta_keywords'] = $this->request->post['config_meta_keywords'];
} else {
	$this->data['config_meta_keywords'] = $this->config->get('config_meta_keywords');
}
			]]></add>
		</operation>
	</file>
	
	<file name="admin/language/english/setting/setting.php">
		<operation>
			<search position="after"><![CDATA[
			entry_meta_description
			]]></search>
			<add><![CDATA[
			<tr>
  <td><?php echo $entry_meta_keywords; ?></td>
  <td><input type="text" name="config_meta_keywords" value="<?php echo $config_meta_keywords; ?>" />
    <?php if ($error_entry_meta_keywords) { ?>
    <span class="error"><?php echo $error_entry_meta_keywords; ?></span>
    <?php } ?></td>
</tr>
			]]></add>
		</operation>
	</file>
	
	<file name="admin/view/template/setting/setting.tpl">
		<operation>
			<search position="after"><![CDATA[
			config_meta_description </tr>
			]]></search>
			<add><![CDATA[
			$_['entry_meta_keywords']     = 'Meta Tag Keywords:';
			]]></add>
		</operation>
	</file>
	
	<file name="catalog/controller/common/home.php">
		<operation>
			<search position="after"><![CDATA[
			config_meta_description
			]]></search>
			<add><![CDATA[
			$this->document->keywords = $this->config->get('config_meta_keywords');
			]]></add>
		</operation>
	</file>
	
</modification>
any advise on where i am going wrong and how i can get this working would be a great help please PM me or reply to this message for any more information you require.

thanks in advance

New member

Posts

Joined
Sat Jun 25, 2011 9:27 pm

Post by philbydevil » Thu Jan 19, 2012 6:00 am

I think that your modification of catalog/controller/common/home.php is wrong (haven't looked too closely at the rest of the code).

Here's my vqmod of the same thing. I used to run it on 1.4.9.3 and have just updated it for 1.5.1.3 (tested and working).

1.5.1.3 version

Now updated for 1.5.4.1

1.5.4.1 version

Last edited by philbydevil on Thu Aug 23, 2012 7:54 am, edited 1 time in total.

I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am
Location - Sunshine Coast, Australia

Post by leew87 » Thu Jan 19, 2012 6:23 am

thanks so much i will compare the to mods to see where i have gone wrong and learn from your working code.

as this is my 1st vqmod that i have tried working hopefully i have more luck getting it right next time.

as they say if you don't succeed at first try try try again.

my next challenges are

1) to add my 2 social media buttons i have hard coding into the header file using Vqmod so hard coding is not needed
2) moving the cart and search bar i have on my site to new location using vqmod from the original location in template.

This will make it sooooo much easier when upgrading or installing bug fixes to my template i use have customised.

Thanks again

New member

Posts

Joined
Sat Jun 25, 2011 9:27 pm

Post by philbydevil » Thu Jan 19, 2012 6:27 am

When you do the "search position" (ie. <search position="after"><![CDATA[ )in your vQmod, be sure to include the entire line of code. Some of the searches in your post look like they are only a part of the line of code.

I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am
Location - Sunshine Coast, Australia

Post by leew87 » Thu Jan 19, 2012 6:33 am

Code: Select all

<modification>

	<id>Custom Template Edits</id>
	<version>2.0.0</version>
	<vqmver>2.1.5</vqmver>
	<author>ILL IT Solutions</author>

	<file name="/catalog/view/theme/ModernStore/template/common/header.tpl">
        <operation>
            <search position="after"><![CDATA[
            <div id="header_top">
            ]]></search>
            <add><![CDATA[
            <div><a href="http://twitter.com/#!/illitsolutions"><img src="image/data/siteparts/twitter_button.png" alt="Twitter" width="118" height="59" /></a></div>
	<div><a href="http://www.facebook.com/ILLITSolutions"><img src="image/data/siteparts/facebook_button.png" alt="Facebook" width="118" height="59" /></a></div>
            ]]></add>
        </operation>


</modification>
this is what i have as in my current header.tpl file if i add that coding after the search it will give me what is hard coded but when i run it doesnt seem to do anything but i do get the follow error now Caught exception: DOMDocument::load() [<a href='domdocument.load'>domdocument.load</a>]: Opening and ending tag mismatch: file line 8 and modification in /home/illit/public_html/vqmod/xml/vqmod_Custom_Template Edits.xml, line: 20 in the vqmod.log file.

i really cant understand what i am doing wrong

New member

Posts

Joined
Sat Jun 25, 2011 9:27 pm

Post by leew87 » Fri Jan 20, 2012 6:44 pm

i have now found out the problem i was missing the closing tag for the file part of the XML so i added </file> before the
</modification> in the XML and all now works fine.

just a quick question do you know if it is possiable to edit css files using vqmod

New member

Posts

Joined
Sat Jun 25, 2011 9:27 pm

Post by philbydevil » Sat Jan 21, 2012 7:17 am

just a quick question do you know if it is possiable to edit css files using vqmod
I haven't tried it myself but I don't see why it wouldn't work.

I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am
Location - Sunshine Coast, Australia

Post by leew87 » Sat Jan 21, 2012 6:39 pm

do you know if or how is possiable to get the xml script just to add coding at the end of the file without adding before or after or even replacing

as if this is possiable i could use this so any Css changes i add using Vqmod would just go at the end of the main template css this would allow me to upgrade all files on the templates and not worry if they are over written as vqmod does not get over written each time.

i have found you can you a comand called bottom but can not find a script where is this used so i can see the correct syntax for it.

onces again i thank you for all your assistance

New member

Posts

Joined
Sat Jun 25, 2011 9:27 pm

Post by philbydevil » Sun Jan 22, 2012 5:31 am

Try something like this:

Code: Select all

	<file name="catalog/view/theme/YOURTHEME/stylesheet/stylesheet.css">
        <operation>
            <search position="bottom"><![CDATA[
            You don't need any code here as it will be ignored
            ]]></search>
            <add><![CDATA[
            INSERT YOUR NEW CODE HERE
            ]]></add>
        </operation>
	</file>

I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am
Location - Sunshine Coast, Australia

Post by SVN » Mon Feb 06, 2012 8:08 pm

Hi,

is there a possibility that this vQmod works on 1.4.9.6 ?

thx !

User avatar
SVN
Active Member

Posts

Joined
Mon Jan 03, 2011 11:59 pm

Post by philbydevil » Tue Feb 07, 2012 10:04 am

There's a 1.4 version in vQmods that should

I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am
Location - Sunshine Coast, Australia

Post by Mr Hot Pants » Fri Sep 07, 2012 7:04 pm

Philbydevil

Thank you so much for this vQmod - it works perfectly in 1.5.4.1 and it's really easy to use.

Thanks again

Newbie

Posts

Joined
Sun Jul 29, 2012 1:31 am

Post by sataan2006 » Thu Oct 11, 2012 1:02 pm

philbydevil wrote:I think that your modification of catalog/controller/common/home.php is wrong (haven't looked too closely at the rest of the code).

Here's my vqmod of the same thing. I used to run it on 1.4.9.3 and have just updated it for 1.5.1.3 (tested and working).
1513-vqmod_catalog_meta_keywords_for_home_page.xml
Now updated for 1.5.4.1
1541-vqmod-catalog-meta-keywords-for-home-page.xml
Thank you from thailand. I use your keyword VQMOD and work for 1.5.2.1

really thank you

Tan

ImageFashion Jewelry HandmadeImageShipping Thailand


User avatar
Newbie

Posts

Joined
Wed Jul 11, 2012 7:15 pm
Location - Thailand

Post by tomatito » Tue Feb 26, 2013 8:46 am

Thanks :) Works perfect with Opencart 1.5.4.1.

Active Member

Posts

Joined
Sat Oct 13, 2012 4:15 am

Post by stokeyblokey » Fri Feb 21, 2014 12:02 am

Also the 1.5.4.1 version works perfectly with 1.5.6 - thanks philbydevil, you just saved me writing this myself! :)

Stokey

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm

Post by nico.bester » Thu Sep 04, 2014 7:42 pm

Thank you this worked great for version 1.5.4.1

I added 2 images to show what it looks like under the settings menu and the Keyword line that is added to the homepage html.

Attachments

Meta Keywords.PNG

Meta Keywords.PNG (130.3 KiB) Viewed 6118 times

Meta Keywords HomePage.PNG

Meta Keywords HomePage.PNG (109.72 KiB) Viewed 6118 times


My opencart website http://www.blossomaccessories.co.za Still work in progress but getting there.


Newbie

Posts

Joined
Thu Sep 04, 2014 7:37 pm

Post by M4ketech » Fri Oct 17, 2014 5:24 pm

Thanks, worked on my store (1.5.6.4), great job!

New member

Posts

Joined
Fri May 02, 2014 3:20 am
Who is online

Users browsing this forum: No registered users and 2 guests