You are here:  » Search and Replace Filter

Support Forum



Search and Replace Filter

Submitted by paddyman on Mon, 2007-01-22 23:39 in

Hi David,

One more question for tonight if you don't mind.

Have a product in my feed

Western Digital 250GB "My Book" Premium 1C External Hard Drive USB2.0/Firewire

This is the way its coming out once feed is registered

Western Digital 250GB My Book Premium 1C External Hard Drive USB2.0Firewire

Want to change to

Western Digital 250GB My Book Premium 1C External Hard Drive USB2.0 and Firewire

Tried a search and replace

Search : USB2.0/Firewire & "USB2.0/Firewire"
Replace: USB2.0 and Firewire & "USB2.0 and Firewire"

and none of the variations worked, after import.

Replaced Western with another word just to test filters and worked perfectly.

Also would like to change 2.5" to 2.5 inch in another product name.

Am I doing something wrong?

Thanks

Paddyman

Submitted by support on Tue, 2007-01-23 06:02

Hi,

What's happening is that the / and " characters are being stripped from the product name before you get the chance to change them using the filter. These characters are stripped on line 157 of includes/admin.php:

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

To allow the required characters through the normalisation function; change this code as follows:

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

Hope this helps,
Cheers,
David.

Submitted by paddyman on Tue, 2007-01-23 18:13

Hi David,

Thanks for that.

/ character is now sorted but " character is still being stripped. Heres my code. Have also excluded the full stop.

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

Here's my product in the feed

Western Digital 80GB Passport V2 External USB 2.0 2.5" Hard Drive

And after import

Western Digital 80GB Passport V2 External USB 2.0 2.5 Hard Drive.

Any idea where I'm going wrong or what I'm missing.

Thanks

Submitted by support on Tue, 2007-01-23 18:29

Hi,

I just tested on my dev server and it seemed to work correctly; allowing " into the product name. Can you email me over your includes/admin.php and i'll take a look (reply to your reg code or forum registration email is the easiest way)....

Cheers,
David.

Submitted by tonypearce on Thu, 2011-07-21 11:35

Hi,
old thread, but is this possible on the newest version on products and category names as well?

need to let some chars that are being stripped through the system...

would save loads of time ;-)

Cheers
Tony

Submitted by support on Thu, 2011-07-21 11:44

Hi Tony,

Bear in mind that since 11/09A a separate normalised version of the product name (normalsied_name) is created for use in URLs, the main name field is no longer normalised so all characters should be appearing in the displayed versions of names.

For category fields, the equivalent code is now line 189;

      $importRecord["category"] = tapestry_normalise($importRecord["category"]);

...so you can permit additional characters in the second optional parameter to the tapestry_normalise() function, e.g.

      $importRecord["category"] = tapestry_normalise($importRecord["category"],"%");

(to permit the % character) - additional characters can be included in the list as per above..

Cheers,
David.
--
PriceTapestry.com

Submitted by tonypearce on Thu, 2011-07-21 12:03

Thants great, now I can find and replace to get a better url as when these are removed it joined words togther...

Thanks for you unfailing support,
Gold Star..