I am using the Amazon Search Widget as provided by the Amazon Partnernet.
<
<script type="text/javascript">amzn_assoc_ad_type ="responsive_search_widget";
amzn_assoc_tracking_id = "wwwsupernasen-21";
amzn_assoc_marketplace = "amazon";
amzn_assoc_region = "DE";
amzn_assoc_placement = "";
amzn_assoc_search_type = "search_widget";
amzn_assoc_width = "auto";
amzn_assoc_height = "auto";
amzn_assoc_default_search_category = "DVD";
amzn_assoc_default_search_key = "David Hasselhoff"; // <= ***** IMPORTANT LINE HERE *****
amzn_assoc_theme = "dark";
amzn_assoc_bg_color = "000000"; < /script><script src="//z-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1&Marketplace=DE"></script>
I want to pre-populate the search term with a multi-word string (including spaces, like the name above), using the key amzn_assoc_default_search_key. It works great for single words, but when it includes spaces, those are encoded and appear inside the widget search form as "David%20Hasselhoff". This then breaks the search and there will be no results displayed.
See full behavior:
https://jsfiddle.net/wrvz2fjo/
Is this a bug and/or did anyone find a workaround?
Real life example of the broken widget: https://www.diesupernasen.de/person/tommy