Zen Cart Logo
Forums / General Questions / Change cateogory name in the URL with Ultimate SEO

Change cateogory name in the URL with Ultimate SEO

Locked

Views: 1,836

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
22 Aug 2007, 9:46 PM
#1
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Change cateogory name in the URL with Ultimate SEO

Hi
I have ultimate SEO mod installed
Now, I have one of the category url shown as http://mysite.com/tshirt-c-20.html
Would it be possible to make it as t-shirt?
Where can I make this change?

24 Aug 2007, 8:45 PM
#2
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Change cateogory name in the URL with Ultimate SEO

What's the name of the category itself?

24 Aug 2007, 9:55 PM
#3
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Change cateogory name in the URL with Ultimate SEO

Category name is T-shirt

24 Aug 2007, 11:26 PM
#4
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Change cateogory name in the URL with Ultimate SEO

I think I would try the following:

Edit this function (classes/seo.url.php):

	
	function strip($string){
		if ( is_array($this->attributes['SEO_CHAR_CONVERT_SET']) ) $string = strtr($string, $this->attributes['SEO_CHAR_CONVERT_SET']);
		$pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true'
						?	"([^[:alnum:]])+"
						:	"([[:punct:]])+";
		$anchor = ereg_replace($pattern, '', strtolower($string));
		$pattern = "([[:space:]]|[[:blank:]])+"; 
		$anchor = ereg_replace($pattern, '-', $anchor);
		return $this->short_name($anchor); // return the short filtered name 
	} # end function

And add: $string = str_replace('-', ' ', $string);

So it would become:

	function strip($string){
		if ( is_array($this->attributes['SEO_CHAR_CONVERT_SET']) ) $string = strtr($string, $this->attributes['SEO_CHAR_CONVERT_SET']);
		$pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true'
						?	"([^[:alnum:]])+"
						:	"([[:punct:]])+";
		$string = str_replace('-', ' ', $string);				
		$anchor = ereg_replace($pattern, '', strtolower($string));
		$pattern = "([[:space:]]|[[:blank:]])+"; 
		$anchor = ereg_replace($pattern, '-', $anchor);
		return $this->short_name($anchor); // return the short filtered name 
	} # end function

I don't have an install to test, so I may be wrong. But the idea is to change all "-"s to spaces, just before they are replaced by empty strings.
(and 3 lines below the added line all spaces are replaced by "-"s )