-
Why a product has multiple links and can show under different categories???
[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]
In Zen cart product's URL should in format like this :
https://domain.com/index.php?main_page=product_info&cPath=42&products_id=9553
I got this link because I created the product with ID 9553 ONLY under category with ID 42.
However, I found if I twisted the url a little by changing the category id to 38 , which represents another category, the link still works!
and it shows the product 9553 under category 38, even I have never created the product or link the product there!
To search engine it means the product has multiple copies of url, since I have multiple categories.
Anybody can tell me how to fix the problem?
-
Re: Why a product has multiple links and can show under different categories???
For example, I created a product with ID 8066 under category with ID 38, the product URL will be generated like:
https://solutiontestbank.com/index.p...oducts_id=8066
but if I changed the cpath=38 to cpath =42, for example like the following,
https://solutiontestbank.com/index.p...oducts_id=8066
it still shows the product , but under category 42 and this is NOT right!
What I want: when url is wrong, it should show "page not found"
-
Re: Why a product has multiple links and can show under different categories???
Your assumption is that the search engines are going to change category ids in your urls to see if they can discover something that doesn't exist... nope they are not going to do that, so it is a non issue. When you manually change the cpath in the url it gets ignored by the cart and you get taken to the product based on the product id parameter.
-
Re: Why a product has multiple links and can show under different categories???
Also remember a product can be in many categories if it's a Linked Product. Having the category id in the URL just means you can navigate through that category with the Next and Prev buttons on your product info page, assuming your template has them and they are enabled.
-
Re: Why a product has multiple links and can show under different categories???
Put another way, although the product does/can show under multiple categories either on purpose (linked product) or by someone attempting an alternate category (say the product is now in category 42, someone store's that link, and then later it is mapped to (linked) to category 38), the product is identified to a master category and as a result the canonical link should show the master category. By the canonical link identifying the product as belonging to category 42, regardless the entered cPath value, the product is seen as being a single product having multiple ways to get to it.
The cPath is an indicator of association to the product, it doesn't uniquely identify the product. The products_id is what uniquely identifies the product. If a product exists under one category now and is then moved (not necessarily linked) to another category and the request is implemented, instead of the product being located and the new canonical link provided, the product will be identified as no longer existing and need to be found again by either users or search engines.
Now, because you indicated that your site is using Zen Cart version 1.5.1, released nearly 7 years ago, if you by chance are using the now recommended all https: style of access, the above discussed canonical link will not be present and could be a reason that you may come across issues. As of production released version 1.5.3, if the site was made all https: by this instruction: https://www.zen-cart.com/content.php...alled-zen-cart then the canonical link would be provided on https: pages.
I personally don't recommend implementing the requested change, but it's not my site.
I would think that the best place to incorporate the desired change would be in includes/init_includes/init_sanitize.php
Towards the end of the file is a check to validate products_id for search engines and bookmarks, etc.
Within that section, if you are going to implement a product not found type action then would suggestevaluating the provided cPath to see if the product is found in that category and if not to do the redirect to the product not found page. Understand though also that such search on each product page will use additional resources to validate the information being compared. Further also note that while the cPath was called into question, there also is a similar "difference" possibly seen by using a different main_page parameter value. For example you showed product_info; however, the product would likely still show if document_product_info or say perhaps product_free_shipping_info.
-
Re: Why a product has multiple links and can show under different categories???
Thank you for your reply.
I found the problem when I was trying to fix the "Duplicate without user-selected canonical“ problem in google search console.
In "Duplicate without user-selected canonical" tab of google search console,
there are many links of such things with wrong category ID,
for example "https://domain.com/index.php?main_page=product_info&cPath=47&products_id=3972", the right url and submitted in sitemap is
"https://domain.com/index.php?main_page=product_info&cPath=29&products_id=3972"
This is not rare example, there are thousands of links with wrong category id and were marked duplicates in my account.
The product is only created under category 42, it is Never linked to any other category like 47, and its canonical link confirms this, but in the URL it says 47 so it is a wrong one. the link is not provided in my sitemap either, google said the "URL might be known from other sources that are currently not reported" I have no idea where it came from. but it is visitable, as a matter of fact, googlebot saw this, and took it a duplicate one, I need it to return a 404 error to eliminate duplicate problem.
-
Re: Why a product has multiple links and can show under different categories???
Thank you, I fully aware of that. A product can be shows up in multiple categories, provided you manage this in admin since there is such function.
But I only created the product ONLY under one category, have NEVER linked it to other categories.
Also, the problem I mentioned above actually created thousands of duplicate or triplicate links
-
Re: Why a product has multiple links and can show under different categories???
Can you please help me with the following question?
If I created a product 1 under category 42 and has never linked to another categories, system will generated link like:
https://domain.com/index.php?main_page=product_info&cPath=42&products_id=1
The cpath=42 indicates its mastercategory and products_id=1 indicates it is the specific product itself, right?
If somebody changed 42 to other number , for example , 38, make it as https://domain.com/index.php?main_pa...&products_id=1
even it is not mapped to category 38, but the same product page still visitable, and product page shows up under category 38, is this normal ?
does anybody's zen site work like this? or Zen cart is intentional designed in this way?
-
Re: Why a product has multiple links and can show under different categories???
mc12345678
The product I mentioned above has never moved, or mapped, or linked to any other category.
If you created a test product with ID 1 under category 2, system gives you
"https://domain.com/index.php?main_page=product_info&cPath=2&products_id=1
is that right? for example , I have 10 different categories with different id numbers, 2 to 12
My problems is:
when I only submit one unique link in sitemap to google search console but for some reason, googlebot can literally crawl 10 copies of DIFFERENT urls and they return the same product info page. for example:
https://domain.com/index.php?main_pa...&products_id=1 (right one and I submitted and confirmed in its canonical tag in header)
https://domain.com/index.php?main_pa...&products_id=1
https://domain.com/index.php?main_pa...&products_id=1
https://domain.com/index.php?main_pa...&products_id=1
https://domain.com/index.php?main_pa...&products_id=1
https://domain.com/index.php?main_pa...&products_id=1
...........
https://domain.com/index.php?main_pa...&products_id=1
They are all visitable and shows under different categories and make it looks like I linked , or ever moved, or mapped there but NO, I have never done that. this is crazy, I am wondering why and how google found these links, but google says, "URL might be known from other sources that are currently not reported" I have no idea about the sources. I don't have control over the sources, all I want is when google visit those wrong links, it can generate "page not found" error or 410 error sth like that.
-
Re: Why a product has multiple links and can show under different categories???
I used to use Ceon MAPPING but recently it was turned off. when the CEON MAPPING WAS ON, I don't have this problem, since all urls were in readable format, so there is such problem.
-
Re: Why a product has multiple links and can show under different categories???
most of my products urls are single ,unique categorized. they are not mapped, or moved to multiple categories, and all urls are using their original formats.
Does the original format has potential risk of duplicate contents? I want either control the "sources" which provides google those wrong urls, or declined wrong visit requests.
Please tell me how to do it.
-
Re: Why a product has multiple links and can show under different categories???
I have to use robot.txt to disallow those wrong urls to be visited , but still don't know how they generated
-
Re: Why a product has multiple links and can show under different categories???
So it appears that you are reviewing the information made available by Google about the status of their site review and determination of items on the site.
Couple of things:
- it is possible to tell google what each of the parameters on the Web address do. Right now it looks like they are trying to figure out what it means to have different cPath values and how it relates to the overall site. Whether that information was obtained by internally determining a product in a category and then trying to see what is what or if someone at some point tried to promote the site by using very random links to point at the site. The thing though is that it appears that the cPath values appear to be those that exist.
- Ceon module was turned off instead of changing all of the active URIs to being inactive. As a result, now the site has to be completely reindexed rather than having the links updated back to their Zen Cart original paths by reference to their former rewritten uris.
From research of the original reported message it seems that at least in the data collection/attempt at accessing data that either the canonical link was not present or it possibly wasn't read. This could be an indication of how data about the site is being collected. E.g. One bot goes out and tries multiple variations, another reviews those results and cross references them with other information made available.
-
Re: Why a product has multiple links and can show under different categories???
Just an observation when looking at the site page view source and a couple of tools including hitting the site with the Screaming Frog SEO Spider to try and see how the site looks to search engines. So using automated tools and my eyes I find something that doesn't make a lot of sense to me. In the menu below Categories" there is a sub--submenu that has display: none set on it but the urls appear to be wrong, the cPath= are empty
Code:
<ul class="sub-menu">
<li><a class="category-top" href="https://solutiontestbank.com/index.php?main_page=index&cPath=38">Anatomy | Biology</a>
<ul class="sub--sub-menu">
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8054">Test bank for Human Biology 14th Mader 9781259245749</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8073">Instructor manual for Campbell Biology 11th Urry 9780134433691</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8074">Instructor manual for Campbell Biology Concepts & Connections 9th Taylor 9780134536255</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8075">Instructor manual for Essentials of Biology 5th Mader 9781259660269</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8076">Instructor manual for Essentials of the Living World 5th Johnson 9780078096945</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8077">Instructor manual for Foundations In Microbiology 10th Talaro 9781259705212</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8078">Instructor manual for Human Biology 14th Mader 9781259245749</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8079">Instructor manual for Human Biology 15th Mader 9781259689796</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8080">Instructor manual for Human Biology Concepts and Current Issues 8th Johnson 9780134312699</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8081">Instructor manual for Inquiry Into Life 15th Mader 9781259426162</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8082">Instructor manual for Microbiology A Systems Approach 4th Cowan 9780073402437</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8083">Instructor manual for Microbiology A Systems Approach 5th Cowan 9781259706615</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8084">Instructor manual for Microbiology with Diseases 5th Bauman 9780134608242</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8085">Instructor manual for Nester's Microbiology 8th Anderson 9780073522593</a></li>
So you see in the above code the cPath= doesn't have an actual number for the category id. The question is whether or not that is causing the crawler to come back and test numbers in the url?
-
Re: Why a product has multiple links and can show under different categories???
Thank you for the thoughts. Could you please tell me how to have google to reindex my site?
-
Re: Why a product has multiple links and can show under different categories???
I'm using screaming frog to do the test but you pointed out the problem!
1. the links you digged out are not right ones and conflict with the product url and the canonical link in the header.
I have double checked and confirmed this. Which means, what bots saw are wrong ones. I think this is the main problem,
but can you tell me what caused this?
2. I don't know there is any sub--sub--menu, is that a sub category? but I don't have second level categories for sure.
It doesn't make any sense to me either.
Can you please tell me how to fix these?
-
Re: Why a product has multiple links and can show under different categories???
They are being generated but hidden by CSS. You will probably need to have a conversation with Numinix who created your template about the problem.
-
2 Attachment(s)
Re: Why a product has multiple links and can show under different categories???
Also, can you please tell me in where I can find the code interface in screaming frog, sorry but I am new to this tool.
Please take a look at the crawl info, in the red area the links in bots eyes are all wrong and not indexable, I don't know how did it happen ,but the canonical link is correct though, see the pictures
Attachment 18449
Attachment 18450
-
Re: Why a product has multiple links and can show under different categories???
Thank you again!
so my question is :
in above screenshots I want bot to crawl a category: https://domain.com/index.php?main_page=index&cPath=38 and there is a 141 products in it.
however, beyond that number, it should automatically adjust the cpath number but instead, it finds wrong urls , how did this happen?
which files in zen cart control this ? do you have any idea?
-
Re: Why a product has multiple links and can show under different categories???
You are right!!
I activated other templates, and crawl again, no such a cpath problem anymore so the problem lies in my template,
probably its CSS file!
-
Re: Why a product has multiple links and can show under different categories???
Quote:
Originally Posted by
sjbglx1
You are right!!
I activated other templates, and crawl again, no such a cpath problem anymore so the problem lies in my template,
probably its CSS file!
The CSS file just prevents the browser from showing that portion of the menu options. It does not modify the link. The code that generates the menu is what is causing at least that one issue. Should be able to use the developer's tool kit found in the admin->tools menu to narrow down exactly where that menu is generated and maybe fix it.
-
Re: Why a product has multiple links and can show under different categories???
right, but how about the missing value behind the "cPath="?
for example :
PHP Code:
<li><a href="https://mydomain.com/index.php?main_page=product_info&cPath=&products_id=8054">Test bank for Human Biology 14th Mader 9781259245749</a></li>
if I use different templates, then spider can crawl normally, no longer add wrong values behind cPath.
What file may control that? please guess.
-
Re: Why a product has multiple links and can show under different categories???
Quote:
Originally Posted by
barco57
Just an observation when looking at the site page view source and a couple of tools including hitting the site with the Screaming Frog SEO Spider to try and see how the site looks to search engines. So using automated tools and my eyes I find something that doesn't make a lot of sense to me. In the menu below Categories" there is a sub--submenu that has display: none set on it but the urls appear to be wrong, the cPath= are empty
Code:
<ul class="sub-menu">
<li><a class="category-top" href="https://solutiontestbank.com/index.php?main_page=index&cPath=38">Anatomy | Biology</a>
<ul class="sub--sub-menu">
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8054">Test bank for Human Biology 14th Mader 9781259245749</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8073">Instructor manual for Campbell Biology 11th Urry 9780134433691</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8074">Instructor manual for Campbell Biology Concepts & Connections 9th Taylor 9780134536255</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8075">Instructor manual for Essentials of Biology 5th Mader 9781259660269</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8076">Instructor manual for Essentials of the Living World 5th Johnson 9780078096945</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8077">Instructor manual for Foundations In Microbiology 10th Talaro 9781259705212</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8078">Instructor manual for Human Biology 14th Mader 9781259245749</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8079">Instructor manual for Human Biology 15th Mader 9781259689796</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8080">Instructor manual for Human Biology Concepts and Current Issues 8th Johnson 9780134312699</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8081">Instructor manual for Inquiry Into Life 15th Mader 9781259426162</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8082">Instructor manual for Microbiology A Systems Approach 4th Cowan 9780073402437</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8083">Instructor manual for Microbiology A Systems Approach 5th Cowan 9781259706615</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8084">Instructor manual for Microbiology with Diseases 5th Bauman 9780134608242</a></li>
<li><a href="https://solutiontestbank.com/index.php?main_page=product_info&cPath=&products_id=8085">Instructor manual for Nester's Microbiology 8th Anderson 9780073522593</a></li>
So you see in the above code the cPath= doesn't have an actual number for the category id. The question is whether or not that is causing the crawler to come back and test numbers in the url?
Thank you again for your thoughts and the kind test, can you please test again for me ? I just fixed one file but since I don't know how to do the above test,
This time please help me to see if the cPath= still missing value.
Thank you!
-
Re: Why a product has multiple links and can show under different categories???
in the tpl_modules_categories_tabs.php, I modified the line 15 from
PHP Code:
if (CATEGORIES_TABS_STATUS != '1')
to
PHP Code:
if (CATEGORIES_TABS_STATUS == '1')
and that fixed the crawl problem , according to the screaming frog tests.
However, it creates another problem, the category drop down menu stopped working, I post it here in case anybody can help me !
-
Re: Why a product has multiple links and can show under different categories???
Never mind the second problem, I fixed that by go to Admin > Layout Setting > Categories-Tabs Menu ON/OFF > and set to 1