Hi @ecartz
You helped me before to stop padding the GTIN numbers, but with an update to V1.08.0 this has changed.
Could you possibly tell me how to stop the padding again please.?
'products_gtin' => (Text::is_empty($_POST['products_gtin'])) ? 'NULL' : str_pad(Text::prepare($_POST['products_gtin']), 14, '0', STR_PAD_LEFT),
Dont pad GTIN numbers help
-
ecartz
- Core Team
- Posts: 3084
- Joined: Tue Nov 05, 2019 6:02 pm
- Phoenix Version:
- Has thanked: 4 times
- Been thanked: 208 times
Re: Dont pad GTIN numbers help
It should be essentially the same change. Perhaps Or delete that line entirely and add a new section that says
Code: Select all
'products_gtin' => (Text::is_empty($_POST['products_gtin'])) ? 'NULL' : Text::input($_POST['products_gtin']),Code: Select all
if (!Text::is_empty($_POST['products_gtin'])) {
$sql_data['products_gtin'] = Text::input($_POST['products_gtin']);
}- burt
- Core Team
- Posts: 4551
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: Dont pad GTIN numbers help
GTIN numbers *must* be stored padded to 14 characters.
In the old Phoenix forum (at the oscommerce site) there was a long thread about this. I don't want to log in there to link to it (and it might not even exist now)...have a search ? From memory the user "whitehat" wanted to store them not padded, and I advised (with links etc) the rules state they must be stored padded etc.
If you want to change the code to have them stored as exactly whatever you put in the field..that's fine to do, but then that's on you and not on the core code (if that makes sense).
In the old Phoenix forum (at the oscommerce site) there was a long thread about this. I don't want to log in there to link to it (and it might not even exist now)...have a search ? From memory the user "whitehat" wanted to store them not padded, and I advised (with links etc) the rules state they must be stored padded etc.
If you want to change the code to have them stored as exactly whatever you put in the field..that's fine to do, but then that's on you and not on the core code (if that makes sense).
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.