You are here:  » Product Mapping dilema

Support Forum



Product Mapping dilema

Submitted by nateflint on Tue, 2012-03-06 17:01 in

First awesome product & support THANKS!

I am working on a site for products in the action sports industry, so each year a brand comes out with a new version of each model, and I want to have a page for each model that list out all available sizes and years of each model. So I started creating product mappings for each {Brand} {Model} {Type} example:
Gnu Park Pickle Snowboard

However now I only get one product from each merchant, even though some merchants have 3 different years of the Park Pickle snowboard and in some case merchants have a different product record for each board size. (they do this cause some times different sizes of the same model has different graphics )

I would to prevent loosing these extra product model records, any advice??

Also when I add a default image for a product mapping it applies that image to every product that it includes in the mapping. I would like the default image to be used when displaying the product in a list, and the general desc but not for each product in the comparison table? Maybe an option in the product mapping UI to select if you want the default image to override all related records or just use for listing/display purposes.

Thanks

Submitted by support on Wed, 2012-03-07 09:40

Thanks for your comments!

The first step to supporting multiple versions of the same product from the same merchant would be to remove the unique index on the dupe_hash field in the database which is how duplicate products are prevented from being imported.

To do this, create a file called drop.php in the top level folder of your Price Tapestry installation containing the following code:

<?php
  
require("includes/common.php");
  
$sql "DROP INDEX dupe_filter ON `".$config_databaseTablePrefix."products`";
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

Then browse to drop.php, and when it displays "Done." re-import all products. A few more small changes will probably be required but see how things look having done this step and then see where you want to take it from there...

If you want to avoid the product mapping custom image overwriting all product records; what you could do is first look for the following code in includes/admin.php at line 309:

if ($admin_importProductMappingsOverrides[$importRecord["name"]]["image_url"]) $importRecord["image_url"] = $admin_importProductMappingsOverrides[$importRecord["name"]]["image_url"];

...and either comment out or delete that line.

Next, the custom image URL field would have to be re-queried on the product page. To do this, edit html/product.php and add the following new code right at the top of the file:

<?php
  $sql 
"SELECT * FROM `".$config_databaseTablePrefix."productsmap` WHERE name='".database_safe($product["products"][0]["name"])."'";
  if (
database_querySelect($sql,$rows))
  {
    
$product["products"][0]["image_url"] = $rows[0]["image_url"];
  }
?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com