Magento 2: How to Show method if not applicable Country Wise?Magento 2 checkout page how to get country_id from selected shipping addresses?Magento 2: How to get current shipping address country in shipping.html?Magento 2: DHL Shipping Method IssueMagento 2: DHL Shipping Method Element type “NewShipper” must be declaredMagento 2: Carrier with such method not foundTable weigh shipping inspite of Show Method if Not ApplicableDisplayed Error Message in Shipping Method not updating after saveMagento 2 free shipping method not showingShow error message on shipping method if not applicable in Magento 2Magento 2: Disable all methods when free shipping method is applicableMagento 2.2.4 Free Shipping Enable “Show Method” do not showMagento 2 : Restrict payment method by country not working
How does Loki do this?
Hostile work environment after whistle-blowing on coworker and our boss. What do I do?
How easy is it to start Magic from scratch?
What Brexit proposals are on the table in the indicative votes on the 27th of March 2019?
CREATE opcode: what does it really do?
How to check is there any negative term in a large list?
Is a stroke of luck acceptable after a series of unfavorable events?
How do scammers retract money, while you can’t?
Customer Requests (Sometimes) Drive Me Bonkers!
How to Reset Passwords on Multiple Websites Easily?
What is the intuitive meaning of having a linear relationship between the logs of two variables?
Is this apparent Class Action settlement a spam message?
What is the opposite of 'gravitas'?
For a non-Jew, is there a punishment for not observing the 7 Noahide Laws?
A particular customize with green line and letters for subfloat
You cannot touch me, but I can touch you, who am I?
Closest Prime Number
Anatomically Correct Strange Women In Ponds Distributing Swords
Why are there no referendums in the US?
Is `x >> pure y` equivalent to `liftM (const y) x`
Opposite of a diet
What does "I’d sit this one out, Cap," imply or mean in the context?
How did Doctor Strange see the winning outcome in Avengers: Infinity War?
Fine Tuning of the Universe
Magento 2: How to Show method if not applicable Country Wise?
Magento 2 checkout page how to get country_id from selected shipping addresses?Magento 2: How to get current shipping address country in shipping.html?Magento 2: DHL Shipping Method IssueMagento 2: DHL Shipping Method Element type “NewShipper” must be declaredMagento 2: Carrier with such method not foundTable weigh shipping inspite of Show Method if Not ApplicableDisplayed Error Message in Shipping Method not updating after saveMagento 2 free shipping method not showingShow error message on shipping method if not applicable in Magento 2Magento 2: Disable all methods when free shipping method is applicableMagento 2.2.4 Free Shipping Enable “Show Method” do not showMagento 2 : Restrict payment method by country not working
I'm using DHL Shipping Method. I have set Show Method if Not Applicable
to Yes
.
Displayed Error Message
will be displayed, when it's applicable.
I would like to show this Error Message by Specific Country.
Example: If it's Singapore then this message will be not displayed. For other countries, it will be displayed.
magento2 error shipping shipping-methods shipping-address
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm using DHL Shipping Method. I have set Show Method if Not Applicable
to Yes
.
Displayed Error Message
will be displayed, when it's applicable.
I would like to show this Error Message by Specific Country.
Example: If it's Singapore then this message will be not displayed. For other countries, it will be displayed.
magento2 error shipping shipping-methods shipping-address
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm using DHL Shipping Method. I have set Show Method if Not Applicable
to Yes
.
Displayed Error Message
will be displayed, when it's applicable.
I would like to show this Error Message by Specific Country.
Example: If it's Singapore then this message will be not displayed. For other countries, it will be displayed.
magento2 error shipping shipping-methods shipping-address
I'm using DHL Shipping Method. I have set Show Method if Not Applicable
to Yes
.
Displayed Error Message
will be displayed, when it's applicable.
I would like to show this Error Message by Specific Country.
Example: If it's Singapore then this message will be not displayed. For other countries, it will be displayed.
magento2 error shipping shipping-methods shipping-address
magento2 error shipping shipping-methods shipping-address
asked Dec 5 '16 at 4:36
Ankit ShahAnkit Shah
4,896967143
4,896967143
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Below is the solution
magentoappcodeCustomCheckoutviewfrontendrequirejs-config.js
var config =
"map":
"*":
"Magento_Checkout/js/model/shipping-service" : "Custom_Checkout/js/model/shipping-service"
;
magentoappcodeCustomCheckoutviewfrontendwebjsmodelshipping-service.js
/*global define*/
define(
[
'jquery', // For jQuery Added
'Magento_Checkout/js/model/quote', // For Quote Added
'ko',
'Magento_Checkout/js/model/checkout-data-resolver'
],
function ($, quote, ko, checkoutDataResolver)
"use strict";
var shippingRates = ko.observableArray([]);
return
isLoading: ko.observable(false),
/**
* Set shipping rates
*
* @param ratesData
*/
setShippingRates: function (ratesData)
// START TO REMOVE ERROR MESSAGE FOR DHL IF SG
var address = quote.shippingAddress();
$.each(ratesData, function (k, v)
if(v.method_code == null && v.carrier_code == 'dhl' && v.error_message != '' && address.countryId == 'SG')
ratesData.splice(k , 1);
);
// STOP TO REMOVE ERROR MESSAGE FOR DHL IF SG
shippingRates(ratesData);
shippingRates.valueHasMutated();
checkoutDataResolver.resolveShippingRates(ratesData);
,
/**
* Get shipping rates
*
* @returns *
*/
getShippingRates: function ()
return shippingRates;
;
);
If someone has solution on PHP side then it would be great.
add a comment |
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
);
);
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%2f148788%2fmagento-2-how-to-show-method-if-not-applicable-country-wise%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
Below is the solution
magentoappcodeCustomCheckoutviewfrontendrequirejs-config.js
var config =
"map":
"*":
"Magento_Checkout/js/model/shipping-service" : "Custom_Checkout/js/model/shipping-service"
;
magentoappcodeCustomCheckoutviewfrontendwebjsmodelshipping-service.js
/*global define*/
define(
[
'jquery', // For jQuery Added
'Magento_Checkout/js/model/quote', // For Quote Added
'ko',
'Magento_Checkout/js/model/checkout-data-resolver'
],
function ($, quote, ko, checkoutDataResolver)
"use strict";
var shippingRates = ko.observableArray([]);
return
isLoading: ko.observable(false),
/**
* Set shipping rates
*
* @param ratesData
*/
setShippingRates: function (ratesData)
// START TO REMOVE ERROR MESSAGE FOR DHL IF SG
var address = quote.shippingAddress();
$.each(ratesData, function (k, v)
if(v.method_code == null && v.carrier_code == 'dhl' && v.error_message != '' && address.countryId == 'SG')
ratesData.splice(k , 1);
);
// STOP TO REMOVE ERROR MESSAGE FOR DHL IF SG
shippingRates(ratesData);
shippingRates.valueHasMutated();
checkoutDataResolver.resolveShippingRates(ratesData);
,
/**
* Get shipping rates
*
* @returns *
*/
getShippingRates: function ()
return shippingRates;
;
);
If someone has solution on PHP side then it would be great.
add a comment |
Below is the solution
magentoappcodeCustomCheckoutviewfrontendrequirejs-config.js
var config =
"map":
"*":
"Magento_Checkout/js/model/shipping-service" : "Custom_Checkout/js/model/shipping-service"
;
magentoappcodeCustomCheckoutviewfrontendwebjsmodelshipping-service.js
/*global define*/
define(
[
'jquery', // For jQuery Added
'Magento_Checkout/js/model/quote', // For Quote Added
'ko',
'Magento_Checkout/js/model/checkout-data-resolver'
],
function ($, quote, ko, checkoutDataResolver)
"use strict";
var shippingRates = ko.observableArray([]);
return
isLoading: ko.observable(false),
/**
* Set shipping rates
*
* @param ratesData
*/
setShippingRates: function (ratesData)
// START TO REMOVE ERROR MESSAGE FOR DHL IF SG
var address = quote.shippingAddress();
$.each(ratesData, function (k, v)
if(v.method_code == null && v.carrier_code == 'dhl' && v.error_message != '' && address.countryId == 'SG')
ratesData.splice(k , 1);
);
// STOP TO REMOVE ERROR MESSAGE FOR DHL IF SG
shippingRates(ratesData);
shippingRates.valueHasMutated();
checkoutDataResolver.resolveShippingRates(ratesData);
,
/**
* Get shipping rates
*
* @returns *
*/
getShippingRates: function ()
return shippingRates;
;
);
If someone has solution on PHP side then it would be great.
add a comment |
Below is the solution
magentoappcodeCustomCheckoutviewfrontendrequirejs-config.js
var config =
"map":
"*":
"Magento_Checkout/js/model/shipping-service" : "Custom_Checkout/js/model/shipping-service"
;
magentoappcodeCustomCheckoutviewfrontendwebjsmodelshipping-service.js
/*global define*/
define(
[
'jquery', // For jQuery Added
'Magento_Checkout/js/model/quote', // For Quote Added
'ko',
'Magento_Checkout/js/model/checkout-data-resolver'
],
function ($, quote, ko, checkoutDataResolver)
"use strict";
var shippingRates = ko.observableArray([]);
return
isLoading: ko.observable(false),
/**
* Set shipping rates
*
* @param ratesData
*/
setShippingRates: function (ratesData)
// START TO REMOVE ERROR MESSAGE FOR DHL IF SG
var address = quote.shippingAddress();
$.each(ratesData, function (k, v)
if(v.method_code == null && v.carrier_code == 'dhl' && v.error_message != '' && address.countryId == 'SG')
ratesData.splice(k , 1);
);
// STOP TO REMOVE ERROR MESSAGE FOR DHL IF SG
shippingRates(ratesData);
shippingRates.valueHasMutated();
checkoutDataResolver.resolveShippingRates(ratesData);
,
/**
* Get shipping rates
*
* @returns *
*/
getShippingRates: function ()
return shippingRates;
;
);
If someone has solution on PHP side then it would be great.
Below is the solution
magentoappcodeCustomCheckoutviewfrontendrequirejs-config.js
var config =
"map":
"*":
"Magento_Checkout/js/model/shipping-service" : "Custom_Checkout/js/model/shipping-service"
;
magentoappcodeCustomCheckoutviewfrontendwebjsmodelshipping-service.js
/*global define*/
define(
[
'jquery', // For jQuery Added
'Magento_Checkout/js/model/quote', // For Quote Added
'ko',
'Magento_Checkout/js/model/checkout-data-resolver'
],
function ($, quote, ko, checkoutDataResolver)
"use strict";
var shippingRates = ko.observableArray([]);
return
isLoading: ko.observable(false),
/**
* Set shipping rates
*
* @param ratesData
*/
setShippingRates: function (ratesData)
// START TO REMOVE ERROR MESSAGE FOR DHL IF SG
var address = quote.shippingAddress();
$.each(ratesData, function (k, v)
if(v.method_code == null && v.carrier_code == 'dhl' && v.error_message != '' && address.countryId == 'SG')
ratesData.splice(k , 1);
);
// STOP TO REMOVE ERROR MESSAGE FOR DHL IF SG
shippingRates(ratesData);
shippingRates.valueHasMutated();
checkoutDataResolver.resolveShippingRates(ratesData);
,
/**
* Get shipping rates
*
* @returns *
*/
getShippingRates: function ()
return shippingRates;
;
);
If someone has solution on PHP side then it would be great.
answered Feb 9 '17 at 2:42
Ankit ShahAnkit Shah
4,896967143
4,896967143
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%2f148788%2fmagento-2-how-to-show-method-if-not-applicable-country-wise%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