I have created a module to add a shipping method logo. In backend its successfully working fine like uploading logo image, deleting logo image, etc. Please see the below image.

enter image description here

But I am stuck to display that logo image on checkout page shipping method list.

How to display custom system configuration value in knockoutjs html file. I am new to knockoutjs, please give me steps to add a logo in rates array.

  • Please check this link magento.stackexchange.com/questions/163822/… Commented Mar 30, 2019 at 11:49
  • you are welcome Commented Apr 1, 2019 at 8:10
  • Hello @KamleshSolanki when I change the country its reflect to shipping methods section and then logo disappear. I debug and see that in the consol that there will be another json response in which my logo is not available. Where will this json prepare?
    – Hiren Shah
    Commented Apr 2, 2019 at 6:34
  • You have debugged the JS file from console and find out that which response doesn't have logo field. Commented Apr 2, 2019 at 7:46
  • Hi @HirenShah . Could you explain how to get value from core_config_data ? I've created field with image, but have no idea how to display it in .html file in shipping-method-item.html
    – SebastianT
    Commented Mar 4, 2020 at 9:53

1 Answer 1


Try with below way.



], function (ko, $, Component, storage, url) { 'use strict';

return Component.extend({
    defaults: {
        template: 'Vendor_ModueName/payment/payment'
    getconfigValue: function () {
        var serviceUrl = url.build('modulename/custom/storeconfig');

            function (response) {
                if (response.success) {
                    return response.value
            function (response) {
                return response.value
        return false;

Create controller


namespace Vendor\ModuleName\Controller\Custom;

class Storeconfig extends \Magento\Framework\App\Action\Action {

protected $resultJsonFactory;

protected $storeManager;

protected $scopeConfig;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
    $this->resultJsonFactory = $resultJsonFactory;
    $this->storeManager = $storeManager;
    $this->scopeConfig = $scopeConfig;

 * Execute view action
 * @return \Magento\Framework\Controller\ResultInterface
public function execute()
    $response = [];
    try {
        $configValue = $this->scopeConfig->getValue(
        $response = [
            'success' => true,
            'value' => __($configValue)

    } catch (\Exception $e) {
        $response = [
            'success' => false,
            'value' => __($e->getMessage())
    $resultJson = $this->resultJsonFactory->create();
    return $resultJson->setData($response);


Show config value using .html file as per below code.

<div class="config-data-show" data-bind="html: getconfigValue"></div>

Take reference from below 2 links

Using the above 2 links you will get definitely result.

I hope it helps!

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.