Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ULTIMATE Seo Urls 5 - by FWR Media


Recommended Posts

This issue is nothing to do with USU5 and no changes in USU5 code are necessary.

 

products_id in osCommerce looks like 1{4}1{3}5 when their are attributes, however when entering into a database field osCommerce code typecasts the value to INT .. like ..

 

(int)$products_id

 

This will convert 1{4}1{3}5 to (int)1

 

Your osCommerce code must be missing the type cast.

 

Bingo! (tentatively)

What I found was in shopping_cart.php, there were 2 instances of $products[$i]['id'] without (int)

once (int) was inserted in front of both, the URL changed

 

from:

http://www.localdev.com/public_html/product_info.php?products_id=22{5}10

 

to:

http://www.localdev.com/public_html/unreal-tournament-p-22.html

 

here is the modified code block from catalog/shopping_cart.php:

$products_name = '<table border="0" cellspacing="2" cellpadding="2">' .

' <tr>' .

' <td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], CART_IMAGE_WIDTH, CART_IMAGE_HEIGHT) . '</a></td>' .

' <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';

 

I realize this may not be germane to this forum

but wanted to follow-up

in case this info may be beneficial to anyone

(if this solution is somehow unwittingly futzed,

please feel free to call me a knucklehead)

 

jk

Link to comment
Share on other sites

please feel free to call me a knucklehead)

 

jk

 

No you are not a knucklehead, you are attempting to solve problems yourself which is admirable.

 

The issue is that there is no problem. USU5 has no known issues and the blog that you read (I know of) was NOT stating a bug he was stating a preference which I have decided not to include, it DOES NOT relate to your problem.

 

Your problem related to a query ..

 

select * from products as p, products_description as pd where p.products_id = pd.products_id and pd.products_id = 1{4}1{3}5

 

that query does not seem standard osCommerce .. you have to find it and type cast the products_id

Link to comment
Share on other sites

I'm thoroughly impressed with and appreciative of your knowledgeable, quick feedback.

That aforementioned query is remarkably elusive (for moi)

(sure would be expedient if those sql errors identified their location,

where's the suggestion box?)

anyway adding (int) to those 2 instances in catalog/shopping_cart.php

does manage to be an interim remedy

to wit, it does bring up the product info page just as items without attributes

albeit with the default options, which might be standard operating procedure

in short, the code now gets to the right place, due primarily to your

pinpointing the need for (int), thanks for your beacon of brlliance, Robert

 

jk

Link to comment
Share on other sites

Hello Robert!

 

Many thanks for this great contrib. Seems to work fine.

 

I install the contrib and upload the german conversion-pack. Now the design from my shop changed. The german conversion-pack is loaded above the shop layout so the shop moved down on the side. Where can I set that the conversion pack is loaded at another place?

 

I hope you know what I mean. Else I can sent you a screenshot.

 

Many thanks!

Link to comment
Share on other sites

Ultimate Seo Urls 5 r141 has no known issues

 

Just to confirm that the current version ..

 

Ultimate Seo Urls 5 version 1.0 [sTABLE] r141

 

Is entirely stable and has no known issues. This was uploaded on 10th of December 2009.

 

 

Hi Robert,

 

I am moving my site to a new server and the php there is PHP 5.2

 

So I followed recommendations to update my SEO to this one. Which I did and it's working perfectly, thank you for that. I have only one tiny problem. I want to remove all the dashes that are in between each words. I get around installing contributions easily enough but editing and customizing to my needs is something that I try to keep to a minimum. Lack of knowledge!

 

in my older version of USU, my links would show this way: http://www.domain.com/catalog/whatabeautifulproduct-p-101.html

 

in USU 5, my links show this way: http://www.domain.com/catalog/what-a-beautiful-product-p-101.html

 

I'm trying to remove the additional dashes there. I tried the replace caracter function and it's not working. Most likely I'm overlooking something or simply doing it wrong. Any input would be really appreciated.

 

Thank you

Link to comment
Share on other sites

Hi Robert,

 

I am moving my site to a new server and the php there is PHP 5.2

 

So I followed recommendations to update my SEO to this one. Which I did and it's working perfectly, thank you for that. I have only one tiny problem. I want to remove all the dashes that are in between each words. I get around installing contributions easily enough but editing and customizing to my needs is something that I try to keep to a minimum. Lack of knowledge!

 

in my older version of USU, my links would show this way: http://www.domain.com/catalog/whatabeautifulproduct-p-101.html

 

in USU 5, my links show this way: http://www.domain.com/catalog/what-a-beautiful-product-p-101.html

 

I'm trying to remove the additional dashes there. I tried the replace caracter function and it's not working. Most likely I'm overlooking something or simply doing it wrong. Any input would be really appreciated.

 

Thank you

 

the uri words should be separated by a valid word seperator like -(hyphen) otherwise the bots will see the uri as one single string and not seperate words.

 

For this reason USU5 Remove all non-alphanumeric characters? does not remove the hyphen.

 

If you really have to have it without the hyphen you would need to modify the linkText() method in abstract class aDataMap.

Link to comment
Share on other sites

Hello Robert!

 

Many thanks for this great contrib. Seems to work fine.

 

I install the contrib and upload the german conversion-pack. Now the design from my shop changed. The german conversion-pack is loaded above the shop layout so the shop moved down on the side. Where can I set that the conversion pack is loaded at another place?

 

I hope you know what I mean. Else I can sent you a screenshot.

 

Many thanks!

 

Why is the conversion pack array showing on the site? this sounds like you have added some "test" code that was used in another post to find a problem that didn't exist.

Link to comment
Share on other sites

Hi!

 

Yeah, this is it. I changed to the test-code and don´t remove it. Many thanks!

 

But, whats the difference about uploading the language-files and the field "Enter special character conversions." in the admin section? It seems that the result is the same.

Link to comment
Share on other sites

Hi!

 

Yeah, this is it. I changed to the test-code and don´t remove it. Many thanks!

 

But, whats the difference about uploading the language-files and the field "Enter special character conversions." in the admin section? It seems that the result is the same.

 

The admin settings are very limited in size and usability but more importantly can only be for one language.

 

 

By using the character conversion files a different conversion array can be loaded for each language making it truly multi language capable unlike series 2 seo urls.

Link to comment
Share on other sites

the uri words should be separated by a valid word seperator like -(hyphen) otherwise the bots will see the uri as one single string and not seperate words.

 

For this reason USU5 Remove all non-alphanumeric characters? does not remove the hyphen.

 

If you really have to have it without the hyphen you would need to modify the linkText() method in abstract class aDataMap.

 

 

humm... food for thoughts. Thank you... I appreciate the information greatly and will think on it before I do anything.

 

Thanks again.

Link to comment
Share on other sites

I use Ultimate SEO 2-2.2d-4. I know this is the wrong topic, but before I change the contribution, I want to know, that this contribution can solve my problem.

 

I have the following problem. Some of my products are stored in two categories.

 

I choose a category with the menu. And then if I change from product listing to the product page, the category changes to the first category of the product (in the menu, in the breadcrumb and in the link to the next/prev product) - so cPath has the wrong value.

 

Will this problem also occure in Seo URL 5?

 

Anathema

Link to comment
Share on other sites

I use Ultimate SEO 2-2.2d-4. I know this is the wrong topic, but before I change the contribution, I want to know, that this contribution can solve my problem.

 

I have the following problem. Some of my products are stored in two categories.

 

I choose a category with the menu. And then if I change from product listing to the product page, the category changes to the first category of the product (in the menu, in the breadcrumb and in the link to the next/prev product) - so cPath has the wrong value.

 

Will this problem also occure in Seo URL 5?

 

Anathema

 

Hi Ulrike

 

USU5 has no known issues and plenty of benefits over the old series 2 seo urls (multi language seo coming soon too) .. BUT .. I have to admit that I'm not sure if this isn't just a coding issue on your site.

 

By all means give it a try.

Link to comment
Share on other sites

Hi Rob,

 

Installed USU5 on my live shops. You can see them working at the links of the live shops I PM'd you a couple of days ago.

 

Everything's working great!!!

 

One small detail, I set SEO_URLS_FILTER_SHORT_WORDS to 3. Nevertheless, it doesn't filter 3 letter words but still 1 letter words. 2 setting doesn't seem to work either.

 

Please advise.

 

Thanks.

Andybird

Link to comment
Share on other sites

Hi Rob,

 

Installed USU5 on my live shops. You can see them working at the links of the live shops I PM'd you a couple of days ago.

 

Everything's working great!!!

 

One small detail, I set SEO_URLS_FILTER_SHORT_WORDS to 3. Nevertheless, it doesn't filter 3 letter words but still 1 letter words. 2 setting doesn't seem to work either.

 

Please advise.

 

Thanks.

Andybird

 

Well if I remember correctly Andrei you are Mr "don't like resetting the cache".

 

Did you reset the cache after making the changes to SEO_URLS_FILTER_SHORT_WORDS as it will affect the cached data.

Link to comment
Share on other sites

You are fantastic man! Right, I havn't reseted the cache.

One more thing now : Words like 1-6 become 16, Jean-Paul become jeanpaul etc. If people search for jean paul and Google indexed jeanpaul will they find the link?

 

Thanks!

 

Well google treats strings like we do (actually the other way around of course) -(hyphen) is a valid word separator so .. perhaps not.

 

The problem is that the link text has to have a valid word separator and hyphen is generally chosen as the best .. BUT .. whichever is chosen, issues like yours will come up for all of them I'm afraid.

Edited by FWR Media
Link to comment
Share on other sites

Well google treats strings like we do (actually the other way around of course) -(hyphen) is a valid word separator so .. perhaps not.

 

The problem is that the link text has to have a valid word separator and hyphen is generally chosen as the best .. BUT .. whichever is chosen, issues like yours will come up for all of them I'm afraid.

Could you maybe find a way to replace the -(hyphen) when they exist in the title by _(underscore). It seems that Google will then index both of the words. Although I'm not sure about that.

Or whay not replace the -(hyphen) character by a -(hyphen) character when it is between two letter. Would that be possible?

Link to comment
Share on other sites

Could you maybe find a way to replace the -(hyphen) when they exist in the title by _(underscore). It seems that Google will then index both of the words. Although I'm not sure about that.

Or whay not replace the -(hyphen) character by a -(hyphen) character when it is between two letter. Would that be possible?

 

Well why don't you try it (when changing stuff turn the cache off then reset it after).

 

includes/modules/ultimate_seo_urls5/abstracts/aDataMap.php

 

Find ..

 

"@[!#\$%&'\"()\*\+,\-\./:;<=>\?\@\[\]\^_`\{|\}~]+@";

 

change to ..

 

"@[!#\$%&'\"()\*\+,\./:;<=>\?\@\[\]\^_`\{|\}~]+@";

Link to comment
Share on other sites

Well why don't you try it (when changing stuff turn the cache off then reset it after).

 

includes/modules/ultimate_seo_urls5/abstracts/aDataMap.php

 

Find ..

 

"@[!#\$%&'\"()\*\+,\-\./:;<=>\?\@\[\]\^_`\{|\}~]+@";

 

change to ..

 

"@[!#\$%&'\"()\*\+,\./:;<=>\?\@\[\]\^_`\{|\}~]+@";

 

Tried that (reset the cache...) but it doens't seem to work, the - are still replaced by nothing.

Link to comment
Share on other sites

Tried that (reset the cache...) but it doens't seem to work, the - are still replaced by nothing.

 

Ok .. but bear in mind that if Remove all non-alphanumeric characters?/SEO_URLS_REMOVE_ALL_SPEC_CHARS is set to true then ALL special characters will be removed.

Edited by FWR Media
Link to comment
Share on other sites

Ok .. but bear in mind that if Remove all non-alphanumeric characters?/SEO_URLS_REMOVE_ALL_SPEC_CHARS is set to true then ALL special characters will be removed.

Right, when SEO_URLS_REMOVE_ALL_SPEC_CHARS is set to false, it works. But I don't understand, when this is set to true, the script is supposed to only replace the characters in the list ("@[!#\$%&'\"()\*\+,\./:;<=>\?\@\[\]\^_`\{|\}~]+@";). While - is not in the list anymore, why is it still replaced then???

Link to comment
Share on other sites

Right, when SEO_URLS_REMOVE_ALL_SPEC_CHARS is set to false, it works. But I don't understand, when this is set to true, the script is supposed to only replace the characters in the list ("@[!#\$%&'\"()\*\+,\./:;<=>\?\@\[\]\^_`\{|\}~]+@";). While - is not in the list anymore, why is it still replaced then???

 

No when Remove all non-alphanumeric characters is set to true the script allows only a-zA-Z0-9 characters (alphanumeric). When false the pattern is used (the bit you replaced).

 

I think the ternary operator is often quite confusing .. it works like ..

 

  $test_value = 'confirmed';

 //Ternary operator  
 $test_result = ( $test_value == 'confirmed' ) ? 'yes' : 'no';

 // Standard if/else
 if ( $test_value == 'confirmed' ) {
   $test_result = 'yes';
 } else {
   $test_result = 'no';
 }

 // switch version
 switch ( $test_value ) {
   case 'confirmed':
     $test_result = 'yes';
     break;
   default:
     $test_result = 'no';
     break;   
 }

Edited by FWR Media
Link to comment
Share on other sites

Make a new php file in the root of your osCommerce site (where product_info.php is) called fwrtest.php .. put in the file the following: -

 

<?php
 function checkpaths() {
   if( function_exists( 'realpath' ) ) {
     $realpath = str_replace( DIRECTORY_SEPARATOR, '/', realpath( '.' ) ) . '/';
     if( file_exists( $realpath . 'product_info.php' ) && !empty( $realpath ) ) {
       return $realpath;
     }
   }
   if( function_exists( 'getcwd' ) ) {
     $realpath = str_replace( DIRECTORY_SEPARATOR, '/', getcwd() ) . '/';
     if( file_exists( $realpath . 'product_info.php' ) && !empty( $realpath ) ) {
       return $realpath;
     }
   }
   return false; 
 }

 $error_text = 'Your system either cannot find the correct path or the standard file product_info.php does not exist in your osCommerce root';
 $success_text = 'We found your path to product_info.php just fine!';

 if ( false === checkpaths() ) {
   echo $error_text . '<br />' . PHP_EOL;
 } else {
   echo $success_text . '<br />' . PHP_EOL;
 } 
?>

 

Then browse to the file (www.mysite.com/fwrtest.php) and report here the output.

 

 

I changed the product_info name to my mynewnamename .... and the answer is "We found your path to mynewname.php just fine!"

Edited by zipicip
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...