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;








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;










share|improve this question









New contributor



Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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

















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;










share|improve this question









New contributor



Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • 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













0












0








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;










share|improve this question









New contributor



Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor



Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited Jun 3 at 14:11







Joe_Coder













New contributor



Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked Jun 3 at 14:03









Joe_CoderJoe_Coder

32




32




New contributor



Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Joe_Coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.














  • 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

















  • 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
















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










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.









draft saved

draft discarded


















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.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?