Jump to content
spidometrs

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

Recommended Posts

@jabjab2

I'm using USU5 https://apps.oscommerce.com/A9ikD without any problems on osC2.3.4BS and PHP 7.1.6.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

Hi Community!

I have recently installed this contribution on my store and for some reason the URL's are not being output onto the pages or put into the links of the pages.

Example: Featured Products List On Home Page

The title and image for the products have links like this:

http://devsite.garrettspecialties.com/product_info.html?products_id=9864

 

However I can visit this URL and it works

http://devsite.garrettspecialties.com/digital-clip-p-9864.html

 

Anyone have any ideas of why the new SEO url does not show up in the navigation and in the links of the pages?

 

Share this post


Link to post
Share on other sites

In order for the rewrite to occur the link code has to use the in-built link function. I would think the pages you mention are using those but if you added the links manually using regular html linking code, then that would cause it.

Share this post


Link to post
Share on other sites

@Jack_mcs In includes\classes\seo.class.php in the most recent Ultimate SEO URLs package you uploaded (1st October 2016),

line 1124

FROM `peoducts_description`

should be

FROM `products_description`

Cheers, Eddy

Edited by Moxamint

Share this post


Link to post
Share on other sites

@Jack_mcs is 't possible that Ultimate SEO V 2.2d holds back the use of the following piece of code in .htaccess file? I can't seem to get it work.

RewriteCond %{HTTPS} !=on [OR]

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteRule ^ https://www.muisjesensitief.nl%{REQUEST_URI} [NE,R=301,L]

 

Share this post


Link to post
Share on other sites

No, this addon won't affect that. Try the following instead of what you have. If it doesn't work, please post in the general forum and someone will help you there.

RewriteCond %{HTTP_HOST} ^muisjesensitief\.nl
RewriteRule ^(.*)$ https://www.muisjesensitief.nl/$1 [R=permanent,L]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.muisjesensitief.nl/$1 [R,L]

 

Share this post


Link to post
Share on other sites
15 minutes ago, Jack_mcs said:

No, this addon won't affect that. Try the following instead of what you have. If it doesn't work, please post in the general forum and someone will help you there.


RewriteCond %{HTTP_HOST} ^muisjesensitief\.nl
RewriteRule ^(.*)$ https://www.muisjesensitief.nl/$1 [R=permanent,L]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.muisjesensitief.nl/$1 [R,L]

 

it helped ! thanx !

Share this post


Link to post
Share on other sites

Hi,

I report a bug when using letter "c" with any word before into a product name which prevents the url from working and product to appear.

In this case, it is the common word "Type C" or "a c", "b c", etc...

I use Ultimate_SEO_URLSv22d_14 version.

Do you experienced the same issue with your versions?

Any fix for this ?

Thank you.

Edited by milerwan

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites
16 minutes ago, milerwan said:

Hi,

I report a bug when using letter "c" with any word before into a product name which prevents the url from working and product to appear.

In this case, it is the common word "Type C" or "a c", "b c", etc...

I use Ultimate_SEO_URLSv22d_14 version.

Do you experienced the same issue with your versions?

Any fix for this ?

Thank you.

Equivalent bug with letter "p" too... :sad:


Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites

The way the rewrite works is that a control character is used to represent the various types of pages: c for categories, p for products, pr for product reviews and so on. So when one of your products has such a character in the name, the code things it is a control character and handles it incorrectly. I'm not aware of a way around that problem other than to not use those letters in the names.

Share this post


Link to post
Share on other sites
21 hours ago, Jack_mcs said:

The way the rewrite works is that a control character is used to represent the various types of pages: c for categories, p for products, pr for product reviews and so on. So when one of your products has such a character in the name, the code things it is a control character and handles it incorrectly. I'm not aware of a way around that problem other than to not use those letters in the names.

There could be a trick fix from "admin->Configuration->SEO URLs->Enter special character conversions".

Pay attention to the respect of the typology used for product name, for example in case of "USB Type-C", you can use these sentences (knowing that c must be attached to a word or deleted) :
-C=>c     = "usb-typec-p-xxx.html

-C=>       = "usb-type-p-xxx.html

Same operating for "P" or "M" letters if needed...

 

To fix all others letters, use this in your htaccess file :


RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-by-([0-9]+).html$ all-products.php?fl=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-([0-9]+).html$ #article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-au-([0-9]+).html$ articles.php?authors_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-f-([0-9]+).html$ faqdesk_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fc-(.*).html$ faqdesk_index.php?faqPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fri-([0-9]+).html$ faqdesk_reviews_info.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-fra-([0-9]+).html$ faqdesk_reviews_article.php?faqdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-links-([0-9]+).html$ links.php?lPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pm-([0-9]+).html$ info_pages.php?pages_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-n-([0-9]+).html$ newsdesk_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nc-(.*).html$ newsdesk_index.php?newsPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nri-([0-9]+).html$ newsdesk_reviews_info.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-nra-([0-9]+).html$ newsdesk_reviews_article.php?newsdesk_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-po-([0-9]+).html$ pollbooth.php?pollid=$2&%{QUERY_STRING}
# End Ultimate SEO V2.2d


Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites

Edit: I forget to USE space after letter C (if not, all words beginning with "-C" will be impacted). :wacko:

Pay attention to the respect of the typology used for product name, for example in case of "USB Type-C", you can use these sentences (knowing that c must be attached to a word or deleted) :
-C =>c     = "usb-typec-p-xxx.html

-C =>       = "usb-type-p-xxx.html

Same operating for "P" or "M" letters if needed...


Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites

Edit2: Sorry PLACE the word before the letter C (if not, all words beginning with "-C" will be impacted). :wacko:

Pay attention to the respect of the typology used for product name, for example in case of "USB Type-C", you can use these sentences (knowing that c must be attached to a word or deleted) :
-Type-C=>c     = "usb-typec-p-xxx.html

-Type-C=>       = "usb-type-p-xxx.html

Same operating for "P" or "M" letters if needed...

 

PS: Sorry for multi-posts but I can't edit them...


Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites

Has anyone found a fix for the  SEO Breadcrumb Override problem in 2.3.4BS? I have done everything I can think of to fiddle with code that I don't understand  to try and make the product name show up in the breadcrumb instead of a big ZERO (since I don't have model numbers.) I've tried to mess with includes/application_top to call up either product_name from the PRODUCTS_DESCRIPTIONS table, or products_id from the products table, I've done file comparisons with OSC 2.2 application_top files that worked, but don't want to just paste it over newer code as I'm not sure what problems it might cause.

So, I hope someone out there knows the fix and would like to share.

 

(I found the fix below from @raiwa from a thread that's archived from a couple years ago, but it didn't help.)

-----------------------------------------------------------------------------

If your version is newer check if you have this option in:

Admin => Modules => Header Tags => Product Title => SEO Breadcrumb Override?

and set it to "true"

 

Then you need to do a small fix in includes/application_top.php:

Find:

      $model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), p.products_model) as products_model from products p, products_description pd where p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

and change to:

      $model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), pd.products_name) as products_model from products p, products_description pd where p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

Without this change, the model is still used if the SEO Product Title is left blank.

It seems this is a small bug, please confirm.

Share this post


Link to post
Share on other sites

Hello Brian @brian_cee,

 

Just checked and the above fix works still for me in the latest EDGE.

Make sure you have the Product Title header tag installed:

Admin => Modules => Header Tags => Product Title => SEO Breadcrumb Override?

and set it to "true"

PS: this is not related to Ultimate SEO URLs v2.1, please post in the correct topics.

Edited by raiwa

Share this post


Link to post
Share on other sites

@brian_cee if in your store you want to output the product name unless you have overridden the breadcrumb in Header tags, you should change the first query from

$model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), p.products_model) as products_model from products p, products_description pd where p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

to

$model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), p.products_name) as products_model from products p, products_description pd where p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

and set Breadcrumb override to True


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

...but if you haven't installed Header Tags SEO and for some reason don't want to, the easiest change is to make the second model query the same as this too.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
25 minutes ago, raiwa said:

Hello Brian @brian_cee,

 

Just checked and the above fix works still for me in the latest EDGE.

Make sure you have the Product Title header tag installed:

Admin => Modules => Header Tags => Product Title => SEO Breadcrumb Override?

and set it to "true"

PS: this is not related to Ultimate SEO URLs v2.1, please post in the correct topics.

Sorry, but if you look in Jack_mcs' signature, it says: Most Important: Header Tags SEO - Ultimate SEO V 2.2d

and when I click the link for Ultimate SEO V 2.2d, it takes me to this very thread. So I assumed versions 2.2 and 2.1 were similar enough to talk about here, since he created that link. But OK, if you say so, I'll try to find a better thread tomorrow, it's too late here for more of this tonight. But, by the way, I set everything up as you said, I could show screenshots, but not here, I guess.

Share this post


Link to post
Share on other sites
1 hour ago, brian_cee said:

the model is still used if the SEO Product Title is left blank.

That is correct, and expected.

Make your "product seo title" the same as your "product name" for each product.

 


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
10 minutes ago, brian_cee said:

Sorry, but if you look in Jack_mcs' signature, it says: Most Important: Header Tags SEO - Ultimate SEO V 2.2d

and when I click the link for Ultimate SEO V 2.2d, it takes me to this very thread. So I assumed versions 2.2 and 2.1 were similar enough to talk about here, since he created that link. But OK, if you say so, I'll try to find a better thread tomorrow, it's too late here for more of this tonight. But, by the way, I set everything up as you said, I could show screenshots, but not here, I guess.

Brian, One thing is Header Tags SEO: Header Tags SEO

another is: Ultimate SEO URLs: Ultimate SEO V 2.2d

and a third is your question about product title instead of model in Breadcrumb and my fix.

Share this post


Link to post
Share on other sites
9 minutes ago, burt said:

That is correct, and expected.

Make your "product seo title" the same as your "product name" for each product.

 

Are you serious? Fill in product seo title for each product one by one instead of one code change?

Share this post


Link to post
Share on other sites
2 hours ago, raiwa said:

Are you serious? Fill in product seo title for each product one by one instead of one code change?

The advice to change core code is far from ideal.  Preferable advice would be;

- make a hook
- make a replacement module
- etc

I do not know if the asker has 1 product, or 100, or 1000. 
In any case, it takes 30 seconds to perform a database hit to update seo_title to match name.

However, this little conversation is good as I can revisit my piece of code and come up with some changes.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites
1 hour ago, burt said:

In any case, it takes 30 seconds to perform a database hit to update seo_title to match name.

He still would have an additional copy paste action for each new or modified product or to run again the sql query.

With my suggested "core" change the following 3 options for products breadcrumb would be available:

1. product model like by default

2. product SEO name like in existing core

3. product name like he asked for, instead of empty. Who wants an empty entrance for product in breadcrumb?

This has been suggested some time ago (but rejected) as a core change/fix also for the misleading info text in admin products:

Products Title for SEO:
Replaces the product name in the <title> Meta Element
and optionally in the Breadcrumb Trail.
Leave blank to default to product name.

 

Edited by raiwa

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×