You are here:  » Add New Fields Like Promo Price

Support Forum



Add New Fields Like Promo Price

Submitted by Tkconcept on Sat, 2012-05-12 08:56 in

Hi David,

Can you tell me the process to add a new field like Promo price and delivery in the latest distribution of Price Tapestry please ?

Thanks in advance.

Submitted by support on Sun, 2012-05-13 09:36

Hi,

You'll find all the details for adding new fields here...

When adding new fields that are always going to be a monetary value you might prefer to use DECIMAL(10,2) in the database rather than VARCHAR(255), so your dbmod.php script might be:

<?php
  
require("includes/common.php");
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."feeds`
            ADD `field_delivery` VARCHAR(255) NOT NULL"
;
  
database_queryModify($sql,$result);
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products`
            ADD `delivery` DECIMAL(10,2) NOT NULL"
;
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

(note the `field_delivery` field must still be VARCHAR(255) in the feeds table)

However, take care with both examples where feeds may contain text instead of a price, e.g. "FREE", plus the possibility that a promo price field may be empty instead of just the regular price as this would import as 0.00. If either are likely to be the case use VARCHAR(255) as per the instructions...

Cheers,
David.
--
PriceTapestry.com

Submitted by Tkconcept on Fri, 2012-06-15 08:08

Hi,

Work very well.

Thanks a lot