You are here:  » Change Price to varchar

Support Forum



Change Price to varchar

Submitted by Syed on Tue, 2010-03-30 23:43 in

Hi David,

I changed price field from decimel to varchar but i am unable to load price as character.

How do i change price as varchar and load the char data for price.

Thanks,
Syed

Submitted by support on Wed, 2010-03-31 06:43

Hello Syed,

The script relies quite heavily on the price field being DECIMAL(10,2) in order for sorting by price to work, so I wouldn't recommend trying to convert it to VARCHAR.

Perhaps if you let me know what you were looking to implement I can suggest an alternative method; perhaps using a new VARCHAR field alongside the existing price field...

Cheers,
David.

Submitted by Syed on Wed, 2010-03-31 10:24

Hello david,

I want to add some text along the price in searchresults and also product detail.

for eg:

£200 inc VAT

2000 Rupees plus tax

etc...

Thanks,
Syed

Submitted by support on Wed, 2010-03-31 16:38

Hello Syed,

Will this be fixed text across your site; per feed; or is it something that you can pull from another field in your feeds?

Cheers,
David.

Submitted by Syed on Thu, 2010-04-01 15:42

Hi David,

The type of text would be pulled from the feed.

Thanks,
Syed

Submitted by support on Thu, 2010-04-01 15:59

Hi Syed,

In that case, I would recommend adding a new field (instructions for original distribution) to your site, for example "priceinfo". With that in place, in html/prices.php, you could display the new priceinfo field alongside the price by changing line 13 from:

<td><strong><?php print $config_currencyHTML.$product["price"]; ?></strong></td>

to:

<td><strong><?php print $config_currencyHTML.$product["price"]; ?></strong> ".$product["priceinfo"]."</td>

Hope this helps!

Cheers,
David.