Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo


Recommended Posts

It works on any version as is. The only thing that confuses some people, that I am aware of, is that the instructions say to look for certain code in html_output.php where it really should say to just replace the whole tep_href_link function in that file.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi,

 

I just installed the addon. The instructions worked perfectly and it has been working well for over 1 month now.

 

However, I have noticed that when the categories are click on, it is really slow. The website is not slow because when a single product is clicked, the load speed is quite fast. However, try clicking on a category or a sub-category and it takes along time. I don't recall this was an issue before the addon was installed.

 

The website is http://www.bananababy.com.au

 

Is this an known issue or is there are setting to fix this? I tried turning caches on/off on categories but it did not have any effect.

Link to comment
Share on other sites

The only issue I am aware of is the cache that you mentioned. If you turned all of those off (there's more than one) and it didn't make a difference, then try setting the main setting to off so this addon isn't used at all. If the problem still exists, it is something else.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

It's normal that a wrong manufacturer url doesn't change to the correct url?

 

Example:

www.myweb.com/menufcaturer-m-1.html doesn't redirect to www.myweb.com/manufacturer-m-1.html

 

Thanks in advance!!

Link to comment
Share on other sites

The name in the url should change to the correct name. If you try it with the categories and products, you will see it does but It seems I missed changing the code for the manufacturers.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Just installed this module Ultimate SEO 2-2.2d-13 and I'm getting the following error when uninstalling:

 

Warning: array_merge(): Argument #2 is not an array in \admin\configuration.php on line 88

 

anyone know how to fix this??

 

And on line number 392 of the includes/classes/seo.class.php

 

		 $cfgId_query = "SELECT configuration_group_id as ID FROM `".TABLE_CONFIGURATION_GROUP."` WHERE onfiguration_group_title = 'SEO URLs'";

 

there is a small spelling mistake - the letter 'c' is missing from configuration in WHERE ^^onfiguration_group

 

 

Warning: reset() expects parameter 1 to be array, null given in \admin\includes\classes\object_info.php on line 17
Warning: Variable passed to each() is not an array or object in \admin\includes\classes\object_info.php on line 18

Edited by mommaroodles

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

The uninstall problem would be something in your shop. I can't suggest a fix since I don't know what version of oscommerce you are using. For the mistake in the code, thank you for pointing it out. The code will still work even with that mistake in it but it should be fixed.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The version of oscommerce is 2.3.3.4 and at this point nothing has been added to the admin section, the only mod that has needed anything added to admin is the Ultimate SEO Urls - so I'm reluctant to think that it could be anything else, any other module uninstalls just fine - seeing as the uninstall function of the ultimate seo urls is as old as the hills - perhaps it is time that it is rewritten

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

Categories and products changes correctly :)

Sorry, Categories urls redirect correctly, but products url don't.

 

I look in catalog/includes/classes/seo.class.php and in need_redirect funtion are code for -c- and -p- urls, but in chec_redirect funtion only for -c- urls.

 

I think this will be the code to manufacturers for need_redirect:

 

						    else if (($pStart = strpos($this->uri_parsed['path'], "-m-")) !== FALSE) {
							    if (($pStop = strpos($this->uri_parsed['path'], ".html")) !== FALSE) {
								   $forceRedirect = $this->VerifyLink($pStop, $pStart); //remove things that shouldn't be there

								   if ($this->attributes['USE_SEO_PERFORMANCE_CHECK'] == 'true') $this->performance['NUMBER_QUERIES']++;
								   $mID = substr($this->uri_parsed['path'], $pStart + 3, -(strlen($this->uri_parsed['path']) - $pStop));
								   $sqlCmd = $this->attributes['USE_SEO_HEADER_TAGS'] == 'true' ? 'IF(md.manufacturers_htc_title_tag_url !="", md.manufacturers_htc_title_tag_url, m.manufacturers_name) as mName' : 'm.manufacturers_name as mName';
	    $sql = "SELECT " . $sqlCmd . "
										    FROM " . TABLE_MANUFACTURERS . " m
										    LEFT JOIN " . TABLE_MANUFACTURERS_INFO . " md
										    ON m.manufacturers_id = md.manufacturers_id
										    WHERE manufacturers_id = '" . (int)$mID . "'
										    AND md.languages_id = '" . (int)$this->languages_id . "' LIMIT 1";
								   $result = $this->DB->FetchArray( $this->DB->Query( $sql ) );
								   $mName = '';
								   if ($this->attributes['SEO_ADD_CPATH_TO_PRODUCT_URLS'] == 'true') {
									  $mName = $this->get_all_category_parents($pID, $mName);
									  $mName = str_replace(" ", "-", $mName) . '-';
								   }
								   if ($forceRedirect || ($mName !== substr($this->uri_parsed['path'], 0, $pStart))) {
									 $this->uri_parsed['path'] = $mName . "-m-" . $pID . ".html";
									 $this->need_redirect = true;
									 $this->do_redirect();
								   }
							    }
						    }

 

I don't know how will be the code for chec_redirect funtion :(

Link to comment
Share on other sites

They both redirect for me when I test it. Maybe it is a cache issue on your part. Try using the clear cache option to see if that helps.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Sorry.

 

I tried again, and products and categories redirectes correctly, but manufacturer still don't redirect

 

I used a fresh oscommerce 2.2 install with ultimate seo urls on localhost. products and categories redirect ok, manufacturer don't redirect.

 

Thanks for your support :)

Link to comment
Share on other sites

Adding this code in need_redirect function, makes manufacturer urls change for the correct one

 

						    else if (($pStart = strpos($this->uri_parsed['path'], "-m-")) !== FALSE) {
							    if (($pStop = strpos($this->uri_parsed['path'], ".html")) !== FALSE) {
								   $forceRedirect = $this->VerifyLink($pStop, $pStart); //remove things that shouldn't be there

								   if ($this->attributes['USE_SEO_PERFORMANCE_CHECK'] == 'true') $this->performance['NUMBER_QUERIES']++;
								   $mID = substr($this->uri_parsed['path'], $pStart + 3, -(strlen($this->uri_parsed['path']) - $pStop));
								   $sqlCmd = $this->attributes['USE_SEO_HEADER_TAGS'] == 'true' ? 'IF(md.manufacturers_htc_title_tag_url != "", md.manufacturers_htc_title_tag_url, m.manufacturers_name) as mName' : 'm.manufacturers_name as mName';
	    $sql = "SELECT " . $sqlCmd . "
										    FROM " . TABLE_MANUFACTURERS . " m
										    LEFT JOIN " . TABLE_MANUFACTURERS_INFO . " md
										    ON m.manufacturers_id = md.manufacturers_id
										    WHERE m.manufacturers_id = '" . (int)$mID . "'
										    AND md.languages_id = '" . (int)$this->languages_id . "' LIMIT 1";
								   $result = $this->DB->FetchArray( $this->DB->Query( $sql ) );
								   $mName = $result['mName'];
	    $mName = $this->strip($mName);
								   if ($forceRedirect || ($mName !== substr($this->uri_parsed['path'], 0, $pStart))) {
									 $this->uri_parsed['path'] = $mName . "-m-" . $mID . ".html";
									 $this->need_redirect = true;
									 $this->do_redirect();
								   }
							    }
						    }

Now... I see that Products reviews doesn't redirect :blush:

Link to comment
Share on other sites

  • 3 weeks later...

2.3.3.4 and 2.2d-13

 

I need some advice please.

I recently added the Products Specifications addon, and part of that involves moving product_reviews (-pr-) to a tab interface on product_info.

 

I just noticed yesterday that the back button in product_reviews_info (-pri-) takes me to a broken -pr- link, Where it should (I'm assuming) now take me to products_info, and ideally display the reviews tab ( #tabs-9 or ?tab=9 ).

 

To confuse matters, product_reviews_info is also linked to from several other locations in the site, so a "Back" button here is a challenge.

 

My main question is, should I just change the Back button on -pri- to go directly to the -p- page, from this:

echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('reviews_id'))));

To something like this:

echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $review['products_id']));

 

or should I leave the back button link alone and make the change in /includes/classes/seo.class.php?

 

case ( $page == FILENAME_PRODUCT_REVIEWS ):
// $url = $this->make_url($page, $this->get_product_name($p2[1]), 'products_id_review', $p2[1], '.html');
$url = $this->make_url($page, $this->get_product_name($p2[1]), $p2[0], $p2[1], '.html');
break;

 

or should I do both changes??

The seo.class change along with + possibly this for the back button?

<?php $referer = $_SERVER['HTTP_REFERER'];
if (!$referer == '') {
echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', $referer, 'primary');
} else {
echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params(array('reviews_id')))); }
?>

 

That is where I am at at the moment. Any advice on what is proper/correct for my setup is greatly appreciated.

 

Also: Do I need to make a change or delete to the -pr- rewrite in .htaccess?

-Dave

Link to comment
Share on other sites

The code in seo.class and the .htaccess file are dependent on the supplied link. So if you never use a link for the reviews page, the code in either of those will never be called. In other words, the code in the shop needs to be changed so that the links point to where they should point to and this addon will function correctly.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Got it - Thanks Jack.

 

So leave seo.class alone, and this for the product_reviews_info Back button link should do well

 

<?php $referer = $_SERVER['HTTP_REFERER'];
if (!$referer == '') {
echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', $referer, 'primary');
} else {
echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $review['products_id'])); }
?>

 

If I misunderstood or this is wrong please say so. Thank you

-Dave

Link to comment
Share on other sites

HI!

 

I have instelled this addon on clean OSC 2.3.3.4 in xampp.

 

After several changes in code: like msqli, htaccess

I get ERRORS.

 

If I click on the categories or products I get a 404 page.

 

The link in category is: http://localhost/-c-2.html

 

The same for product: http://localhost/-p-8.html

 

What can I do?

 

Thanks,

T

Link to comment
Share on other sites

Based on JJ mod seo.class.php. the file names are correct but still showing blank page the products and the categories.

404 Error.

 

Any idea?

 

 

HI!

 

I have instelled this addon on clean OSC 2.3.3.4 in xampp.

 

After several changes in code: like msqli, htaccess

I get ERRORS.

 

If I click on the categories or products I get a 404 page.

 

The link in category is: http://localhost/-c-2.html

 

The same for product: http://localhost/-p-8.html

 

What can I do?

 

Thanks,

T

Link to comment
Share on other sites

Problem solved.

 

simply the htaccess

 

I changed the RewirteBase to:

RewriteBase /

 

Based on JJ mod seo.class.php. the file names are correct but still showing blank page the products and the categories.

404 Error.

 

Any idea?

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

i have problem with special characters like others people here. But i've seen that there wasn't solution, so my problem is still active.

Database is in utf8_general_ci

I've changed encoding in index, application_top and seo.class to UTF-8 and still that didn't helped.

 

When i've done this:

print_r($this->attributes['SEO_CHAR_CONVERT_SET']);

it's printinga couple of times. But first of them looks like this: Array ( [Ăł] => o [Ĺ] => l [Ĺ] => l [Ä] => c [Ĺş] => z [Ĺź] => z [Ä] => e [Ä] => a [Đż] => p [Đź] => m [Đ˝] => c [Ń] => h [в] => v [и] => y [Đš] => y [Đś] => zh [Ń] => t [Ń] => s [Ń] => yu [Ń] => sh [Đş] => k [Ń] => u )

 

 

where the next one looks like that: Array ( [ó] => o [ł] => l [Ł] => l [ć] => c [ź] => z [ż] => z [ę] => e [ą] => a [п] => p [м] => m [н] => c [ч] => h [в] => v [и] => y [й] => y [ж] => zh [т] => t [с] => s [ю] => yu [ш] => sh [к] => k [у] => u )

the second one is correct one, that what i save in configuration.

And when i am printing $string it's print with question marks insteed of special characters.

 

Can someone help me?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...