Sitemap generation missing currency prefix

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Sitemap generation missing currency prefix

Post by createanet » 11 Oct 2021, 08:01

Morning,

I notice when the job "product/export/sitemap" is executed, there are failures reported for our configuration.

Code: Select all

Missing required parameter for [Route: aimeos_shop_detail] [URI: {currency} 
  /{d_name}/{d_pos?}/{d_prodid?}] [Missing parameter: currency].               
I can see that currency is never merged into the $params for the target URL.

My shop config is setup to use the following prefix

Code: Select all

[
	'default' => [
		// abbreviated...
		'prefix' => '{currency}',
		'where' => ['currency' => '(?i)eur|usd|gbp(?-i)'],
	]
]
As the "aimeos_shop_detail" falls under the "default" group, currency is a required prefix but the URL generation is neglecting to use or fallback to an appropriate default is missing - the latter I dont think is possible without passing through some middleware and applying to the request?

My URL take the following shape, where I have a regular expression that confirms the currency prefix matches an array of those supported and ignores the case sensitivity.

Code: Select all

/gbp/demo-article
If I make the prefix optional the error goes, but this obviously isnt intended as the generator now constructs invalid URLs.

Thanks in advance

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Sitemap generation missing currency prefix

Post by aimeos » 12 Oct 2021, 16:33

That's a problem indeed. The sitemap XML export doesn't use currencies nor different sites in the URLs.
The solution may be to generate URLs for all site/language/currency combinations added in the Locale tab.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply