It seems that Shopware has some "magic behind" when generating URLs and i am looking for someone, who can explain this to me.
This is the code of standard-template to generate SEO-urls with variables which can be configured in SEO-router-settings in the backend:
{* Product name *}
{block name='frontend_listing_box_article_name'}
<a href="{$sArticle.linkDetails|rewrite:$sArticle.articleName}"
class="product--title"
title="{$sArticle.articleName|escape}">
{$sArticle.articleName|truncate:50}
</a>
{/block}
The configuration in SEO-router-settings looks like this per default:
Anyway, the output is little different:
http://www.DOMAIN.de/shop/CATEGORYNAME/18/PRODUCTTITLE?c=7
(All capital letters demonstrates real correct domain-, category- and product-names, that are hidden here for the sake of privacy of my client)
The issue here is the URL-Parameter "?c=7" which isn't wanted and should be omitted as defined in SEO-router-options.
First question: how to omitt this URL-parameter "c=7" at the end of URL?
When i debug this code, i run into strange things. The following code will result in two different URLs although it is the same term executed:
These are the issues here:
Second question:
How can the same template-code be so different? What magic is there working behind the scenes?
I'm sure you are familiar with Shopware backend. See my answers in short:
Set 'Remove CategoryID from Url = No' at Seo/router settings. Then clear cache.
You can see the connection between those 2 links at "s_core_rewrite_urls" table. Just backup the table & empty it. Click on Configuration > Cache/performance menu item and do "Rebuild SEO URL index".
More info available at https://developers.shopware.com/blog/2015/08/11/the-shopware-seo-engine/