You are here:  » Import Only Basic Field


Import Only Basic Field

Submitted by keshavkshirsagar on Sat, 2017-02-18 08:34 in

Hello David

I want to import only basic filed in database product table

$config_fieldSet["name"] = "Product Name";
$config_fieldSet["description"] = "Description";
$config_fieldSet["image_url"] = "Image URL";
$config_fieldSet["buy_url"] = "Buy URL";
$config_fieldSet["price"] = "Price";
$config_fieldSet["category"] = "Category";
$config_fieldSet["brand"] = "Brand";

How to do that, I want to delete other field to utilize DB Space to other products

Agree to duplicate entry and will manage other filed dynamically such as normalize name , search_name,etc

Submitted by support on Mon, 2017-02-20 09:43

Hi,

The derived fields (normalised_name and search_name) are fundamental to the operation of the script i'm afraid so removing them would require considerable changes throughout however where you would have options to reduce database size would be to limit the length of descriptions perhaps? To implement this globally, and to limit descriptions to 200 characters (or next SPACE), you could edit includes/admin.php and look for the following comment at line 448:

    /* check product record for minimum required fields */

...and REPLACE with:

    $import_record["description"] = tapestry_substr($import_record["description"],200,"...");
    /* check product record for minimum required fields */

(if you leave out the "..." parameter, the description will just be truncated without "..." added)

The original_name field can be safely left out if you are not concerned about having it available for display in the price comparison table ("Catalogue Product Name" column in html/prices.php). To do this, look for the following code at line 263 of includes/admin.php:

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

...and either comment out or DELETE that line.

Whilst the overhead of an empty field is tiny, if you wanted to complete remove the field the following dbmod.php script will apply the change;

<?php
  set_time_limit
(0);
  require(
"includes/common.php");
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products` DROP COLUMN original_name";
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

Cheers,
David.
--
PriceTapestry.com