You are here:  » Product Map

Support Forum



Product Map

Submitted by philstone on Wed, 2013-11-27 13:04 in

Hi David

hope you are well.

A quick question regarding the info I enter in /admin/productsmap_configure.php.

Currently when i enter this data, it overwrites all matching fields, would it be possible to change this so that this info only overwrites main product info shown via /html/product.php, but leaves the original data in all the /html/prices.php fields?

hope this makes sense?

thanks again
Phil
Buy24-7.net

Submitted by support on Wed, 2013-11-27 14:07

Hello Phil,

The original name is preserved in the `original_name` field so it sounds like your html/prices.php may be displaying `name` instead - check your version and see if you have the following:

<?php print $product["name"]; ?>

...in which case, REPLACE with:

<?php print $product["original_name"]; ?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by philstone on Wed, 2013-11-27 14:18

Hi David

Thanks for that, I was aware of that for the name field, but was thinking about the brand, model and description fields?

Thanks

Phil Stone
www.buy24-7.net

Submitted by support on Wed, 2013-11-27 14:42

Hi Phil,

Ah - I see, it would be no problem to apply the same principle to other fields. Firstly, to add the new `original_` fields to the `products` table run the following dbmod.php script:

<?php
  
require("includes/common.php");
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products`
            ADD `original_brand` VARCHAR(255) NOT NULL,
            ADD `original_model` VARCHAR(255) NOT NULL,
            ADD `original_description` TEXT NOT NULL
            "
;
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

With that in place, in includes/admin.php locate the following code around line 267:

  $importRecord["original_name"] = $importRecord["name"];

...and REPLACE with:

  $importRecord["original_name"] = $importRecord["name"];
  $importRecord["original_brand"] = $importRecord["brand"];
  $importRecord["original_model"] = $importRecord["model"];
  $importRecord["original_description"] = $importRecord["description"];

And then after the next import, $product["original_brand"], $product["original_model"] and $product["original_description"] will be available to use in html/prices.php as required!

Cheers,
David.
--
PriceTapestry.com

Submitted by philstone on Wed, 2013-11-27 15:14

perfect David!

Thanks!! (YET AGAIN!!)

regards

Phil Stone
www.buy24-7.net