You are here:  » Use field 'search_name' as clickref in affiliate link

Active Forum Topics


Use field 'search_name' as clickref in affiliate link

Submitted by nanaz on Fri, 2019-05-10 11:01 in

Hi David,

I hope you're okay!

Is it possible to register (by using the Search and Replace filter) the field 'search_name' as a clickref in an affiliate url? It works with other fields but not with this one.

For instance I register the feed url with clickref parameter r=XXXXX:
https://pf.something.net/?aid=0&encoding=utf-8&type=xml-v2&fid=0&productFeedCategoryHash=0&r=XXXXX&categoryType=2&additionalType=2

Then use search and replace filter in Buy url:
XXXXX = %search_name%

and import.

Hope you can help!

Cheers, Marlies

Submitted by support on Fri, 2019-05-10 12:02

Hello Marlies,

search_name is made from the normalised_name with spaces removed. As it isn't constructed until after filters have been applied what you could do is add an equivalent value to $filter_record so that you can use %search_name% in a Search and Replace filter. To do this, edit includes/admin.php and look for the following code at line 241:

    $filter_record = $record;

...and REPLACE with:

    $filter_record = $record;
    $filter_record["search_name"] = tapestry_search(tapestry_normalise($importRecord["name"]));

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by nanaz on Sat, 2019-05-11 08:37

Hi David,

Sorry to say it doesn't work... during import an error flies by saying 'Undefined variable in includes/admin.php on line 155'. I Have tried it on 2 installations but the outcome is the same.

Also the code $filter_record = $record; in my admin.php is on line 154, not on line 241. I am using PT 16/10A.

Cheers, Marlies

Submitted by support on Sat, 2019-05-11 10:29

Hello Marlies,

For 16/10A, undo the above modification and then instead, look for the following code at line 246:

    $filter_dropRecordFlag = FALSE;

...and REPLACE with:

    $filter_dropRecordFlag = FALSE;
    $filter_record["search_name"] = tapestry_search(tapestry_normalise($importRecord["name"]));

Cheers,
David.
--
PriceTapestry.com