magento 2 - display shipping method logo The Next CEO of Stack OverflowHow can i add icon before shipping method name in magento2?Magento 2 get config values in view/frontend/web/template/payment .html fileMagento 2.1 :- Update Display Error Message in Checkout Cart PageMagento 2 additional data to shipping methodMagento 2 add custom data to shipping methodCheckout - get shipping methods in custom componentMagento 2: Shipping methods are not displayed while checkout process when cart quantity is 1Magento 2 : Checkout with new shipping method issue when code length exceeds 40 charactersHow to add default values for system configuration in magento 2Shipping modules does not update rate on zip code changes in guest-checkout page Magento 2 production modeMagento 2 - (Shipping Address) Custom city dropdown validation not working in checkout pageMagento 2.3 : How to change the logo?

Can you teleport closer to a creature you are Frightened of?

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

What difference does it make matching a word with/without a trailing whitespace?

Man transported from Alternate World into ours by a Neutrino Detector

How badly should I try to prevent a user from XSSing themselves?

Find the majority element, which appears more than half the time

Is it possible to make a 9x9 table fit within the default margins?

Does the Idaho Potato Commission associate potato skins with healthy eating?

What steps are necessary to read a Modern SSD in Medieval Europe?

Is it reasonable to ask other researchers to send me their previous grant applications?

My boss doesn't want me to have a side project

Does int main() need a declaration on C++?

Early programmable calculators with RS-232

Upgrading From a 9 Speed Sora Derailleur?

How does a dynamic QR code work?

That's an odd coin - I wonder why

Can I cast Thunderwave and be at the center of its bottom face, but not be affected by it?

Read/write a pipe-delimited file line by line with some simple text manipulation

Is a linearly independent set whose span is dense a Schauder basis?

What happens if you break a law in another country outside of that country?

Why does sin(x) - sin(y) equal this?

How should I connect my cat5 cable to connectors having an orange-green line?

How to implement Comparable so it is consistent with identity-equality

How can the PCs determine if an item is a phylactery?



magento 2 - display shipping method logo



The Next CEO of Stack OverflowHow can i add icon before shipping method name in magento2?Magento 2 get config values in view/frontend/web/template/payment .html fileMagento 2.1 :- Update Display Error Message in Checkout Cart PageMagento 2 additional data to shipping methodMagento 2 add custom data to shipping methodCheckout - get shipping methods in custom componentMagento 2: Shipping methods are not displayed while checkout process when cart quantity is 1Magento 2 : Checkout with new shipping method issue when code length exceeds 40 charactersHow to add default values for system configuration in magento 2Shipping modules does not update rate on zip code changes in guest-checkout page Magento 2 production modeMagento 2 - (Shipping Address) Custom city dropdown validation not working in checkout pageMagento 2.3 : How to change the logo?










1















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.










share|improve this question
























  • Please check this link magento.stackexchange.com/questions/163822/…

    – Kamlesh Solanki
    2 days ago











  • Thanks @KamleshSolanki Its working fine.

    – Hiren Shah
    2 days ago











  • you are welcome

    – Kamlesh Solanki
    21 hours ago
















1















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.










share|improve this question
























  • Please check this link magento.stackexchange.com/questions/163822/…

    – Kamlesh Solanki
    2 days ago











  • Thanks @KamleshSolanki Its working fine.

    – Hiren Shah
    2 days ago











  • you are welcome

    – Kamlesh Solanki
    21 hours ago














1












1








1








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.










share|improve this question
















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.







shipping-methods magento2.3 system-config logo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago









Chirag Patel

2,443423




2,443423










asked 2 days ago









Hiren ShahHiren Shah

6419




6419












  • Please check this link magento.stackexchange.com/questions/163822/…

    – Kamlesh Solanki
    2 days ago











  • Thanks @KamleshSolanki Its working fine.

    – Hiren Shah
    2 days ago











  • you are welcome

    – Kamlesh Solanki
    21 hours ago


















  • Please check this link magento.stackexchange.com/questions/163822/…

    – Kamlesh Solanki
    2 days ago











  • Thanks @KamleshSolanki Its working fine.

    – Hiren Shah
    2 days ago











  • you are welcome

    – Kamlesh Solanki
    21 hours ago

















Please check this link magento.stackexchange.com/questions/163822/…

– Kamlesh Solanki
2 days ago





Please check this link magento.stackexchange.com/questions/163822/…

– Kamlesh Solanki
2 days ago













Thanks @KamleshSolanki Its working fine.

– Hiren Shah
2 days ago





Thanks @KamleshSolanki Its working fine.

– Hiren Shah
2 days ago













you are welcome

– Kamlesh Solanki
21 hours ago






you are welcome

– Kamlesh Solanki
21 hours ago











1 Answer
1






active

oldest

votes


















0














Try with below way.




app/code/Vendor/ModuleName/view/frontend/web/js/view/custom-shipping.js




define([
'ko',
'jquery',
'uiComponent',
'mage/storage',
'mage/url'


], 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');

storage.get(serviceUrl).done(
function (response)
if (response.success)
return response.value


).fail(
function (response)
return response.value

);
return false;

);
);


Create controller




app/code/Vendor/ModuleName/Controller/Custom/Storeconfig.php




namespace VendorModuleNameControllerCustom;


class Storeconfig extends MagentoFrameworkAppActionAction



protected $resultJsonFactory;

protected $storeManager;

protected $scopeConfig;

public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
MagentoStoreModelStoreManagerInterface $storeManager,
MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
)
$this->resultJsonFactory = $resultJsonFactory;
$this->storeManager = $storeManager;
$this->scopeConfig = $scopeConfig;
parent::__construct($context);


/**
* Execute view action
*
* @return MagentoFrameworkControllerResultInterface
*/
public function execute()

$response = [];
try
$configValue = $this->scopeConfig->getValue(
'your/path/config',
MagentoStoreModelScopeInterface::SCOPE_STORE
);
$response = [
'success' => true,
'value' => __($configValue)
];

catch (Exception $e)
$response = [
'success' => false,
'value' => __($e->getMessage())
];
$this->messageManager->addError($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



  • How to get system config value to knockout template

  • How to add shipping image or icon before shipping methode

Using the above 2 links you will get definitely result.



I hope it helps!






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%2f268055%2fmagento-2-display-shipping-method-logo%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














    Try with below way.




    app/code/Vendor/ModuleName/view/frontend/web/js/view/custom-shipping.js




    define([
    'ko',
    'jquery',
    'uiComponent',
    'mage/storage',
    'mage/url'


    ], 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');

    storage.get(serviceUrl).done(
    function (response)
    if (response.success)
    return response.value


    ).fail(
    function (response)
    return response.value

    );
    return false;

    );
    );


    Create controller




    app/code/Vendor/ModuleName/Controller/Custom/Storeconfig.php




    namespace VendorModuleNameControllerCustom;


    class Storeconfig extends MagentoFrameworkAppActionAction



    protected $resultJsonFactory;

    protected $storeManager;

    protected $scopeConfig;

    public function __construct(
    MagentoFrameworkAppActionContext $context,
    MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
    MagentoStoreModelStoreManagerInterface $storeManager,
    MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
    )
    $this->resultJsonFactory = $resultJsonFactory;
    $this->storeManager = $storeManager;
    $this->scopeConfig = $scopeConfig;
    parent::__construct($context);


    /**
    * Execute view action
    *
    * @return MagentoFrameworkControllerResultInterface
    */
    public function execute()

    $response = [];
    try
    $configValue = $this->scopeConfig->getValue(
    'your/path/config',
    MagentoStoreModelScopeInterface::SCOPE_STORE
    );
    $response = [
    'success' => true,
    'value' => __($configValue)
    ];

    catch (Exception $e)
    $response = [
    'success' => false,
    'value' => __($e->getMessage())
    ];
    $this->messageManager->addError($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



    • How to get system config value to knockout template

    • How to add shipping image or icon before shipping methode

    Using the above 2 links you will get definitely result.



    I hope it helps!






    share|improve this answer



























      0














      Try with below way.




      app/code/Vendor/ModuleName/view/frontend/web/js/view/custom-shipping.js




      define([
      'ko',
      'jquery',
      'uiComponent',
      'mage/storage',
      'mage/url'


      ], 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');

      storage.get(serviceUrl).done(
      function (response)
      if (response.success)
      return response.value


      ).fail(
      function (response)
      return response.value

      );
      return false;

      );
      );


      Create controller




      app/code/Vendor/ModuleName/Controller/Custom/Storeconfig.php




      namespace VendorModuleNameControllerCustom;


      class Storeconfig extends MagentoFrameworkAppActionAction



      protected $resultJsonFactory;

      protected $storeManager;

      protected $scopeConfig;

      public function __construct(
      MagentoFrameworkAppActionContext $context,
      MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
      MagentoStoreModelStoreManagerInterface $storeManager,
      MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
      )
      $this->resultJsonFactory = $resultJsonFactory;
      $this->storeManager = $storeManager;
      $this->scopeConfig = $scopeConfig;
      parent::__construct($context);


      /**
      * Execute view action
      *
      * @return MagentoFrameworkControllerResultInterface
      */
      public function execute()

      $response = [];
      try
      $configValue = $this->scopeConfig->getValue(
      'your/path/config',
      MagentoStoreModelScopeInterface::SCOPE_STORE
      );
      $response = [
      'success' => true,
      'value' => __($configValue)
      ];

      catch (Exception $e)
      $response = [
      'success' => false,
      'value' => __($e->getMessage())
      ];
      $this->messageManager->addError($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



      • How to get system config value to knockout template

      • How to add shipping image or icon before shipping methode

      Using the above 2 links you will get definitely result.



      I hope it helps!






      share|improve this answer

























        0












        0








        0







        Try with below way.




        app/code/Vendor/ModuleName/view/frontend/web/js/view/custom-shipping.js




        define([
        'ko',
        'jquery',
        'uiComponent',
        'mage/storage',
        'mage/url'


        ], 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');

        storage.get(serviceUrl).done(
        function (response)
        if (response.success)
        return response.value


        ).fail(
        function (response)
        return response.value

        );
        return false;

        );
        );


        Create controller




        app/code/Vendor/ModuleName/Controller/Custom/Storeconfig.php




        namespace VendorModuleNameControllerCustom;


        class Storeconfig extends MagentoFrameworkAppActionAction



        protected $resultJsonFactory;

        protected $storeManager;

        protected $scopeConfig;

        public function __construct(
        MagentoFrameworkAppActionContext $context,
        MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
        MagentoStoreModelStoreManagerInterface $storeManager,
        MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
        )
        $this->resultJsonFactory = $resultJsonFactory;
        $this->storeManager = $storeManager;
        $this->scopeConfig = $scopeConfig;
        parent::__construct($context);


        /**
        * Execute view action
        *
        * @return MagentoFrameworkControllerResultInterface
        */
        public function execute()

        $response = [];
        try
        $configValue = $this->scopeConfig->getValue(
        'your/path/config',
        MagentoStoreModelScopeInterface::SCOPE_STORE
        );
        $response = [
        'success' => true,
        'value' => __($configValue)
        ];

        catch (Exception $e)
        $response = [
        'success' => false,
        'value' => __($e->getMessage())
        ];
        $this->messageManager->addError($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



        • How to get system config value to knockout template

        • How to add shipping image or icon before shipping methode

        Using the above 2 links you will get definitely result.



        I hope it helps!






        share|improve this answer













        Try with below way.




        app/code/Vendor/ModuleName/view/frontend/web/js/view/custom-shipping.js




        define([
        'ko',
        'jquery',
        'uiComponent',
        'mage/storage',
        'mage/url'


        ], 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');

        storage.get(serviceUrl).done(
        function (response)
        if (response.success)
        return response.value


        ).fail(
        function (response)
        return response.value

        );
        return false;

        );
        );


        Create controller




        app/code/Vendor/ModuleName/Controller/Custom/Storeconfig.php




        namespace VendorModuleNameControllerCustom;


        class Storeconfig extends MagentoFrameworkAppActionAction



        protected $resultJsonFactory;

        protected $storeManager;

        protected $scopeConfig;

        public function __construct(
        MagentoFrameworkAppActionContext $context,
        MagentoFrameworkControllerResultJsonFactory $resultJsonFactory,
        MagentoStoreModelStoreManagerInterface $storeManager,
        MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
        )
        $this->resultJsonFactory = $resultJsonFactory;
        $this->storeManager = $storeManager;
        $this->scopeConfig = $scopeConfig;
        parent::__construct($context);


        /**
        * Execute view action
        *
        * @return MagentoFrameworkControllerResultInterface
        */
        public function execute()

        $response = [];
        try
        $configValue = $this->scopeConfig->getValue(
        'your/path/config',
        MagentoStoreModelScopeInterface::SCOPE_STORE
        );
        $response = [
        'success' => true,
        'value' => __($configValue)
        ];

        catch (Exception $e)
        $response = [
        'success' => false,
        'value' => __($e->getMessage())
        ];
        $this->messageManager->addError($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



        • How to get system config value to knockout template

        • How to add shipping image or icon before shipping methode

        Using the above 2 links you will get definitely result.



        I hope it helps!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        Chirag PatelChirag Patel

        2,443423




        2,443423



























            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%2f268055%2fmagento-2-display-shipping-method-logo%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

            Sum ergo cogito? 1 nng

            三茅街道4182Guuntc Dn precexpngmageondP