You are here:  » Description, category, brand, image overridden with Product Mapping


Description, category, brand, image overridden with Product Mapping

Submitted by Maxime on Sun, 2016-12-11 00:46 in

Hello Support,

I have 4 feeds:
- for 3 of them I have only the product name, the URL and the price fields
- for the last one I have same information + image, description, brand and so on...

I am using the tool Product Mapping to create a single master product but unfortunately on the product page I have only the basic information (name, url and price)
It seems others information are overridden.

Could you please help me?
Thanks in advance

Best regards

Submitted by support on Mon, 2016-12-12 09:23

Hello Maxime, and welcome to the forum!

If you leave the Custom Category / Brand / Image URL fields blank on the configuration page for a Product Mapping entry, they should not overwrite any feed values that exist.

(but if you do enter a value, the value is then used for all merchants)

What may be happening here is that your merchant without the image is cheapest, and therefore no image is shown on the product page. If this is the case, it is an easy mod to scan through the results and make sure that the first result (the one from which image etc. is taken on the product in the $product_main variable) is filled with as many present values as possible from the entire result set.

To do this, edit products.php and look for the following code at line 160:

  if (isset($product)) require("html/product.php");

...and REPLACE with:

  if (isset($product))
  {
    foreach($product["products"] as $p)
    {
      if ($p["image_url"]) $product["products"][0]["image_url"] = $p["image_url"];
      if ($p["category"]) $product["products"][0]["category"] = $p["category"];
      if ($p["brand"]) $product["products"][0]["brand"] = $p["brand"];
    }
    require("html/product.php");
  }

Hope this helps! Apologies if mis-understood, let me know if you're still not sure and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Maxime on Wed, 2016-12-14 20:26

Hello,

Thanks for your feedback.

I replaced

 if (isset($product)) require("html/product.php");

by

 if (isset($product))
  {
    foreach($product["products"] as $p)
    {
      if ($p["image_url"]) $product["products"][0]["image_url"] = $p["image_url"];
      if ($p["category"]) $product["products"][0]["category"] = $p["category"];
      if ($p["brand"]) $product["products"][0]["brand"] = $p["brand"];
    }
    require("html/product.php");
  }

And now the picture is displayed (thank you)

But I confirm that Custom Category / Brand / Image URL fields are blank and are not displayed on the front end.

Thanks in advance again for your feedback and support

Submitted by support on Thu, 2016-12-15 09:03

Hello Maxime,

That sounds like the code itself is working - category / brand are not actually displayed by default on the product page, but first check that they are being imported as expected by going to your site's Category A-Z / Brand A-Z pages where you should see the lists.

If that's all good, you can easily add to the product page by editing html/products.php, and to display, for example, below the description, look for the following code beginning at line 42:

    <?php if ($product_main["description"]): ?>
      <p><?php print $product_main["description"]; ?></p>
    <?php endif; ?>

...and REPLACE with:

    <?php if ($product_main["description"]): ?>
      <p><?php print $product_main["description"]; ?></p>
    <?php endif; ?>
    <?php if ($product_main["category"]): ?>
      <p><strong>Category:</strong> <?php print $product_main["category"]; ?></p>
    <?php endif; ?>
    <?php if ($product_main["brand"]): ?>
      <p><strong>Brand:</strong> <?php print $product_main["brand"]; ?></p>
    <?php endif; ?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Maxime on Sat, 2016-12-17 21:55

Hello,

thank you for your feedback.
I have edited html/products.php. I have now the category displayed on my product webpage.
But I am still missing the descripton.

I checked my site Category and I confirm that the import is correct (I have the description).

Thanks in advance for your feedback

Submitted by support on Sun, 2016-12-18 08:47

Hello Maxime,

My apologies, in the last replacement I missed out the original code to display the description - corrected above, to show description, category and brand.

Cheers,
David.
--
PriceTapestry.com

Submitted by Maxime on Sun, 2016-12-25 17:50

Hello,

The description is still missing.
Can we plan a telco please? I guess it will be faster and easier for the troobleshoot;

Thanks in advance

Submitted by support on Tue, 2016-12-27 08:35

Hello Maxime,

Please could you email me your modified html/product.php and if it's online a link to the installation and in particular a product page that should be displaying description, category and brand and I'll check it out further with you...

Thanks,
David.
--
PriceTapestry.com