VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: michelerighetti on November 03, 2020, 10:23:14 AM

Title: String custom filed does not work as expected, no dropdown list in frontend.
Post by: michelerighetti on November 03, 2020, 10:23:14 AM
Hello to all. I have this problem, when I set up a custom field string, I can see the dropdown list in backend, but in frontend appears only the value selected in backend.
to make a custom filed string that works correctly I have to duplicate a previous string custom filed that works previously and so the new one works too.
Furthermore the qith this copied custom filed the translation not works properly: in fact it only translates the first value, the other values remain with the constant.
Shomeone can help me?
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: Jörgen on November 03, 2020, 19:37:59 PM
You have to set the caustom field as input for cart otherwise You have prechoosen the value in Your backen for the customer to see.

Jörgen @ Kreativ Fotografi
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: michelerighetti on November 03, 2020, 20:49:00 PM
Quote from: Jörgen on November 03, 2020, 19:37:59 PM
You have to set the caustom field as input for cart otherwise You have prechoosen the value in Your backen for the customer to see.

Jörgen @ Kreativ Fotografi
Thankyou Jörgen for your quick reply. Now it works.
What do you think about the language that only translates the first value ?
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: Jörgen on November 03, 2020, 23:14:59 PM
I have not tried this myself. But make the translation
MY_COLORS = "Red;Green;Blue";

I guess this will work.

Jörgen
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: michelerighetti on November 03, 2020, 23:30:52 PM
Quote from: Jörgen on November 03, 2020, 23:14:59 PM
I have not tried this myself. But make the translation
MY_COLORS = "Red;Green;Blue";

I guess this will work.

Jörgen

You mean "MY_COLORS" is the first dropdown value and "Red; Green; Blue" are all translated values including the first?
I have tried this and it doesn't work.

Michele
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: Jörgen on November 04, 2020, 08:10:31 AM
Remove the linefeed.

KEY_1;KEY_2;KEY_3;

Then it should work

Jörgen
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: michelerighetti on November 04, 2020, 18:31:07 PM
Quote from: Jörgen on November 04, 2020, 08:10:31 AM
Remove the linefeed.

KEY_1;KEY_2;KEY_3;

Then it should work

Jörgen
Thankyou Jörgen, I did as you say, I removed the keys in the language overrides file, but it doesn't work. Maybe I didn't understand what to do. so I describe how I set the string field:
I have a sring with KEY_1;KEY_2;KEY_3; (3 selection options in frontend), I have set a overrides language file with
KEY_1="option 1"
KEY_2="option 2"
KEY_3="option 3"
In frontend only the first value is taken
This don't works.
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: Jörgen on November 04, 2020, 23:30:00 PM
Have you removed the LINEFEEDS in Your first setup??
It should look like:

VALORE_1;VALORE_2;VALORE_3;

This works since years, I have tested it on VM version 3.2.12.

Jörgen
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: michelerighetti on November 06, 2020, 10:07:30 AM
Quote from: Jörgen on November 04, 2020, 23:30:00 PM
Have you removed the LINEFEEDS in Your first setup??
It should look like:

VALORE_1;VALORE_2;VALORE_3;

This works since years, I have tested it on VM version 3.2.12.

Jörgen
Hi Jörgen thanks for your help and patience
I have removed the keys from the default values in the setup, and so the sringa field does not give me options if I apply it to a product.
Maybe I don't understand what and where I have to remove the keys, and where I have to write the translations.
Michele
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: GJC Web Design on November 06, 2020, 12:10:30 PM
I think Joerg means use
VALORE_1;VALORE_2;VALORE_3;

in the valore predefinito with NO line breaks
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: Jörgen on November 06, 2020, 12:48:43 PM
Yes, thank you John

Jörgen
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: michelerighetti on November 06, 2020, 14:41:01 PM
Yes ;D now it works.
Thankyou to all.
Title: Re: String custom filed does not work as expected, no dropdown list in frontend.
Post by: Jörgen on November 06, 2020, 15:30:34 PM
Nice you have it working :)

Jörgen