Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ulihake

    (@ulih)

    Hello Brendavo.

    That’s like this since the days internet exists. If you specifiy a value for an option the posted value will be the option value. If you do not specify a value for the option, the posted value will be the text of the option.

    On your side you will need the number, on the client side it would be nicer to display the post station, I agree. What you can do is once again a JQuery modification of your values… e.g. joining value and text for the value (value=”3 – Post Station somewhere in nowhere”), if this is suitable for you in the back-end.

    All what you need is already in your code… ??

    uh

    Thread Starter Brendavo

    (@successful-life)

    Well, as you have implemented that all custom made fields get displayed in the customer Emails/Receipts ( if not checked to hide ), then the value in those Emails/Receipts for the CUSTOMER should be value + text.

    It makes absolutly no sense for the customer, when reviewing his Emails/Receipts to see for example “Custom Delivery Address: 3”.
    He should see the text, that he specified during checkout !

    As i see it, this is a lacking function or even bug of the plugin.

    e.g. joining value and text for the value (value=”3 – Post Station somewhere in nowhere”), if this is suitable for you in the back-end.

    This would be perfect, not just for me, but for EVERYONE who uses your plugin.
    Please tell me how to fix this.

    Plugin Author ulihake

    (@ulih)

    Yeah, a whole lot of things would be great, but that’s available for you already. You have some custom key pairs (value/text) and I offered you the possibility to load these key pairs into an empty select field that is recognized by WooCommerce. I’m not responsible for the value/text combination: this is your data! The value can represent something meaningful to a human or it can represent a number, a code that is meaningful only to an interpreter and it can be a mix of both, like I indicated to you. To automate external data handling that is different from data provider to data provider is not the goal of my plugin. It’s up to you to assure that your data complies with your expectations.

    To put it clearer. Exactly for this reason you can hide some data from display and it’s your decision to add a custom field and to display the selected value. If you want the value to be comprehensible to humans you have to provide such a value. WooCommerce itself does not display for instance the country selection value as the value would show up as es_ES for example.

    For sure, it’s possible to remap a value to a corresponding text but once again, that’s far behind of the scope of the plugin at this moment and if I implement something like this it will be a feature of the Rich Guys Swiss Knife.

    If you’d like to fix this, adapt your javascript code. I tested your code both in wcpgsk_user.js and inside of the storage field for script snippets in the checkout section and it’s possible to get this solved. If you want to reconfigure the value you only have to change one line in your javascript code that configures the value/text pairs of the select.

    uh

    Plugin Author ulihake

    (@ulih)

    You could replace:
    _postServiceOption.value = _psTerminal.id;

    with:

    _postServiceOption.value = _psTerminal.id + ' - ' + _psTerminal.name;

    in your javascript code. This will combine the id of the post station with the name into the value… and will display as e.g. “3 – Whatsoever station”.

    uh

    Thread Starter Brendavo

    (@successful-life)

    Thanks ulihake,

    I already figured this part out, by changing the _postServiceOption.value

    I do learn fast, its just that i never worked with code in my life. Imagine you going to a different country where everyone speaks a strange language and you have to figure out what each word means by yourself and then how to putt it together to make full sentences.

    Hiring someone is out of the question for this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Selected option displays only ID, not name in admin order and mails’ is closed to new replies.