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?
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.
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
add a comment |
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.
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
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
add a comment |
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.
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
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.
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
shipping-methods magento2.3 system-config logo
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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!
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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!
add a comment |
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!
add a comment |
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!
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!
answered 2 days ago
Chirag PatelChirag Patel
2,443423
2,443423
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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