You are here:  » Cleansing 2+ spaces from product names


Cleansing 2+ spaces from product names

Submitted by jamie on Tue, 2017-02-07 20:56 in

Hello David,

Following on from this solution:

http://www.pricetapestry.com/node/6089

I have commented out line 231 to stop the import replacing 2+ 'spaces' with a single 'space' from product names in my WP installation.

However, it seems in WP this fix does not seem to work.

Do you have any idea why this would be please - is there somewhere else that cleanses product names prior to import?

If it helps, whilst I am registering the feed, the product name has already been cleansed even prior to the actual import.

Many thanks for your help,
Jamie

Submitted by support on Wed, 2017-02-08 09:59

Hi Jamie,

If you are referring to the product name used in URLs, it is the normalised_name field and that has double spaces removed by way of the tapestry_normalise() function. To prevent this removal also, edit includes/tapestry.php and look for the following code at line 26:

    $text = preg_replace('/[ ]{2,}/',' ',$text);

...and either comment out or delete, and then re-import.

Cheers,
David.
--
PriceTapestry.com