Hi everyone,
I'm currently developing a site for a client of mine who sells Beads. We're facing a problem with the SEO keywords. For example we have the following Category structure:
+ Beads
- 6mm
- 8mm
- 12mm
In each of these categories we're adding a product named "Vegetable Ivory". And wanting the SEO Keyword to be vegetable-ivory. Sadly it only will display one of the products because the SEO Keyword is the same, although the product be in a different category.
Is there no way of having hierarchical URL's so we could have the following
.com/beads/6mm/vegetable-ivory/
.com/beads/8mm/vegetable-ivory/
.com/beads/12mm/vegetable-ivory/
As you can see, in this instance there's a need for this kind of support. Not just to grab the page via from the last section of the url. But to take the parent sections (i.e. categories) into consideration first.
Hope this explains the situation well enough, but any questions ask away and hopefully I'll re-explain better.
Thanks in adv.
I'm currently developing a site for a client of mine who sells Beads. We're facing a problem with the SEO keywords. For example we have the following Category structure:
+ Beads
- 6mm
- 8mm
- 12mm
In each of these categories we're adding a product named "Vegetable Ivory". And wanting the SEO Keyword to be vegetable-ivory. Sadly it only will display one of the products because the SEO Keyword is the same, although the product be in a different category.
Is there no way of having hierarchical URL's so we could have the following
.com/beads/6mm/vegetable-ivory/
.com/beads/8mm/vegetable-ivory/
.com/beads/12mm/vegetable-ivory/
As you can see, in this instance there's a need for this kind of support. Not just to grab the page via from the last section of the url. But to take the parent sections (i.e. categories) into consideration first.
Hope this explains the situation well enough, but any questions ask away and hopefully I'll re-explain better.
Thanks in adv.
SEO URLs need to be unique. The simplest solution is to just tack the extra information or a manufacturer item code to it.
.com/6mm-beads/6mm-vegetable-ivory
.com/6mm-beads/vegetable-ivory-sku1698523
.com/6mm-beads/6mm-vegetable-ivory
.com/6mm-beads/vegetable-ivory-sku1698523
-Ryan
I understand the SEO Keyword for each product&category needs to be unique. But what I'm after is the SEO tool to be improved. If the SEO Tool was to consider the parent sections of the url, then each of the following would be classed as a unique URL.
.com/beads/6mm/vegetable-ivory/
.com/beads/8mm/vegetable-ivory/
.com/beads/12mm/vegetable-ivory/
.com/beads/6mm/vegetable-ivory/
.com/beads/8mm/vegetable-ivory/
.com/beads/12mm/vegetable-ivory/
How?
I think you're looking at this backwards by thinking of it as a single string rather than parts that represent something else. It's not:
.com/beads/6mm/vegetable-ivory/
It's:
.com/category_id/category_id/product_id/
So basically you're asking for multiple products that all use the same product_id.
I think you're looking at this backwards by thinking of it as a single string rather than parts that represent something else. It's not:
.com/beads/6mm/vegetable-ivory/
It's:
.com/category_id/category_id/product_id/
So basically you're asking for multiple products that all use the same product_id.
-Ryan
Yes, this is very common. Alot of CMS's / eCommerce platforms support this.
I understand how the current system works. I'm after it to be improved. The url is a string, the code splits this up into sections by the delimeter '/' forming an array of 'sections'. The system only takes into consideration the last section (in this case, the product SEO Keyword). Ignoring any previous 'sections'.
I believe this can be achieved by creating a table for the seo keywords, which contains the following fields.
id, parent_id, id, seo_keyword
This can be used to store the data for categories and products. i.e.
beads cat id = 4
6mm cat id = 6
12mm cat id = 12
product id = 99
parent_id, id, seo_keyword
------------------------------------
0, 4, beads
4, 6, 6mm
4, 12, 12mm
6, 99, vegetable-ivory
12, 99, vegetable-ivory
I'd love to hear Daniels thoughts on this...
I understand how the current system works. I'm after it to be improved. The url is a string, the code splits this up into sections by the delimeter '/' forming an array of 'sections'. The system only takes into consideration the last section (in this case, the product SEO Keyword). Ignoring any previous 'sections'.
I believe this can be achieved by creating a table for the seo keywords, which contains the following fields.
id, parent_id, id, seo_keyword
This can be used to store the data for categories and products. i.e.
beads cat id = 4
6mm cat id = 6
12mm cat id = 12
product id = 99
parent_id, id, seo_keyword
------------------------------------
0, 4, beads
4, 6, 6mm
4, 12, 12mm
6, 99, vegetable-ivory
12, 99, vegetable-ivory
I'd love to hear Daniels thoughts on this...
I completely understand how OpenCart parses it's urls. It splits the url string by the slashes, uses the last segment from the array and looks this up in the Database. Ignoring any of the category seo keywords.
Nope. Categories are not ignored. If they were OpenCart would never be able to generate breadcrumbs, especially with products being able to belong to multiple categories.
/catalog/controller/common/seo_url.php
OpenCart is using the keyword to swap out for appropriate category_id, product_id, information_id and manufacturer_id.
/catalog/controller/common/seo_url.php
OpenCart is using the keyword to swap out for appropriate category_id, product_id, information_id and manufacturer_id.
-Ryan
seo_tool.php
If the url contains a product id, then the product controller is used to load the page.
product/product.php
Where's the category id used there then?
Code: Select all
if (isset($this->request->get['product_id'])) {
$this->request->get['route'] = 'product/product';
product/product.php
Code: Select all
if (isset($this->request->get['product_id'])) {
$product_id = $this->request->get['product_id'];
} else {
$product_id = 0;
}
$product_info = $this->model_catalog_product->getProduct($product_id);
In terms of resolving to the correct Product, christopherdarling is correct - Everything except the last URI segment is ignored (I.e, everything except the Product SEO Keyword). The parts before that have absolutley no affect other than they are there for Google / SEO Purposes, you can test this by going to a product, and when you see the category name in the URL change the category name to something random and the correct product will still load because the last segment of the URL is the product SEO Keyword which is what is used.rph wrote:Oh man, you're embarrassing yourself.
/catalog/controller/common/seo_url.phpchristopherdarling wrote:..prove it? happy to be proved wrong
Code: Select all
foreach ($parts as $part) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE keyword = '" . $this->db->escape($part) . "'");
if ($query->num_rows) {
$url = explode('=', $query->row['query']);
if ($url[0] == 'product_id') {
$this->request->get['product_id'] = $url[1];
}
if ($url[0] == 'category_id') {
if (!isset($this->request->get['path'])) {
$this->request->get['path'] = $url[1];
} else {
$this->request->get['path'] .= '_' . $url[1];
}
}
if ($url[0] == 'manufacturer_id') {
$this->request->get['manufacturer_id'] = $url[1];
}
if ($url[0] == 'information_id') {
$this->request->get['information_id'] = $url[1];
}
}
}
Code: Select all
if (isset($this->request->get['path'])) {
$path = '';
foreach (explode('_', $this->request->get['path']) as $path_id) {
$category_info = $this->model_catalog_category->getCategory($path_id);
if (!$path) {
$path = $path_id;
} else {
$path .= '_' . $path_id;
}
if ($category_info) {
$this->document->breadcrumbs[] = array(
'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $path),
'text' => $category_info['name'],
'separator' => $this->language->get('text_separator')
);
}
}
}
-Ryan
You're confusing what OpenCart needs to load a product (a unique product_id/url_alias) with what it can actually use. Like I said, category_id is used to create breadcrumbs. Set it to a nonsensical category route and you'll see:MWYS wrote:In terms of resolving to the correct Product, christopherdarling is correct - Everything except the last URI segment is ignored (I.e, everything except the Product SEO Keyword). The parts before that have absolutley no affect other than they are there for Google / SEO Purposes
http://demo.opencart.com/index.php?rout ... duct_id=48
-Ryan
So like I said, cat_id / cat url_keyword is completely ignored when loading the product page. Not disputing it being used for the breadcrumbs.. but that's not what this topic is about
Well, what would you suggest then? Any system should:
1) Maintain category information for propagating breadcrumbs and category search filtering,
2) Account for a product being listed in multiple (sub)categories, and
3) Allow for the store to run with and without SEO URLs concurrently.
1) Maintain category information for propagating breadcrumbs and category search filtering,
2) Account for a product being listed in multiple (sub)categories, and
3) Allow for the store to run with and without SEO URLs concurrently.
-Ryan
The last segment of the URL should be unique, otherwise you'll run into problems with mod_rewrite because it's essentially mapping 1 string to 1 product.
You also need to keep in mind that search engines penalise you for duplicate content (see http://googlewebmastercentral.blogspot. ... ntent.html) so having the same product in multiple categories can be a bad idea as most of the content on the page will be the same.
If you're selling a product which comes in 3 sizes, it's really just 1 product with 3 "attributes" so I don't see why you should have 3 URL's to it that describe the size.
I'm working on something for Opencart at the moment which generates a unique SEO keyword for each product by checking the database for existing keywords as the default installation doesn't seem to do this and won't flag up an error when adding a product if the SEO keyword exists. Has anyone looked into this before?
You also need to keep in mind that search engines penalise you for duplicate content (see http://googlewebmastercentral.blogspot. ... ntent.html) so having the same product in multiple categories can be a bad idea as most of the content on the page will be the same.
If you're selling a product which comes in 3 sizes, it's really just 1 product with 3 "attributes" so I don't see why you should have 3 URL's to it that describe the size.
I'm working on something for Opencart at the moment which generates a unique SEO keyword for each product by checking the database for existing keywords as the default installation doesn't seem to do this and won't flag up an error when adding a product if the SEO keyword exists. Has anyone looked into this before?
There's been a bit of discussion about using canonical URLs to deal with the issue.Chris P Duck wrote:You also need to keep in mind that search engines penalise you for duplicate content (see http://googlewebmastercentral.blogspot. ... ntent.html) so having the same product in multiple categories can be a bad idea as most of the content on the page will be the same.
Not that I'm aware of. The current version is a little rough. It doesn't even check for illegal characters in the URL alias which has led to a few problem threads already. Not a big deal if you know what you're doing but I've seen some inexperienced users make some really bad SEO choices.I'm working on something for Opencart at the moment which generates a unique SEO keyword for each product by checking the database for existing keywords as the default installation doesn't seem to do this and won't flag up an error when adding a product if the SEO keyword exists. Has anyone looked into this before?
-Ryan
Who is online
Users browsing this forum: edkny and 127 guests