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

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form