You are here:  » Removing Quotes from Product Description


Removing Quotes from Product Description

Submitted by SimonK on Mon, 2011-03-07 13:28 in

Am importing a datafeed that has double quotes (") around the product description.

Am trying to set a 'search and replace' filter to search for " and replace with nothing.

However, as soon as I save the filter it changes the " to \"

What do I need to enter please?

Thanks.

Submitted by support on Mon, 2011-03-07 14:24

Hi Simon,

The first thing that it might imply is that the feed format auto-detection on Feed Registration Step 1 did not pick up the quoted text. This can happen if the header row is not quoted for example, so it might be worth trying re-registering the feed and selecting the correct format from the drop down box, e.g. Quoted Text - Header Row - Comma Separated.

That should resolve it; however the reason the Search and Replace filter is not working is because of small error in one of the files in the earlier distribution that you are running - I will email you the correct for this straight away that will enable you to use the " character within the Search and Replace filter...

Cheers,
David.
--
PriceTapestry.com

Submitted by SimonK on Mon, 2011-03-07 15:49

Thanks David.

The file you sent didn't work. And I'm running the latest release. But I've just copied that file from an older site I have (12 months old) and it does work now. Has a bug crept back into the latest release perhaps?

I'm all sorted now anyway :-)

Submitted by support on Mon, 2011-03-07 15:58

Ooops yes - thanks!

All corrected in the distribution.

Cheers,
David.
--
PriceTapestry.com

Submitted by ssgupta on Tue, 2011-03-08 06:03

I too have this problem. Can you inform which files need updating. Thanks.

Submitted by support on Tue, 2011-03-08 09:02

Hi ssgupta,

If you're having trouble using the " character within a filter, the fix is in includes/widget.php which you can extract from the latest distribution...

Cheers,
David.
--
PriceTapestry.com

Submitted by Actual on Mon, 2014-03-24 22:21

Hi David,

Hope you can help with a problematic XML feed from Linkshare. I have other XML feeds from Linkshare that work just fine, but this one from Amara:

{link saved}

seems to have quotes around the names and descriptions which I have tried to remove with filters and search/replace (with no luck).

There is no TXT/CSV feed so I am stuck with this one.

Any ideas?

Steve.

Submitted by support on Tue, 2014-03-25 09:12

Hi Steve,

The quotation marks (and other characters) are HTML entity encoded in the data. Whilst Search and Replace filters could be used against the actual entities (for example " for ") it's probably easiest if you add the new HTML Entity Decode filter to your includes/filter.php as described in this comment.

Then add a new instance of that filter to the Description field for this feed, re-import, and then you can add additional Search and Replace filters using the exact text or characters that you're seeing and wish to remove without having to work out the entities at all.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Actual on Tue, 2014-03-25 22:34

Thanks David. I've added that new filter to product name/description/category/brand, applied it, then applied search & replace for those fields with " and I still end up with zero products. Any other ideas?

Steve.

Submitted by support on Tue, 2014-03-25 22:44

Hi Steve,

That's strange - the filters shouldn't materially affect the import - please could you check by removing the filters against this feed that import returns to normal (except that unwanted characters are imported)?

If that works as expected, if you could then apply the new HTML Entity Decode filter to the Product Name field only, followed by a Search and Replace filter, searching for " (quotes, literal) and replace with nothing, then re-import and let me know if that then causes the zero import for this feed....

Cheers,
David.
--
PriceTapestry.com

Submitted by Actual on Wed, 2014-03-26 21:48

Ahh, I guess I didn't explain properly. With NO filters setup whatsoever, I get 0 products imported. The filters don't make any difference to that. I assume the errant characters (" and whatnot) are messing with the actual import process.

Steve.

Submitted by support on Thu, 2014-03-27 09:49

Hi Steve,

Ah - it looks like it may be a mis-registration, in that at least one of the required fields (Product Name, Buy URL and Price) is empty for all records.

I just checked the feed that you provided the link for previously, and I it most likely the Price field, as the actual price is in a child element of the PRICE element, however PRICE would have auto-detected. The correct field should be PRICE/SALE, so I think that may be all it is. Once importing, you'll be able to go on and use the filters as described above to treat the quotation marks as required.

Cheers,
David.
--
PriceTapestry.com

Submitted by Actual on Fri, 2014-03-28 00:59

As usual, you were spot on. That's exactly what the problem was. Thanks so much.

Steve.