Please look at https://github.com/sivajik34/Delivery-Signature-Magento2.


<div data-bind="visible: canVisibleDeliverySignBlock">
<input type="checkbox" name="delivery-signature" value="delivery-signature"> <span class="price"><span data-bind="text: getFormattedPrice(delivery-signature)" class="price">$5.00</span></span>Delivery Signature<br>

How to make $5 value as dynamic from config.I think I'm almost near to solution.but i have no proper idea on knockout.js

can you please help me on this?

1 Answer 1


Modify your js by following code:


    ], function (ko, Component, quote, priceUtils) {
        'use strict';
        var totals = quote.getTotals()();
        var subtotal = 0;
        if (totals) {
            subtotal = totals.subtotal;
        var show_hide_deliverysign_blockConfig = window.checkoutConfig.show_hide_deliverysign_block;
        var minimum_order_amount = window.checkoutConfig.minimum_order_amount;
        var delivery_sign_amount = window.checkoutConfig.delivery_sign_amount;
        return Component.extend({
            defaults: {
                template: 'Kensium_DeliverySign/checkout/shipping/delivery-signature'
            canVisibleDeliverySignBlock: show_hide_deliverysign_blockConfig,
            getFormattedPrice: ko.observable(priceUtils.formatPrice(minimum_order_amount, quote.getPriceFormat()))

And template should be

<div data-bind="visible: canVisibleDeliverySignBlock">
    <input type="checkbox" name="delivery-signature" value="delivery-signature"> <span data-bind="text: getFormattedPrice()" class="price"></span></span>Delivery Signature
  • thanks for your response,here i need to compare minimum_order_amount with order sub total.Can you give idea how to get order sub total here.based on that i need to display delivery signature field. Jul 7, 2016 at 9:51
  • check updated code.
    – Sohel Rana
    Jul 7, 2016 at 10:19
  • @SohelRana please check my threadhttps://magento.stackexchange.com/questions/194792/display-custom-module-data-using-knockout-js-in-magento-2/194793
    – Bojjaiah
    Sep 27, 2017 at 12:44

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.