You are here:  » Full stops being ignored


Full stops being ignored

Submitted by nate on Sat, 2006-10-28 15:17 in

Afternoon,

Just getting started with PT and I've noticed that when importing datafeeds (from Affiliate Window), any .'s in the product name or description are being ignored (ie. 1.0gb shows as 10gb).

Is this a known issue or is there a way to stop this?

Cheers,

Nate

Submitted by support on Sat, 2006-10-28 15:31

Hello Nate,

Full stops are removed from the product name as part of the "Normalisation" function which aims to make sure that all product names are completely safe for use in a URL. In this instance, it may be worth enabling full stops in the product name which you can do as follows. In includes/admin.php find the following code on line 157:

    $record[$admin_importFeed["field_name"]] = tapestry_normalise($record[$admin_importFeed["field_name"]]);

...and change it to:

    $record[$admin_importFeed["field_name"]] = tapestry_normalise($record[$admin_importFeed["field_name"]],"\.");

That will permit the full stop in the product name, but check carefully for any side effects - I think you'll be OK though.

Cheers,
David.

Submitted by nate on Sat, 2006-10-28 15:48

Thanks David, that worked great for indexing them.
However, this will not return any results in a search. (Who searches for 1.0gb anyway? What a stupid product name)

I was thinking, would there be any way to remove any .0's on import(So 1.0gb becomes 1gb) without a big script re-write?

Thanks again,

Nate

Submitted by support on Sat, 2006-10-28 16:51

Hi,

You should be able to do that using a Search and Replace filter now that the full stop is not being removed.... Search for ".0" replace with "" (empty string)...

Cheers,
David.

Submitted by nate on Sun, 2006-11-05 16:19

Thanks for that. All working OK now.

Would other characters need to be added to that list in order for them to not be ignored? Ie. I'm looking to allow the " and & symbols.

Submitted by support on Sun, 2006-11-05 16:28

Hi,

Yes - you can add most characters to the list. If you try adding a character and get an "invalid regexp" error, you will need to preceed it with a backslash as this indicates that the character is relevant within a regular expression!

Cheers,
David.

Submitted by nate on Wed, 2006-11-08 14:32

Hi David,

I've tried adding more characters to the list, but they still do not appear to be being allowed and I'm getting no errors when re-importing the feeds.

The line you referred to now looks like this, with all the other characters I've tried to allow.

$record[$admin_importFeed["field_name"]] = tapestry_normalise($record[$admin_importFeed["field_name"]],"\.","\"","&","\/","-");

I've tried to allow the following characters;

", &, / and -

Submitted by support on Wed, 2006-11-08 14:37

Hi,

The additional parameters need to go in a single string rather than separate values - have a go with this:

$record[$admin_importFeed["field_name"]] = tapestry_normalise($record[$admin_importFeed["field_name"]],"\.\\&\/-");

Cheers,
David.

Submitted by Jannii on Tue, 2006-11-28 02:58

Hi David,

Quite a few of the feeds I use seems to have commas and ampersands in the product names. I've used the method above to allow them but with friendly urls switched on it means nothing shows up in the product results. Could you give me a clue how to change the search results/product code so that the symbols show in the text of the link but are ignored when building the actual URL so it finds the product details ?
Also is there any way I can allow a bullet point in a description as a couple of my smaller feeds use them so the import fails after the first record and other feeds have HTML tags such as and in the descriptions. These import ok but obviously don't resolve as new paragraph or italics. Would this need some sort of filter to remove them ?

Thanks

Jan

Submitted by support on Tue, 2006-11-28 09:02

Hi Jan,

Because of the simple way in which Price Tapestry works i'm afraid it is not straight forward to use non url-safe characters such as ampersand in the product name I'll study the code and see what would be required; however in the mean time some users make the modification to allow ampersand and then use search and replace to convert it into "and" which may be an option for you.

With regards to using HTML in the description; you can enable this by removing the call to strip_tags() which is on line 161 of includes/admin.php...

$record[$admin_importFeed["field_description"]] = strip_tags($record[$admin_importFeed["field_description"]]);

If you comment out that line; HTML will then be permitted within the product description.

Cheers,
David.

Submitted by Jannii on Tue, 2006-11-28 20:34

Thanks again.