You are here:  » Use script without price comparison

Support Forum



Use script without price comparison

Submitted by mediadream on Sat, 2010-11-13 20:17 in

Hi!

I really like this script and I am now working on a site for showing clothes.

How do I get the system to show all the products and not only show one of them where there are products that have the same name.

An example:
Several manufacturers may have a product which they call simply "T-shirt". Then the system now only shows one of these and compare their prices to the presentation page for the product.

What I want is that all products should be displayed even if they have the same name.

Is it possible? And what files need to be changed?

I understand the necessity of entering a product id in the URL to be able to distinguish them.

Thanks

Submitted by support on Mon, 2010-11-15 09:17

Hi,

Rather than use an ID in the Product URL, I would use the merchant name, as this will enable the links to remain consistent even when you re-import (which would change the product IDs in the database).

Firstly, to remove comparison in search results, edit serach.php and simply delete each instance of:

GROUP BY name

Then, to add the merchant name to the product URL, look for the following section of code beginning at line 270:

      if ($config_useRewrite)
      {
        $searchresults["products"][$k]["productHREF"] = $config_baseHREF."product/".tapestry_hyphenate($product["normalised_name"]).".html";
      }
      else
      {
        $searchresults["products"][$k]["productHREF"] = $config_baseHREF."products.php?q=".urlencode($product["normalised_name"]);
      }

...and REPLACE with just:

     $searchresults["products"][$k]["productHREF"] = $config_baseHREF."products.php?q=".urlencode($product["normalised_name"])."&merchant=".urlencode($product["merchant"]);

Finally, in products.php, look for the product select SQL at line 12:

    $sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE normalised_name = '".database_safe($q)."' ORDER BY price";

...and REPLACE with:

    $sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE normalised_name = '".database_safe($q)."' AND merchant='".database_safe($_GET["merchant"])."'";

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by mediadream on Mon, 2010-11-15 11:33

Thanks. I will try it and get back to you, with the result.

Error;

When I am importing I do get the following error:

Duplicate entry 'e0a1b072adbab113d0483bf86070ccb9' for key 2
on a lot of products after upgrading to the newest version.

Internetsidorna Hitta företag

Submitted by support on Mon, 2010-11-15 13:16

Hi,

Duplicate errors are expected during import (this is the mechanism that prevents duplicate product names per merchant), but they do not normally generated any output - so it sounds like you currently have database debug mode enabled. You can turn this off in config.advanced.php - change line 6 back to:

  $config_databaseDebugMode = FALSE;

Cheers,
David.
--
PriceTapestry.com

Submitted by mediadream on Mon, 2010-11-15 19:21

Yes I know that I have this option set to true.

I want to be able to show all products even if they have the same name from same merchant.

Thats why I think there will be a problem just to use productname and merchant.

Internetsidorna Hitta företag

Submitted by support on Mon, 2010-11-15 19:29

Hi,

Ah yes - I understand - there is a final modification required to support this.

In includes/admin.php, look for the following code around line 297:

    $dupe_key .= $normalisedName;

...and REPLACE with:

    $dupe_key .= $normalisedName;
    global $dupe_key_count;
    $dupe_key_count++;
    $dupe_key .= $dupe_key_count;

This will ensure that all products for the given merchant are imported.

Cheers,
David.
--
PriceTapestry.com

Submitted by mediadream on Thu, 2011-01-06 17:45

Hello again

I have deleted all the "GROUP BY name" in search.php but now only 1 "one" product is showing.

What is wrong?

$sql = "SELECT SQL_CALC_FOUND_ROWS * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants, MATCH ".$matchFields." AGAINST ('".database_safe($parts[0])."') AS relevance FROM `".$config_databaseTablePrefix."products` WHERE ".$where.$priceWhere." ";

Gratis blogg

Submitted by support on Thu, 2011-01-06 18:29

Hi,

Did you remove all 6 instances of "GROUP BY name" from search.php - there are an additional 5 very similar lines (it all depends on which query is selected) to perform the search - so that should be all it is...

Cheers,
David.
--
PriceTapestry.com

Submitted by mediadream on Thu, 2011-02-10 19:51

I am stuck...

Stil problems with products with the same name from the same merchant./different merchants

For example:
{link saved}

Show one product with id 37577 every time the url get visited. There is 8 products with the same name from that same merchant...

Is there a way of showing the right product without using ID of any kind in the url?

I cant find any...

The problem is of course when using ID in URL this can change every time I import. Is there any other way anyone can think of?

Gratis blogg

Submitted by support on Fri, 2011-02-11 09:28

Hi mediadream,

Would you like me to make a modification so that products are imported with the same ID if the same merchant/productname/buy_url already exists in the database? That way, an id can be included in the URL, and you can make a product URL like

http://www.example.com/produkt/12345/cardigan.html

If you could zip together and email me the following files I'll do that for you...

includes/admin.php
.htaccess
index.php
search.php
products.php

Cheers,
David.
--
PriceTapestry.com