Post by magzen » Sun Apr 04, 2021 10:04 am

Hi,

I have some code that needs modification to work with OC 3.0.3.7, the code is from OC 2.0.3.2

Its for use with SEO Mega Kit, since i use multistore this code is meant to add the store name in the end of every category or product, i tried to install the code on ocmod as is but it didnt work.

Would appreciate if someone can update the code to work on OC 3.0.3.7

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
	<name>Store names in title (multistore)</name>
	<code>seo_store_name</code>
	<version>1.1.0</version>
	<author>XXX</author>
	<link>https://www.domain.com</link>
	<!-- CATALOG -->
	<file name="catalog/controller/common/header.php">
		<operation>
			<search position="after"><![CDATA[$data['title'] = $this->document->getTitle();]]></search>
			<add><![CDATA[		
			$route = (!isset($this->request->get['route']) || $this->request->get['route'] == 'common/home') ? false : $this->request->get['route'];
			if($route) {
				$data['title'] .= ' | ' . $this->config->get('config_name');
			}
			]]></add>
		</operation>
	</file>    
</modification>

Active Member

Posts

Joined
Tue Jun 05, 2012 7:04 pm

Post by thekrotek » Sun Apr 04, 2021 2:05 pm

Nobody will update it for free. Use Commercial Support section to post a paid job request.

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 OSWorX » Sun Apr 04, 2021 5:37 pm

You have simply to use the correct syntax (see search and add):

Code: Select all

<search><![CDATA[$data['title'] = $this->document->getTitle();]]></search>
<add position="after"><![CDATA[		
	$route = (!isset($this->request->get['route']) || $this->request->get['route'] == 'common/home') ? false : $this->request->get['route'];
	if($route) {
		$data['title'] .= ' | ' . $this->config->get('config_name');
	}
]]></add>

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


User avatar
Guru Member
Online

Posts

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

Post by magzen » Sun Apr 04, 2021 9:31 pm

You have simply to use the correct syntax (see search and add):
Thanks for you reply, i checked through and compared header.php on OC 2.3 and OC 3.0.3.7, the $route section was removed from header.php in OC 3.0.3.7

Active Member

Posts

Joined
Tue Jun 05, 2012 7:04 pm
Who is online

Users browsing this forum: No registered users and 15 guests