Post by traceofwind » Mon Mar 21, 2011 2:48 am

Hi,

I have an issue to report. With SEO URL enabled, some sub categories fail to list products and instead display the "Category not found!" error message. Seemingly, some categories and sub categories have no such problem. All categories and sub categories have unique SEO URL codes specified.

All 671 products were imported via CSV Import PRO. Through the course of development, some categories and sub categories were deleted and then recreated; but all categories and sub categories were defined via the Admin dashboard *before* importing.

I am using OpenCart version: 1.4.9.3

Perhaps it is best I give an example, let us assume;
  • Category, parent (a) 'Die nuts' has two child sub categories (a1) 'BA Die nuts', (a2) 'BSF Die nuts'.
  • (a) SEO Url: "die-nuts"
  • (a1) SEO Url: "ba-die-nuts"
  • (a2) SEO Url: "bsf-die-nuts"
Now, (a) and (a1) will display fine, however (a2) displays the "Category not found!" error message. Renaming (a2) to anything else, e.g. 'bsf-die-nutss' will fix the problem. Ergo, is the problem related to cache; is a previously created [and subsequently deleted] sub category with the 'bsf-die-nuts' SEO URL still being cached?

Please let me know if you need me to elaborate, I can PM a link to my webshop if that helps.

All the very best,

Gary
Last edited by traceofwind on Wed Mar 23, 2011 12:32 am, edited 2 times in total.

New member

Posts

Joined
Fri Jul 02, 2010 6:37 am

Post by traceofwind » Wed Mar 23, 2011 12:30 am

*FIXED*

I think this is a fairly important and, potentially, something that could happen easily so I am surprised no one replied. Nonetheless, there is a fix and I owe rph a hearty thanks for sending me a PM with the fix. Ryan, thank you!

So it seems that SEO URLs attached to categories are not 'deleted' when the user deletes the said category. This can be evidenced in the [url_alias] table. Here's an example of how to recreate the problem;
  1. User creates category "Tennis rackets", which becomes category 1 and assigns the SEO URL "tennis-rackets".
  2. User then deletes that category and later recreates a new category (imported, or through the dashboard -etc).
  3. User then calls his new category "Tennis rackets" and assigns the same SEO URL "tennis-rackets".
  4. However, the new category has a new category ID, let's assume cat ID 2.
  5. The 'new' category (ID=2) appears on the front end of the website with SEO URL 'tennis-rackets'.
  6. However, when clicked '/tennis-rackets' looks up cat ID = 1 from [url_alias] table and reports the "Category not found!" error message.
Solution: navigate to the [url_alias] table of your MySQL database via [for example] PhpMyAdmin and navigate to the records until you find the offending entries. Tip, if using PhpMyAdmin you can sort the records by SEO URL alias to make navigation easy. You are looking for duplicate SEO URLs, in this case "tennis-rackets"; delete the duplicate record that is pointing to the obsolete category ID and voila, [url_alias] will now associate the 'tennis-rackets' SEO URL with the remaining, correct, Category ID.

Hope this helps others, I have seen similar problems reported on the forums.

Perhaps this could be addressed in future versions?

Best regards,

Gary

New member

Posts

Joined
Fri Jul 02, 2010 6:37 am

Post by rph » Thu Mar 24, 2011 8:33 am

traceofwind wrote:So it seems that SEO URLs attached to categories are not 'deleted' when the user deletes the said category.
Just to expand on this a little, OpenCart does delete SEO URLs. The problem is it doesn't have any error checking for duplicate URL aliases which can cause the SEO URL to point to the wrong place. You could give every single category, product and information page the same SEO URL in admin if you wanted.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by aaron1988 » Thu Jul 05, 2012 7:00 pm

This is a great example great work RPH and Gary :).

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am

Post by rph » Fri Jul 06, 2012 1:10 am

Since the original thread I have released Admin Enhancement Suite which adds SEO keyword duplicate checking (among many other features) when adding or editing a product, category, or information page.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by aaron1988 » Fri Jul 06, 2012 1:22 am

Cool i will take a look at this :) as my client is doing Washing Machine Spares most people search the Part Number or Model Number so i have set the SEO Keywords to Part Numbers :). as easier than going through the whole CSV changing product names to suite the SEO Keywords :)

Aaron

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am
Who is online

Users browsing this forum: No registered users and 61 guests