You are here:  » Question about product in multiple categories

Support Forum



Question about product in multiple categories

Submitted by DanielWestman on Mon, 2009-01-26 18:21 in

Hi,
I just bought PT and I´ve been in contact with you David before about having a product in multiple categories.
I have some products that fits into two different categories, is it possible for them to show up in both categories without showing up multiple times in the search results?

I´ve read the thread below about products in multiple categories but I couldn´t make any sense of it.
http://www.pricetapestry.com/node/2207

Submitted by support on Mon, 2009-01-26 18:38

Hi Daniel,

I think node 2207 describes a similar situation.

In my last email to you, I mentioned that it would be possible to add the category field to the duplication check filter; so provided that the product is in your feeds with with an entry "per category" (i.e. more than once); then thinking about it that should be sufficient; as the search queries are already GROUPing by name; so they should not appear multiple times.

To do this, in includes/admin.php you will find the following block of code beginning at line 248:

    /* create dupe_hash value */
    $dupe_key = $admin_importFeed["merchant"];
    // uncomment any additional fields that you wish to filter duplicates on (description not recommended)
    $dupe_key .= $record[$admin_importFeed["field_name"]];
    // $dupe_key .= $record[$admin_importFeed["field_description"]];
    // $dupe_key .= $record[$admin_importFeed["field_image_url"]];
    // $dupe_key .= $record[$admin_importFeed["field_buy_url"]];
    // $dupe_key .= $record[$admin_importFeed["field_price"]];
    $dupe_hash = md5($dupe_key);

..so to add the category, REPLACE the above with:

    /* create dupe_hash value */
    $dupe_key = $admin_importFeed["merchant"];
    // uncomment any additional fields that you wish to filter duplicates on (description not recommended)
    $dupe_key .= $record[$admin_importFeed["field_name"]];
    $dupe_key .= $record[$admin_importFeed["field_category"]];
    // $dupe_key .= $record[$admin_importFeed["field_description"]];
    // $dupe_key .= $record[$admin_importFeed["field_image_url"]];
    // $dupe_key .= $record[$admin_importFeed["field_buy_url"]];
    // $dupe_key .= $record[$admin_importFeed["field_price"]];
    $dupe_hash = md5($dupe_key);

You will need to import any affected feeds again before this takes effect...

Hope this helps!

Cheers,
David.