Magento 2 - Add a message to a ko template that is created through a LayoutProcessorPluginOverriding template files in own theme, loaded through JS (Knockout.js)How to add new custom field to billing address section in magento2Plugin for backend order create that sets attribute value on created orderCheckout uiComponent (input field) rendered multiple times: how do I apply viewmodel functionality to current input field only?show error message through plugin Magento2Magento 2 checkout - add a custom field between shipping address and shipping methodshow error message through plugin Magento2 in checkout pageMagento 2.2.0 - checkout_index_index.xml shippingAdditional not workingMagento 2 - Add success message with knockoutMagento 2 Add error/success message with knockout

Any Tips On Writing Extended Recollection In A Novel

What does 'in attendance' mean on an England death certificate?

What's the lunar calendar of two moons

How useful would a hydroelectric power plant be in the post-apocalypse world?

Does "boire un jus" tend to mean "coffee" or "juice of fruit"?

Find the closest three-digit hex colour

What happens if a caster is surprised while casting a spell with a long casting time?

Checkmate in 1 on a Tangled Board

Why do movie directors use brown tint on Mexico cities?

A* pathfinding algorithm too slow

Move up, right, left and down functions

Why doesn't SpaceX land boosters in Africa?

What could a Medieval society do with excess animal blood?

How do I tell my girlfriend she's been buying me books by the wrong author for the last nine months?

English idiomatic equivalents of 能骗就骗 (if you can cheat, then cheat)

Basic calculations in PGF/TikZ for loop

Is it OK to say "The situation is pregnant with a crisis"?

Identifying positions of the last TRUEs in a sequence of TRUEs and FALSEs

What prevents a US state from colonizing a smaller state?

How did they film the Invisible Man being invisible in 1933?

Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?

Five 5-cent coins touching each other

Does Flashpoint ever indicate directly that it takes place in Toronto?

Is this house-rule removing the increased effect of cantrips at higher character levels balanced?



Magento 2 - Add a message to a ko template that is created through a LayoutProcessorPlugin


Overriding template files in own theme, loaded through JS (Knockout.js)How to add new custom field to billing address section in magento2Plugin for backend order create that sets attribute value on created orderCheckout uiComponent (input field) rendered multiple times: how do I apply viewmodel functionality to current input field only?show error message through plugin Magento2Magento 2 checkout - add a custom field between shipping address and shipping methodshow error message through plugin Magento2 in checkout pageMagento 2.2.0 - checkout_index_index.xml shippingAdditional not workingMagento 2 - Add success message with knockoutMagento 2 Add error/success message with knockout













0















I need to add message "Need it by today? Anything is possible, it's just a phone call away" in a KO template. However, this template is created through the afterProcess method LayoutProcessPlugin.php file.



I do not know how to modify the template so that I can add this messaging after the Delivery Time Slots field. Right now to get around that, I created a custom js file that appends a HTML element after the Delivery Time Slots field. However, the JS file is loading before the KO template finishing loading so doesn't append the message. I wrapped it around a 3 second settimeout() event, but I do not think this is the best way to do this. Below I included the php file that processes the layout (LayoutProcessorPlugin.php) and the custom JS file I created (orderdeliverydate.js).



File: Bss/OrderDeliveryDate/Block/Plugin/Checkout/LayoutProcessorPlugin.php



class LayoutProcessorPlugin

protected $_helper;
const DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS = 0;
const DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD = 1;
const DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS = 2;

public function __construct(
BssOrderDeliveryDateHelperData $helper
)
$this->_helper = $helper;


public function afterProcess(
MagentoCheckoutBlockCheckoutLayoutProcessor $subject,
array $jsLayout
)
$container = null;
if(!$this->_helper->isEnabled()) return $jsLayout;
if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS)
$container = 'shipping-address-fieldset';
elseif($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD)
$container = 'before-shipping-method-form';


if($this->_helper->getTimeSlot())
// before place order
if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
['payment']['children']['payments-list']['children']['before-place-order']['children']['delivery_time_slot'] = [
'component' => 'Magento_Ui/js/form/element/select',
'config' => [
'customScope' => 'shippingAddress',
'template' => 'ui/form/field',
'elementTmpl' => 'ui/form/element/select',
'id' => 'delivery-time-slot'
],
'caption' => 'Please select delivery time slot',
'dataScope' => 'shippingAddress.delivery_time_slot',
'label' => 'Delivery Time Slot',
'provider' => 'checkoutProvider',
'visible' => true,
'validation' => [],
'options' => $this->_helper->getTimeSlot(),
'sortOrder' => 201,
'id' => 'delivery-time-slot',
];
else
$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
['shippingAddress']['children'][$container]['children']['delivery_time_slot'] = [
'component' => 'Magento_Ui/js/form/element/select',
'config' => [
'customScope' => 'shippingAddress',
'template' => 'ui/form/field',
'elementTmpl' => 'ui/form/element/select',
'id' => 'delivery-time-slot'
],
'caption' => 'Please select delivery time slot',
'dataScope' => 'shippingAddress.delivery_time_slot',
'label' => 'Delivery Time Slot',
'provider' => 'checkoutProvider',
'visible' => true,
'validation' => [],
'options' => $this->_helper->getTimeSlot(),
'sortOrder' => 201,
'id' => 'delivery-time-slot',
];


// before place order
if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
['payment']['children']['payments-list']['children']['before-place-order']['children']['shipping_arrival_comments'] = [
'component' => 'Magento_Ui/js/form/element/textarea',
'config' => [
'customScope' => 'shippingAddress',
'template' => 'ui/form/field',
'elementTmpl' => 'ui/form/element/textarea',
'id' => 'shipping-arrival-comments',
'rows' => 5
],
'dataScope' => 'shippingAddress.shipping_arrival_comments',
'label' => 'Shipping Arrival Comment',
'provider' => 'checkoutProvider',
'visible' => true,
'validation' => [],
'sortOrder' => 202,
'id' => 'shipping-arrival-comments'
];
else
$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
['shippingAddress']['children'][$container]['children']['shipping_arrival_comments'] = [
'component' => 'Magento_Ui/js/form/element/textarea',
'config' => [
'customScope' => 'shippingAddress',
'template' => 'ui/form/field',
'elementTmpl' => 'ui/form/element/textarea',
'id' => 'shipping-arrival-comments',
'rows' => 5
],
'dataScope' => 'shippingAddress.shipping_arrival_comments',
'label' => 'Shipping Arrival Comment',
'provider' => 'checkoutProvider',
'visible' => true,
'validation' => [],
'sortOrder' => 202,
'id' => 'shipping-arrival-comments'
];

return $jsLayout;




File: MyVendor/OrderDeliveryDate/view/frontend/web/orderdeliverydate.js



require([
'jquery'
], function($)
'use strict';


$(document).ready(function()
console.log("I am getting executed");
setTimeout(function()

console.log("In Timeout");
if ($("div[name='shippingAddress.delivery_time_slot']").length)
console.log("It exists!");
$("div[name='shippingAddress.delivery_time_slot']").after("<div class='field' id='delivery_time_sot_message'>Need it by today? Anything is possible, it's just a phone call away</div>");

, 3000);




);
);









share|improve this question


























    0















    I need to add message "Need it by today? Anything is possible, it's just a phone call away" in a KO template. However, this template is created through the afterProcess method LayoutProcessPlugin.php file.



    I do not know how to modify the template so that I can add this messaging after the Delivery Time Slots field. Right now to get around that, I created a custom js file that appends a HTML element after the Delivery Time Slots field. However, the JS file is loading before the KO template finishing loading so doesn't append the message. I wrapped it around a 3 second settimeout() event, but I do not think this is the best way to do this. Below I included the php file that processes the layout (LayoutProcessorPlugin.php) and the custom JS file I created (orderdeliverydate.js).



    File: Bss/OrderDeliveryDate/Block/Plugin/Checkout/LayoutProcessorPlugin.php



    class LayoutProcessorPlugin

    protected $_helper;
    const DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS = 0;
    const DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD = 1;
    const DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS = 2;

    public function __construct(
    BssOrderDeliveryDateHelperData $helper
    )
    $this->_helper = $helper;


    public function afterProcess(
    MagentoCheckoutBlockCheckoutLayoutProcessor $subject,
    array $jsLayout
    )
    $container = null;
    if(!$this->_helper->isEnabled()) return $jsLayout;
    if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS)
    $container = 'shipping-address-fieldset';
    elseif($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD)
    $container = 'before-shipping-method-form';


    if($this->_helper->getTimeSlot())
    // before place order
    if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
    $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
    ['payment']['children']['payments-list']['children']['before-place-order']['children']['delivery_time_slot'] = [
    'component' => 'Magento_Ui/js/form/element/select',
    'config' => [
    'customScope' => 'shippingAddress',
    'template' => 'ui/form/field',
    'elementTmpl' => 'ui/form/element/select',
    'id' => 'delivery-time-slot'
    ],
    'caption' => 'Please select delivery time slot',
    'dataScope' => 'shippingAddress.delivery_time_slot',
    'label' => 'Delivery Time Slot',
    'provider' => 'checkoutProvider',
    'visible' => true,
    'validation' => [],
    'options' => $this->_helper->getTimeSlot(),
    'sortOrder' => 201,
    'id' => 'delivery-time-slot',
    ];
    else
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children'][$container]['children']['delivery_time_slot'] = [
    'component' => 'Magento_Ui/js/form/element/select',
    'config' => [
    'customScope' => 'shippingAddress',
    'template' => 'ui/form/field',
    'elementTmpl' => 'ui/form/element/select',
    'id' => 'delivery-time-slot'
    ],
    'caption' => 'Please select delivery time slot',
    'dataScope' => 'shippingAddress.delivery_time_slot',
    'label' => 'Delivery Time Slot',
    'provider' => 'checkoutProvider',
    'visible' => true,
    'validation' => [],
    'options' => $this->_helper->getTimeSlot(),
    'sortOrder' => 201,
    'id' => 'delivery-time-slot',
    ];


    // before place order
    if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
    $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
    ['payment']['children']['payments-list']['children']['before-place-order']['children']['shipping_arrival_comments'] = [
    'component' => 'Magento_Ui/js/form/element/textarea',
    'config' => [
    'customScope' => 'shippingAddress',
    'template' => 'ui/form/field',
    'elementTmpl' => 'ui/form/element/textarea',
    'id' => 'shipping-arrival-comments',
    'rows' => 5
    ],
    'dataScope' => 'shippingAddress.shipping_arrival_comments',
    'label' => 'Shipping Arrival Comment',
    'provider' => 'checkoutProvider',
    'visible' => true,
    'validation' => [],
    'sortOrder' => 202,
    'id' => 'shipping-arrival-comments'
    ];
    else
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children'][$container]['children']['shipping_arrival_comments'] = [
    'component' => 'Magento_Ui/js/form/element/textarea',
    'config' => [
    'customScope' => 'shippingAddress',
    'template' => 'ui/form/field',
    'elementTmpl' => 'ui/form/element/textarea',
    'id' => 'shipping-arrival-comments',
    'rows' => 5
    ],
    'dataScope' => 'shippingAddress.shipping_arrival_comments',
    'label' => 'Shipping Arrival Comment',
    'provider' => 'checkoutProvider',
    'visible' => true,
    'validation' => [],
    'sortOrder' => 202,
    'id' => 'shipping-arrival-comments'
    ];

    return $jsLayout;




    File: MyVendor/OrderDeliveryDate/view/frontend/web/orderdeliverydate.js



    require([
    'jquery'
    ], function($)
    'use strict';


    $(document).ready(function()
    console.log("I am getting executed");
    setTimeout(function()

    console.log("In Timeout");
    if ($("div[name='shippingAddress.delivery_time_slot']").length)
    console.log("It exists!");
    $("div[name='shippingAddress.delivery_time_slot']").after("<div class='field' id='delivery_time_sot_message'>Need it by today? Anything is possible, it's just a phone call away</div>");

    , 3000);




    );
    );









    share|improve this question
























      0












      0








      0








      I need to add message "Need it by today? Anything is possible, it's just a phone call away" in a KO template. However, this template is created through the afterProcess method LayoutProcessPlugin.php file.



      I do not know how to modify the template so that I can add this messaging after the Delivery Time Slots field. Right now to get around that, I created a custom js file that appends a HTML element after the Delivery Time Slots field. However, the JS file is loading before the KO template finishing loading so doesn't append the message. I wrapped it around a 3 second settimeout() event, but I do not think this is the best way to do this. Below I included the php file that processes the layout (LayoutProcessorPlugin.php) and the custom JS file I created (orderdeliverydate.js).



      File: Bss/OrderDeliveryDate/Block/Plugin/Checkout/LayoutProcessorPlugin.php



      class LayoutProcessorPlugin

      protected $_helper;
      const DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS = 0;
      const DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD = 1;
      const DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS = 2;

      public function __construct(
      BssOrderDeliveryDateHelperData $helper
      )
      $this->_helper = $helper;


      public function afterProcess(
      MagentoCheckoutBlockCheckoutLayoutProcessor $subject,
      array $jsLayout
      )
      $container = null;
      if(!$this->_helper->isEnabled()) return $jsLayout;
      if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS)
      $container = 'shipping-address-fieldset';
      elseif($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD)
      $container = 'before-shipping-method-form';


      if($this->_helper->getTimeSlot())
      // before place order
      if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
      $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
      ['payment']['children']['payments-list']['children']['before-place-order']['children']['delivery_time_slot'] = [
      'component' => 'Magento_Ui/js/form/element/select',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/select',
      'id' => 'delivery-time-slot'
      ],
      'caption' => 'Please select delivery time slot',
      'dataScope' => 'shippingAddress.delivery_time_slot',
      'label' => 'Delivery Time Slot',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'options' => $this->_helper->getTimeSlot(),
      'sortOrder' => 201,
      'id' => 'delivery-time-slot',
      ];
      else
      $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
      ['shippingAddress']['children'][$container]['children']['delivery_time_slot'] = [
      'component' => 'Magento_Ui/js/form/element/select',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/select',
      'id' => 'delivery-time-slot'
      ],
      'caption' => 'Please select delivery time slot',
      'dataScope' => 'shippingAddress.delivery_time_slot',
      'label' => 'Delivery Time Slot',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'options' => $this->_helper->getTimeSlot(),
      'sortOrder' => 201,
      'id' => 'delivery-time-slot',
      ];


      // before place order
      if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
      $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
      ['payment']['children']['payments-list']['children']['before-place-order']['children']['shipping_arrival_comments'] = [
      'component' => 'Magento_Ui/js/form/element/textarea',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/textarea',
      'id' => 'shipping-arrival-comments',
      'rows' => 5
      ],
      'dataScope' => 'shippingAddress.shipping_arrival_comments',
      'label' => 'Shipping Arrival Comment',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'sortOrder' => 202,
      'id' => 'shipping-arrival-comments'
      ];
      else
      $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
      ['shippingAddress']['children'][$container]['children']['shipping_arrival_comments'] = [
      'component' => 'Magento_Ui/js/form/element/textarea',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/textarea',
      'id' => 'shipping-arrival-comments',
      'rows' => 5
      ],
      'dataScope' => 'shippingAddress.shipping_arrival_comments',
      'label' => 'Shipping Arrival Comment',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'sortOrder' => 202,
      'id' => 'shipping-arrival-comments'
      ];

      return $jsLayout;




      File: MyVendor/OrderDeliveryDate/view/frontend/web/orderdeliverydate.js



      require([
      'jquery'
      ], function($)
      'use strict';


      $(document).ready(function()
      console.log("I am getting executed");
      setTimeout(function()

      console.log("In Timeout");
      if ($("div[name='shippingAddress.delivery_time_slot']").length)
      console.log("It exists!");
      $("div[name='shippingAddress.delivery_time_slot']").after("<div class='field' id='delivery_time_sot_message'>Need it by today? Anything is possible, it's just a phone call away</div>");

      , 3000);




      );
      );









      share|improve this question














      I need to add message "Need it by today? Anything is possible, it's just a phone call away" in a KO template. However, this template is created through the afterProcess method LayoutProcessPlugin.php file.



      I do not know how to modify the template so that I can add this messaging after the Delivery Time Slots field. Right now to get around that, I created a custom js file that appends a HTML element after the Delivery Time Slots field. However, the JS file is loading before the KO template finishing loading so doesn't append the message. I wrapped it around a 3 second settimeout() event, but I do not think this is the best way to do this. Below I included the php file that processes the layout (LayoutProcessorPlugin.php) and the custom JS file I created (orderdeliverydate.js).



      File: Bss/OrderDeliveryDate/Block/Plugin/Checkout/LayoutProcessorPlugin.php



      class LayoutProcessorPlugin

      protected $_helper;
      const DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS = 0;
      const DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD = 1;
      const DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS = 2;

      public function __construct(
      BssOrderDeliveryDateHelperData $helper
      )
      $this->_helper = $helper;


      public function afterProcess(
      MagentoCheckoutBlockCheckoutLayoutProcessor $subject,
      array $jsLayout
      )
      $container = null;
      if(!$this->_helper->isEnabled()) return $jsLayout;
      if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_ADDRESS)
      $container = 'shipping-address-fieldset';
      elseif($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_SHIPPING_METHOD)
      $container = 'before-shipping-method-form';


      if($this->_helper->getTimeSlot())
      // before place order
      if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
      $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
      ['payment']['children']['payments-list']['children']['before-place-order']['children']['delivery_time_slot'] = [
      'component' => 'Magento_Ui/js/form/element/select',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/select',
      'id' => 'delivery-time-slot'
      ],
      'caption' => 'Please select delivery time slot',
      'dataScope' => 'shippingAddress.delivery_time_slot',
      'label' => 'Delivery Time Slot',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'options' => $this->_helper->getTimeSlot(),
      'sortOrder' => 201,
      'id' => 'delivery-time-slot',
      ];
      else
      $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
      ['shippingAddress']['children'][$container]['children']['delivery_time_slot'] = [
      'component' => 'Magento_Ui/js/form/element/select',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/select',
      'id' => 'delivery-time-slot'
      ],
      'caption' => 'Please select delivery time slot',
      'dataScope' => 'shippingAddress.delivery_time_slot',
      'label' => 'Delivery Time Slot',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'options' => $this->_helper->getTimeSlot(),
      'sortOrder' => 201,
      'id' => 'delivery-time-slot',
      ];


      // before place order
      if($this->_helper->getDisplayAt() == self::DELIVERY_FORM_DISPLAY_AT_REVIEW_PAYMENTS)
      $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
      ['payment']['children']['payments-list']['children']['before-place-order']['children']['shipping_arrival_comments'] = [
      'component' => 'Magento_Ui/js/form/element/textarea',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/textarea',
      'id' => 'shipping-arrival-comments',
      'rows' => 5
      ],
      'dataScope' => 'shippingAddress.shipping_arrival_comments',
      'label' => 'Shipping Arrival Comment',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'sortOrder' => 202,
      'id' => 'shipping-arrival-comments'
      ];
      else
      $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
      ['shippingAddress']['children'][$container]['children']['shipping_arrival_comments'] = [
      'component' => 'Magento_Ui/js/form/element/textarea',
      'config' => [
      'customScope' => 'shippingAddress',
      'template' => 'ui/form/field',
      'elementTmpl' => 'ui/form/element/textarea',
      'id' => 'shipping-arrival-comments',
      'rows' => 5
      ],
      'dataScope' => 'shippingAddress.shipping_arrival_comments',
      'label' => 'Shipping Arrival Comment',
      'provider' => 'checkoutProvider',
      'visible' => true,
      'validation' => [],
      'sortOrder' => 202,
      'id' => 'shipping-arrival-comments'
      ];

      return $jsLayout;




      File: MyVendor/OrderDeliveryDate/view/frontend/web/orderdeliverydate.js



      require([
      'jquery'
      ], function($)
      'use strict';


      $(document).ready(function()
      console.log("I am getting executed");
      setTimeout(function()

      console.log("In Timeout");
      if ($("div[name='shippingAddress.delivery_time_slot']").length)
      console.log("It exists!");
      $("div[name='shippingAddress.delivery_time_slot']").after("<div class='field' id='delivery_time_sot_message'>Need it by today? Anything is possible, it's just a phone call away</div>");

      , 3000);




      );
      );






      magento2 plugin knockoutjs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 29 '16 at 1:40









      Noemi QuezadaNoemi Quezada

      5199 silver badges31 bronze badges




      5199 silver badges31 bronze badges




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I think the way to do this is to make a copy of the file Magento_Ui/view/frontend/web/templates/form/field.html into your module under module_directory/view/frontend/web/templates/form/. You'll then insert your text element into this file somewhere towards the bottom.
          Then modify the LayoutProcessorPlugin by replacing the occurrences of ui/form/field under the 'Delivery Time Slot' element with Your_Module/form/field.






          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f128029%2fmagento-2-add-a-message-to-a-ko-template-that-is-created-through-a-layoutproce%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I think the way to do this is to make a copy of the file Magento_Ui/view/frontend/web/templates/form/field.html into your module under module_directory/view/frontend/web/templates/form/. You'll then insert your text element into this file somewhere towards the bottom.
            Then modify the LayoutProcessorPlugin by replacing the occurrences of ui/form/field under the 'Delivery Time Slot' element with Your_Module/form/field.






            share|improve this answer



























              0














              I think the way to do this is to make a copy of the file Magento_Ui/view/frontend/web/templates/form/field.html into your module under module_directory/view/frontend/web/templates/form/. You'll then insert your text element into this file somewhere towards the bottom.
              Then modify the LayoutProcessorPlugin by replacing the occurrences of ui/form/field under the 'Delivery Time Slot' element with Your_Module/form/field.






              share|improve this answer

























                0












                0








                0







                I think the way to do this is to make a copy of the file Magento_Ui/view/frontend/web/templates/form/field.html into your module under module_directory/view/frontend/web/templates/form/. You'll then insert your text element into this file somewhere towards the bottom.
                Then modify the LayoutProcessorPlugin by replacing the occurrences of ui/form/field under the 'Delivery Time Slot' element with Your_Module/form/field.






                share|improve this answer













                I think the way to do this is to make a copy of the file Magento_Ui/view/frontend/web/templates/form/field.html into your module under module_directory/view/frontend/web/templates/form/. You'll then insert your text element into this file somewhere towards the bottom.
                Then modify the LayoutProcessorPlugin by replacing the occurrences of ui/form/field under the 'Delivery Time Slot' element with Your_Module/form/field.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 29 '16 at 2:15









                Aaron AllenAaron Allen

                6,9742 gold badges11 silver badges31 bronze badges




                6,9742 gold badges11 silver badges31 bronze badges



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f128029%2fmagento-2-add-a-message-to-a-ko-template-that-is-created-through-a-layoutproce%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                    Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                    Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림