You are here:  » import euro sign in extra field


import euro sign in extra field

Submitted by marco on Thu, 2016-09-15 14:58 in

Hello,

I have added an extra field that contains info about a discount, for example: “3 months from € 11,- for € 8,-“.
On import the field only contains “3 months from”.
How can i import the full text?

Best,
Marco

Submitted by support on Fri, 2016-09-16 08:23

Hi Marco,

Nothing in the script should specifically cause a field to break at the € symbol (or if as maybe the case, it is encoded as €) - the first thing that comes to mind is whether the field is too short and it is therefore being truncated by the database. The following dbmod.php script will ensure that the `discount` field (edit in the below if your custom field is called something else) is VARCHAR(255)...

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

If that doesn't make any difference (after next import), view the source of the page where you are outputting the discount field, for example if you are using something like:

Discount: <?php print $product["discount"]; ?>

...browse to the page and use your browser's View > Source option to study the HTML, search for "Discount" and see if perhaps there is broken HTML markup that is being imported as part of the field, in which case, a Strip HTML filter might do the trick.

Hope this helps! Let me know if you're still not sure and I'll check it out further with you...

Cheers,
David.
--
PriceTapestry.com

Submitted by marco on Fri, 2016-09-16 10:44

Hi David,

I did the checks and found out the feed is not encoded in utf8 (I think it is in ANSI)
The utf8 encode filter gives: “3 months from Û 11,- for Û 8,-“.
A search and replace (Û for €) fixed this text.

Is there also another alternative to fix this?
As i do not know if other characters will be used in the future.

Best,
Marco

Submitted by support on Fri, 2016-09-16 11:18

Hi Marco,

Please could you email me includes/filter.php from your installation and I'll add an ANSI Decode filter for you to try..

Cheers,
David.
--
PriceTapestry.com