i already know how to add new field to shipping address form in checkout, but i need to modify the behavior of some fields. For example:

  • there is a checkbox "Deliver to Packing station";
  • if checkbox is selected, "street" fields becomes hidden and not required, but 2 new fields ("Packing station #" and "Post #") becomes visible and required.

I completely stuck with that. I'm not very familiar with knockout, just have read some lessons on it. Any help/ideas? (except "go learn knockout.js" :))


1 Answer 1


Found solution, here is an example:

], function (AbstractField) {
    'use strict';

    return AbstractField.extend({
        defaults: {
            modules: {
                packing_station_nr: '${ $.parentName }.packing_station_nr',
                post_nr: '${ $.parentName }.post_nr'

        onCheckedChanged: function () {


P.S. this code only toggles fields visibility. Make fields required by default. If field is not visible, validator skips it's validation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.