Magento 2 - Allow custom shipping method only for onepage checkout customersRedirect in OnePage Checkout during checkout in “Shipping Method” to shipping provider's web (onepage)OnePage checkout same Billing and Shipping addressesGet shipping address in onepage checkout sessionHow to skip Shipping method step in checkout if only one shipping method in Magento 2?Magento 2: Which event get called when selecting shipping method on checkout?Change default behaviour for address selection in checkoutComplete checkout without shipping method availableMagento 2 : How to get postcode from selected shipping addresses in checkout page?Magento2 Checkout Page web matrix Shipping Method by default selectedMagento 1: Add Option to Shipping Address Selection
What aircraft was used as Air Force One for the flight between Southampton and Shannon?
What is the logic behind charging tax _in the form of money_ for owning property when the property does not produce money?
Do you have to have figures when playing D&D?
Did Apple bundle a specific monitor with the Apple II+ for schools?
Analogy between an unknown in an argument, and a contradiction in the principle of explosion
Is the use of umgeben in the passive unusual?
Getting UPS Power from One Room to Another
The origin of the Russian proverb about two hares
Ability To Change Root User Password (Vulnerability?)
Who won a Game of Bar Dice?
Do people with slow metabolism tend to gain weight (fat) if they stop exercising?
Reference to understand the notation of orbital charts
Do you need to let the DM know when you are multiclassing?
Does the Nuka-Cola bottler actually generate nuka cola?
Why the output signal of my amplifier is heavily distorted
What is this Amiga 1200 mod?
Difference between prepositions in "...killed during/in the war"
Can you make an identity from this product?
Why is long-term living in Almost-Earth causing severe health problems?
Is it possible to fly backward if you have really strong headwind?
Can we completely replace inheritance using strategy pattern and dependency injection?
C++ logging library
Who voices the small round football sized demon in Good Omens?
60s or 70s novel about Empire of Man making 1st contact with 1st discovered alien race
Magento 2 - Allow custom shipping method only for onepage checkout customers
Redirect in OnePage Checkout during checkout in “Shipping Method” to shipping provider's web (onepage)OnePage checkout same Billing and Shipping addressesGet shipping address in onepage checkout sessionHow to skip Shipping method step in checkout if only one shipping method in Magento 2?Magento 2: Which event get called when selecting shipping method on checkout?Change default behaviour for address selection in checkoutComplete checkout without shipping method availableMagento 2 : How to get postcode from selected shipping addresses in checkout page?Magento2 Checkout Page web matrix Shipping Method by default selectedMagento 1: Add Option to Shipping Address Selection
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
is it possible to display a custom shipping method option only to customers using the one page checkout method? In other words I do not want to display my shipping method if the "Ship to multiple addresses" option is selected. I have tried to look to the collectRates
function to add logic there, but I am not sure how to determine whether one page checkout is being used or not?
Any help or advice would be appreciated.
Code I have for the collectRates
method:
public function collectRates(RateRequest $request)
!$this->postcodeValidate($request->getDestPostcode()))
return false;
$result = $this->_rateResultFactory->create();
$shippingPrice = $this->getConfigData('price');
$method = $this->_rateMethodFactory->create();
$method->setCarrier($this->getCarrierCode());
$method->setCarrierTitle($this->getConfigData('title'));
$method->setMethod($this->getCarrierCode());
$method->setMethodTitle($this->getConfigData('name'));
$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);
$result->append($method);
return $result;
magento2 checkout onepage-checkout
New contributor
add a comment |
is it possible to display a custom shipping method option only to customers using the one page checkout method? In other words I do not want to display my shipping method if the "Ship to multiple addresses" option is selected. I have tried to look to the collectRates
function to add logic there, but I am not sure how to determine whether one page checkout is being used or not?
Any help or advice would be appreciated.
Code I have for the collectRates
method:
public function collectRates(RateRequest $request)
!$this->postcodeValidate($request->getDestPostcode()))
return false;
$result = $this->_rateResultFactory->create();
$shippingPrice = $this->getConfigData('price');
$method = $this->_rateMethodFactory->create();
$method->setCarrier($this->getCarrierCode());
$method->setCarrierTitle($this->getConfigData('title'));
$method->setMethod($this->getCarrierCode());
$method->setMethodTitle($this->getConfigData('name'));
$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);
$result->append($method);
return $result;
magento2 checkout onepage-checkout
New contributor
share the code what you have try.
– Dhiren Vasoya
Jun 3 at 14:05
@DhirenVasoya - I have added mycollectRates
function that I have with my own postcode check, but I am not sure what I need to look for to determine what checkout type is being used
– Joe_Coder
Jun 3 at 14:12
add a comment |
is it possible to display a custom shipping method option only to customers using the one page checkout method? In other words I do not want to display my shipping method if the "Ship to multiple addresses" option is selected. I have tried to look to the collectRates
function to add logic there, but I am not sure how to determine whether one page checkout is being used or not?
Any help or advice would be appreciated.
Code I have for the collectRates
method:
public function collectRates(RateRequest $request)
!$this->postcodeValidate($request->getDestPostcode()))
return false;
$result = $this->_rateResultFactory->create();
$shippingPrice = $this->getConfigData('price');
$method = $this->_rateMethodFactory->create();
$method->setCarrier($this->getCarrierCode());
$method->setCarrierTitle($this->getConfigData('title'));
$method->setMethod($this->getCarrierCode());
$method->setMethodTitle($this->getConfigData('name'));
$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);
$result->append($method);
return $result;
magento2 checkout onepage-checkout
New contributor
is it possible to display a custom shipping method option only to customers using the one page checkout method? In other words I do not want to display my shipping method if the "Ship to multiple addresses" option is selected. I have tried to look to the collectRates
function to add logic there, but I am not sure how to determine whether one page checkout is being used or not?
Any help or advice would be appreciated.
Code I have for the collectRates
method:
public function collectRates(RateRequest $request)
!$this->postcodeValidate($request->getDestPostcode()))
return false;
$result = $this->_rateResultFactory->create();
$shippingPrice = $this->getConfigData('price');
$method = $this->_rateMethodFactory->create();
$method->setCarrier($this->getCarrierCode());
$method->setCarrierTitle($this->getConfigData('title'));
$method->setMethod($this->getCarrierCode());
$method->setMethodTitle($this->getConfigData('name'));
$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);
$result->append($method);
return $result;
magento2 checkout onepage-checkout
magento2 checkout onepage-checkout
New contributor
New contributor
edited Jun 3 at 14:11
Joe_Coder
New contributor
asked Jun 3 at 14:03
Joe_CoderJoe_Coder
32
32
New contributor
New contributor
share the code what you have try.
– Dhiren Vasoya
Jun 3 at 14:05
@DhirenVasoya - I have added mycollectRates
function that I have with my own postcode check, but I am not sure what I need to look for to determine what checkout type is being used
– Joe_Coder
Jun 3 at 14:12
add a comment |
share the code what you have try.
– Dhiren Vasoya
Jun 3 at 14:05
@DhirenVasoya - I have added mycollectRates
function that I have with my own postcode check, but I am not sure what I need to look for to determine what checkout type is being used
– Joe_Coder
Jun 3 at 14:12
share the code what you have try.
– Dhiren Vasoya
Jun 3 at 14:05
share the code what you have try.
– Dhiren Vasoya
Jun 3 at 14:05
@DhirenVasoya - I have added my
collectRates
function that I have with my own postcode check, but I am not sure what I need to look for to determine what checkout type is being used– Joe_Coder
Jun 3 at 14:12
@DhirenVasoya - I have added my
collectRates
function that I have with my own postcode check, but I am not sure what I need to look for to determine what checkout type is being used– Joe_Coder
Jun 3 at 14:12
add a comment |
0
active
oldest
votes
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
);
);
Joe_Coder is a new contributor. Be nice, and check out our Code of Conduct.
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%2f277096%2fmagento-2-allow-custom-shipping-method-only-for-onepage-checkout-customers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Joe_Coder is a new contributor. Be nice, and check out our Code of Conduct.
Joe_Coder is a new contributor. Be nice, and check out our Code of Conduct.
Joe_Coder is a new contributor. Be nice, and check out our Code of Conduct.
Joe_Coder is a new contributor. Be nice, and check out our Code of Conduct.
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%2f277096%2fmagento-2-allow-custom-shipping-method-only-for-onepage-checkout-customers%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
share the code what you have try.
– Dhiren Vasoya
Jun 3 at 14:05
@DhirenVasoya - I have added my
collectRates
function that I have with my own postcode check, but I am not sure what I need to look for to determine what checkout type is being used– Joe_Coder
Jun 3 at 14:12