You are here:  » Name case filter

Support Forum



Name case filter

Submitted by Bob on Tue, 2007-02-20 15:38 in

Hi there,

I have tried to use the 'Name Case' filter against the brand names field but for some reason the filter is not producing desired effects. The brand names are still printing capital letters after the first letter. Any ideas what's causing this situation?

Many Thanks.

Bob

Submitted by support on Tue, 2007-02-20 15:51

Hello Bob,

The Name Case filter uses PHP's ucwords() function which although capitalises the first letter of each word leaves all other letters unchanged.

If you want to change the behavior of the Name Case filter on your Price Tapestry installation, all you need to do is insert a strtolower() function inline with ucwords(). In includes/filter.php look for the following function (starting at line 124):

  function filter_nameCaseExec($filter_data,$text)
  {
    return ucwords($text);
  }

Change this as follows:

  function filter_nameCaseExec($filter_data,$text)
  {
    return ucwords(strtolower($text));
  }

That should do the trick!
Cheers,
David.

Submitted by Bob on Tue, 2007-02-20 17:24

Thanks a lot David.

Submitted by mally on Sat, 2008-05-24 05:15

Hello David

Is there a way I can make this happen as soon as the feed is installed, before product mapping and any filters are applied?

Thanks

Mally

Submitted by support on Sat, 2008-05-24 08:10

Hi Mally,

If you make it the first filter then it should be applied before anything else... All filters are applied before product mapping by default...

Cheers,
David.

Submitted by philstone on Mon, 2008-06-16 14:13

Hi David

Was wondering about "Name Case", anytime i try to apply this filter i get this error

Warning: Invalid argument supplied for foreach() in /home/buy247/public_html/admin/feeds_filters.php on line 136

was wondering if you had any remedies for this?

thanks

phil

Submitted by support on Mon, 2008-06-16 14:17

Hi Phil,

Is it just Name Case that causes this?

Could you email me your admin/feeds_filters.php and i'll take a look for you....

Cheers,
David.