You are here:  » Master product & comments

Support Forum



Master product & comments

Submitted by Bakalinge on Thu, 2013-04-04 21:45 in

Hi David,

I have a simple question : when you create a master product, what happen with comments ? Does each comment from all product are mapped also, or is the Master product considered as a new product and forget all previous comments from mapped products ?

Thanks David

Bak

Submitted by support on Fri, 2013-04-05 07:51

Hello Bak,

They would actually become dormant until the actual product name associated with a mapping re-appeared in the database, but it's a straight forward mod in fact to rename reviews for any of the Alternates that match a review name upon saving a Product Mapping.

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

    header("Location: productsmap.php");

...and REPLACE with:

    $sql = "SELECT id,product_name FROM `".$config_databaseTablePrefix."reviews`";
    if (database_querySelect($sql,$rows))
    {
      foreach($rows as $row)
      {
        $update = FALSE;
        foreach($uniqueAlternates2 as $alternate)
        {
          if ("=".$row["product_name"]==$alternate)
          {
            $update = TRUE;
            break;
          }
          else
          {
            $found = 0;
            $words = explode(" ",$alternate);
            foreach($words as $word)
            {
              if ($word)
              {
                if (strpos($row["name"],$word) !== FALSE) $found++;
              }
            }
            if ($found == count($words))
            {
              $update = TRUE;
              break;
            }
          }
        }
        if ($update)
        {
          $sql = "UPDATE `".$config_databaseTablePrefix."reviews` SET product_name = '".database_safe(tapestry_normalise($productmap["name"]))."' WHERE id='".$row["id"]."'";
        }
      }
    }
    header("Location: productsmap.php");

Cheers,
David.
--
PriceTapestry.com

Submitted by Bakalinge on Fri, 2013-04-05 15:56

Hi David,

Thank you very much ! it seems to work correctly, except for the "last comment" mod : some comment disappear after I imported some feeds, but they are replaced by a blank area with no image neither text. Is there a way to not display this "ghost" comments ?

Thanks !
Have a good week-end !

Bak

Submitted by support on Sat, 2013-04-06 07:35

Hello Bak,

I've just looked back at your custom lastreviews.php script and it looks like that would happen when it was selecting reviews for products that are no longer in the database. Reviews are never actually delete because often, a product may disappear from a merchant's feed - for example because it is temporarily out of stock - but then return again, so once it does the reviews are restored.

I'll follow up by email for you with a mod to your lastreviews.php (based on the last version I sent) to work around this...

Cheers,
David.
--
PriceTapestry.com