You are here:  » showing ' in product names

Support Forum



showing ' in product names

Submitted by mally on Fri, 2009-11-20 23:59 in

Hello David

I've got a new version of price tapestry involved and when I've installed a feed I've noticed the product name showings the apostrophe '

Where/how does this get stripped? I don't think its working at the moment.

Thanks Mally

Submitted by support on Sat, 2009-11-21 08:11

Hi Mally,

The new version holds both the full name (which can contain the apostrophes) and a URL safe version from which the apostrophe will be stripped. If you don't want it included in the display version, you could use a Search and Replace filter on the Product Name field, or alternatively to globally remove apostrophes for all feeds, look for the following comment on line 186 of includes/admin.php:

/* apply user filters */

...and ADD the following code immediately prior to that point:

$importRecord["name"] = str_replace("'","",$importRecord["name"]);

Hope this helps!

Cheers,
David.

Submitted by mally on Sat, 2009-11-21 15:13

Hello David

Thansk for the above.

I installed the new version, but added an old template of mine.

Is there an easy way to modify my old template to make the urls work with the ' and other characters that may be in the product name? thanks Mally

Submitted by support on Sun, 2009-11-22 13:35

Hi Mally,

It sounds like the template may be using the product name within attributes etc. where the apostrophe is interfering with the HTML. To fix this; wherever you have, for example:

print $product["name"];

...change it to:

print htmlentities($product["name"],ENT_QUOTES,$config_charset);

That should be all it is...

Cheers,
David.

Submitted by mally on Sun, 2009-11-22 23:18

Hi David

Still got an issue. The site I'm talking about is mountain bike

See this page to see some of the errors. http://www.mountainbike.co.uk/category/BikesBike-Wheels-Tyres-amp-Inner-TubesBike-Wheels-Rim-tape/ The main issue is the url is actually not working.

Submitted by support on Mon, 2009-11-23 10:06

Hi Mally,

Ah - they're entity encoded rather than appearing literally, however they should still display correctly. Could you please email from that site:

search.php
products.php
html/searchresults.php

..and I'll check it out...

Cheers,
David.