You are here:  » Dupe_hash for a free text field


Dupe_hash for a free text field

Submitted by CashNexus on Fri, 2022-05-27 11:18 in

Hello David,
hope you're personally doing well in spite of your decision do not maintain PT more...
Long story with PT :) and still the best parsing script (IMHO).

Let me ask you a question about dupe_hash - now in /includes/admin.php we have

$dupe_key = $importRecord["merchant"];
$dupe_key .= tapestry_mb_strtolower($searchName);

What if I want also add for my own created field to dupe_hash, for example
feedid varchar(16)
?

From very old (2006 !) https://www.pricetapestry.com/node/541 it could be like
$dupe_key .= $record[$admin_importFeed["field_name"]];

Does such an idea still works with more contemporary version of PT (as I see now you use a varialble like $searchName) ?
Could I use here
$dupe_key = $importRecord["feedid"];
?

Thanks in advance for your explanation,
Best regards,
Serge

Submitted by support on Mon, 2022-05-30 08:39

Hello Serge,

As long as "feedid" is a field in the feed being imported as appears in the Sample Data shown below the form on Feed Registration Step 2 then you can use:

 $dupe_key .= $record["feedid"];

The above would be for 01/06A (which doesn't use a $importRecord variable) or any later distribution as $importRecord only contains fields from $record that are due to be imported rather than the full $record. Make sure to use the .= (append) operator to combine the field with other components of $dupe_key...

Cheers,
David.
--
PriceTapestry.com

Submitted by CashNexus on Mon, 2022-05-30 17:51

Thank you very much, David !
I've got your hint and tested, everything is OK,
Best regards,
Serge