You are here:  » Finding where feeds are mapped to


Finding where feeds are mapped to

Submitted by LeadFoot on Fri, 2015-07-10 18:28 in

I'm having a hard time getting my feeds mapped the way I want. I have about 10 feeds from manufacturers, with something like 30K products (I've bitten off too much).

I go to my brand page, and find a blue widget there, under a specific brand.
I go to my category hierarchy, and look in the blue widget category, but it's empty.
Looking in categories_hierarchy_reverse.php for unmapped categories, and there is nothing that is unmapped.

So:
1. How do I tell what category the blue widget is in?
2. Can I list this category on the blue widget product page?
3. How can I look at this merchant's feed, and see all the category hierarchy categories that it's mapped to?
4. Is there a way to see all the advertiser categories associated with a feed?

Thank you!

Submitted by support on Sat, 2015-07-11 10:20

Hi LeadFoot,

I think from your comment in node 5545 (which I just followed up to) you have discovered how to show the category hierarchy path on the product page but let me know if you're still not sure of course.

To see which which categories are associated with a particular merchant, if you view the merchant search results by navigation from the Merchant A-Z page for example on this page (demo site) you can see all the categories associated with that merchant from the Category filter.

To study all feed categories for a given feed, use the Imported Analysis tool for that feed and click the Category heading when browsing the data to view the complete list.

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by LeadFoot on Sun, 2015-07-12 00:08

Thank you, I'm starting to get my head wrapped around this. I looked at your release announcement, and this part in particular got my attention:
"an option to use Reverse Mapping restricted by merchant is available"
That sounds pretty helpful

Ultimately I'm having problems mapping advertiser feeds to categories that I create, then adding filters to the correct feed (limit items). Once products from multiple feeds are imported it's difficult to tell which feed is bringing in items I'd like to delete. I'm trying to find a way to import products from a feed, add filters, then delete all products (without deleting the feed or filters) so that I can go on and work on the next feed. When I'm done I can the just re-import all the feeds. Is there a way to easily delete all products from a feed?

Another thing that I don't understand, is that if I have created a category and map products to that category, they'll show up fine, but if I create a sub category, the items don't show up any more - I just see the sub categories.

Thank again, and sorry for all the questions.

Submitted by support on Mon, 2015-07-13 09:03

Hi,

If you have a one-to-one merchant to feed mapping then the easiest way to identify which feeds a product has come from is the price comparison table on the front end. However, the `filename` field of each product record is in context at this point, so if you have multiple-merchant feeds, or multiple feeds for the same merchant then one easy thing to do would be to display the filename in the price comparison table if you are logged in to /admin/, which can be detected by the presence of the 'admin' cookie, so if you wanted to try this, in html/prices.php look for the following code at line 63:

<?php endif; ?>

...and REPLACE with:

<?php endif; ?>
<?php if (isset($_COOKIE["admin"])) print $product["filename"]; ?>

To delete all products from a feed, without renaming and then de-registering you could re-register and use the Register only function from Feed Registration Step 2, however it it is straight forward to make a purge script to delete all products from a feed. Create the following new file in your installation as admin/feeds_purge.php:

<?php
  
require("../includes/common.php");
  
$admin_checkPassword TRUE;
  require(
"../includes/admin.php");
  
$filename = (isset($_GET["filename"])?$_GET["filename"]:"");
  if (
$filename)
  {
    
$sql "DELETE FROM `".$config_databaseTablePrefix."products` WHERE filename='".database_safe($filename)."'";
    
database_queryModify($sql,$result);
    
$sql "UPDATE `".$config_databaseTablePrefix."feeds` SET products='0' WHERE filename='".database_safe($filename)."'";
    
database_queryModify($sql,$result);
  }
  
header("Location: ".$config_baseHREF."admin/");
  exit();
?>

Then edit admin/index.php and look for the following code at line 158:

  print "</td>";

...and REPLACE with:

  admin_tool("Purge","feeds_purge.php?filename=".urlencode($filename),TRUE,FALSE);
  print "</td>";

And that will add a "Purge" button alongside each feed to the /admin/ home page for you to quickly delete all products from a feed.

Regarding re-mapping of categories once sub-categories have been added, I am aware of the requirement for this feature so I am currently developing an extension to the Category Hierarchy Mapping tool to support this - I will update the beta release announcement thread shortly regarding this.

Cheers,
David.
--
PriceTapestry.com

Submitted by LeadFoot on Tue, 2015-07-14 17:08

Thank you so much for your help David.
I've upgraded to 15/09A (Beta)

1. (isset($_COOKIE["admin"])) - doesn't seem to be working for me. I've tried with and without an admin password. Just showing filename works fine and is a great solution, but the cookie check doesn't seem to work. It hides from everyone, even the admin.

2. Thank you! this worked great.

3. I'm not sure I understand what you mean by re-mapping of categories, but it sounds like this is something on the horizon.

Submitted by support on Wed, 2015-07-15 08:37

Hello LeadFoot,

My apologies, the admin cookie is not set with a path parameter so is only in scope within the /admin/ folder however you can change this easily if you wish to conditionally display the filename only when logged in to /admin/ (you will need to have a password enabled).

To do this, edit admin/login.php and look for the following code at line 23:

  setcookie("admin",md5($remoteAddr.$config_adminPassword));

...and REPLACE with:

  setcookie("admin",md5($remoteAddr.$config_adminPassword),0,$config_baseHREF);

Regarding Category Hierarchy tools to aid in re-mapping after adding new sub-categories, for example let's say you originally had the hierarchy:

Home Entertainment > Hi-Fi

...and had lots of products mapped into the Hi-Fi sub-category.

At a later date, let's say you wanted to further sub-categorise these products s follows:

Home Entertainment > Hi-Fi > Amplifiers
Home Entertainment > Hi-Fi > CD Players
Home Entertainment > Hi-Fi > Tuners

The tool would let you easily view products currently mapped into "Hi-Fi" and let you re-map into the appropriate new sub-category...

Cheers,
David.
--
PriceTapestry.com