Active Forum Topics

How To Allow Duplicate Product Names For Single Merchant

Submitted by keshavkshirsagar on Fri, 2015-09-04 13:01 in Price Tapestry

Hello Sir

How We Can Allow Duplicate Product Names

I have CSV's With Same Product Name though they have different (Diff Price according to Product Color,Product Images)

I would like to modify the code to check the duplication as a combination of product name and product id. I have read the forum, but could you help me with the code changes in the pages. Also we need the product name to remain unchanged as it would affect the mapping if the name is modified.

The easiest way to allow duplicate products per merchant is to drop the dupe_filter unique key which is the mechanism through which the duplicate prevention is implemented. To do this, simply run the following dbmod.php script in the top level folder of your Price Tapestry installation, delete the file, and then re-import all feeds to allow the duplicates in:

Notice that both scripts TRUNCATE (empty) the products table first, so after running the scripts there will be no products on your site and a full import will be required (this won't affect your product mapping at all, that all stays in place in other tables...)

Product Mapping will be applied to all instances of the same product name for the same merchant, so there will still only be 1 price comparison page for the product name, but it may contain multiple entries for the same merchant, that's all.

if you have added custom fields to your site and furthermore added columns for the custom fields to the price comparison table (html/prices.php) then this is where users would be able to differentiate between the different versions.

If the different versions of the same product are different prices, they will be in price order (lowest to highest) just as if they were from different merchants.

This would need to be done with a re-query as the search results SQL can only include one grouping however the necessary query can be executed entirely from indexes so will be very fast and should not impact page speed at all. To give it a go, edit search.php and look for the following code at line 493:

You could add the image URL to the string from which the duplicate key value is generated for a specific merchant - to try this, edit includes/admin.php and look for the following code around line 481:

I see from your example link that duplicates are being imported so I'm wondering if it was actually to show the total number of products rather than just the number of distinct merchants in this case, which is no problem.

To do this for standalone Price Tapestry, edit search.php and look for the following code at line 502:

I have tried the code solution you have posted. Unfortunately, it didn't do the trick. I have re-imported the feeds as well.

What I am looking to do is, I have imported all the products from all the feeds, including the duplicates. The reason for that is, it seems that when I de-dupe the feed and import only one instance, most of the image links are broken for some reason. It's something to do with the feed, I think. Now, I noticed that the pictures seem to be fine for pretty much all of them except, for the odd one out.

What I would like to do is, to only show one instance on the product page, rather than all of the prices appearing multiple times i.e. {link saved}

Not sure whether this is possible? Some of the early feeds from the merchants haven't been that great unfortunately.

To both de-duplicate on the product page and also to pick the longest description and make sure that if there is no image_url in the first record one is used from another record if available, edit html/product.php and look for the following code at line 2:

I notice from your example links that you're referring to an installation in the /pt/ sub-directory so you may be using the WordPress plugin, in which case, bear in mind that the above will only apply to the product page in the standalone Price Tapestry installation. If once this is working how you want and you need to apply the same in the plugin, let me know which version you are running (2 or 3/Beta) and I'll work out the equivalent changes...