You are here:  » Hyphen in Merchant name


Hyphen in Merchant name

Submitted by Ride on Thu, 2017-07-06 22:32 in

Hi David,
I have a few merchants with an hyphen in their name, unfortunately PT does not accept that, when I register a feed and use the name with an hyphen I get the "Invalid characters" error.
There's a way to use a merchant name with an hyphen, like merchant-site.com?
Thank you!

Submitted by support on Fri, 2017-07-07 07:20

Hi,

The ASCII hyphen/minus sign is used in clean URLs in place of space which is why it is not permitted in the merchant name but you can use the UTF-8 hyphen instead, copy and paste from the code area below directly into the Merchant Name field on Feed Registration Step 2 and that should do the trick:

Cheers,
David.
--
PriceTapestry.com

Submitted by Ride on Fri, 2017-07-14 16:24

Hi David,
this works perfectly, but now I'm having the same issue with another merchant who has an ampersand (&) in its name.
Where can I find a table of UTF-8 encoded characters so I don't have to ask you every single time? I tried to search on google but none of the copy and pasted characters worked.
Thank you!

Submitted by support on Mon, 2017-07-17 07:19

Hi,

Because "&" has a special meaning within the query part of a URL i've always avoided using it in order to prevent any possible issues with search engines or rewrite however it should actually be safe to use, it's only the normalisation regular expression that is preventing it so if you wanted to enable "&" for use in merchant and other names, edit config.advanced.php and look for the following setting at line 90:

  $config_normaliseRegExp = "A-Za-z0-9".chr(0x80)."-".chr(0xFF)." \.";

...and REPLACE with:

  $config_normaliseRegExp = "A-Za-z0-9".chr(0x80)."-".chr(0xFF)." \.&";

You'll then be able to register a merchant name with "&" in the name. Regarding other UTF-8 characters that could be used as replacements for the restricted ASCII range, check out this reference at w3schools.com

https://www.w3schools.com/charsets/ref_html_utf8.asp

Hope this helps!

Cheers,
David.
--
PriceTapestry.com