Magento 2 Create Shipping Method with Delivery Options

I created a new shipping method for home delivery and I want to be able to present options such as a building/unit/room number. My thought was when the user selected this method the options would appear with a text field for the user to enter information before moving to the payment page. Any guidance on the best way to make this happen?

This is in Model/Carrier

/**      * @param \Magento\Framework\App\Config\ScopeConfigInterface $  scopeConfig      * @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $  rateErrorFactory      * @param \Psr\Log\LoggerInterface $  logger      * @param \Magento\Shipping\Model\Rate\ResultFactory $  rateResultFactory      * @param \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $  rateMethodFactory      * @param array $  data      */     public function __construct(         \Magento\Framework\App\Config\ScopeConfigInterface $  scopeConfig,         \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $  rateErrorFactory,         \Psr\Log\LoggerInterface $  logger,         \Magento\Shipping\Model\Rate\ResultFactory $  rateResultFactory,         \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $  rateMethodFactory,         array $  data = []     ) {         $  this->_rateResultFactory = $  rateResultFactory;         $  this->_rateMethodFactory = $  rateMethodFactory;         $  this->_logger = $  logger;         parent::__construct($  scopeConfig, $  rateErrorFactory, $  logger, $  data);     }      /**      * @param RateRequest $  request      * @return \Magento\Shipping\Model\Rate\Result|bool      */     public function collectRates(RateRequest $  request)     {         if (!$  this->getConfigFlag('active')) {             return false;         }          /** @var \Magento\Shipping\Model\Rate\Result $  result */         $  result = $  this->_rateResultFactory->create();          $  shippingPrice = $  this->getConfigData('price');         $  method = $  this->_rateMethodFactory->create();         $  method->setCarrier($  this->_code);         $  method->setCarrierTitle($  this->getConfigData('title'));         $  method->setMethod($  this->_code);         $  method->setMethodTitle($  this->getConfigData('name'));         $  method->setPrice($  shippingPrice);         $  method->setCost($  shippingPrice);         $  result->append($  method);           return $  result;     }      /**      * @return array      */     public function getAllowedMethods()     {          return [$  this->_code=> $  this->getConfigData('name')];     } 

I tried to create checkout_index_index.xml and add a custom phtml page to it with

<script type="text/javascript">     require([         'jquery',         'Magento_Checkout/js/model/quote',     ], function (jQuery, quote) {         jQuery(document).ready(function () {             quote.shippingMethod.subscribe(function (value) {                 if (quote.shippingMethod() && quote.shippingMethod().carrier_code == 'your_custom_shipping_method_code') {                     var customBlock = "<div class ='custom-information'><input type="text" id="your_custom_id"></div>";                     if((!$  ('.custom-information').length > 0)) {                         $  ('#checkout-shipping-method-load').append(customBlock);                     }                 });             });         });     }); </script> 

And then I added in Model

namespace Magento\Checkout\Model;  class GuestShippingInformationManagement implements \Magento\Checkout\Api\GuestShippingInformationManagementInterface {     /**      * @var \Magento\Quote\Model\QuoteIdMaskFactory      */     protected $  quoteIdMaskFactory;      /**      * @var \Magento\Checkout\Api\ShippingInformationManagementInterface      */     protected $  shippingInformationManagement;      /**      * @param \Magento\Quote\Model\QuoteIdMaskFactory $  quoteIdMaskFactory      * @param \Magento\Checkout\Api\ShippingInformationManagementInterface $  shippingInformationManagement      * @codeCoverageIgnore      */     public function __construct(         \Magento\Quote\Model\QuoteIdMaskFactory $  quoteIdMaskFactory,         \Magento\Checkout\Api\ShippingInformationManagementInterface $  shippingInformationManagement     ) {         $  this->quoteIdMaskFactory = $  quoteIdMaskFactory;         $  this->shippingInformationManagement = $  shippingInformationManagement;     }      /**      * {@inheritDoc}      */     public function saveAddressInformation(         $  cartId,         \Magento\Checkout\Api\Data\ShippingInformationInterface $  addressInformation     ) {         /** @var $  quoteIdMask \Magento\Quote\Model\QuoteIdMask */         $  quoteIdMask = $  this->quoteIdMaskFactory->create()->load($  cartId, 'masked_id');         return $  this->shippingInformationManagement->saveAddressInformation(             $  quoteIdMask->getQuoteId(),             $  addressInformation         );     } } 

and started to modify it but I think I may be headed in the wrong direction,

Thoughts on the best way to accomplish this?

Thanks!

IMAGES ON T-SHIRTS QUICKLY FAST DELIVERY. for $25

Do PUT IMAGES ON T-SHIRTS QUICKLY FAST DELIVERY. 1. Background removal / changing / transparent background     png / jpeg /other format. 2. convert your photo into any format. 3. product photo editing. 4. blur background. 5. images sharper. 6. image cropping. 7. hair masking. 8. image resize. 7. much more……. I offer only easy & single photo not for jewelry or Complex. For Complex Images please contact me.

by: rogermoss124
Created: —
Category: Graphics & Logos
Viewed: 165


Dúvida sobre CDN(Content Delivery Network)

Talvez minhas dúvidas sejam simples, mas me deixaram pensativo e querendo saber a respeito.

Visto que a CDN ajuda na distribuição do conteúdos, etc… Vamos supor que eu precise de contratar o serviço, então…

1- Quando se contrata uma hospedagem para o site, a CDN já vem inclusa no serviço de hospedagem? Ou depende da hospedagem?

2- E caso não venha incluso o serviço de CDN pela hospedagem, eu teria então que realizar a contratação, pois se trata de um serviço a parte, correto? Isso iria influenciar em algo pois tenho a hospedagem em um canto e o serviço de CDN em outro… Precisaria fazer algumas configurações?

Video Editing Services With Fast Delivery + 2nd Video For FREE for $5

Hi, i offer professional video editing services that deliver within 24h. Final video don’t exceed 3 min max. Previous work: https://youtu.be/TK7iUVBLzf4 More at my Youtube channel: https://www.youtube.com/MisterErgo Program used: – Adobe Premiere Pro – Adobe After Effect – Adobe Photoshop Offer: – Music video editing – Commercial and promotional content – Corporate and educational content – Showreel video – Travel and wedding video content – Motion graphics (Logo animation, Lower third, special effects) – Shake/deformation correction – Color correction Any format you want: MP4, MOV, MXF, etc… I can provide project files on request for free. Have a nice day.

by: MrErgo
Created: —
Category: Video
Viewed: 129


The Fastest YouTube Video Promotions Fast Delivery for $2

YouTube Video Marketing and Social Media Promotion in real wayUnique Features of My YouTube Service: • Good Viewers! • Good Quality • Fully Cooperation if any issue • Instant Start • Windows Desktop Watch Page Views • 100% Unique Traffic • Social Referrer • World-Wide Views Added in a NON-STOP Natural Pattern • Incremental Speed Based on Order Size • Must be Less than 30 Minutes Long • Must be Unrestricted & Open for ALL countries Order Now and Enjoy !! Please don’t Forgot to choice extra.

by: TonyStarkSourab
Created: —
Category: Social Networks
Viewed: 223


fast add Instant delivery 400,000 website worldwide targeted human traffic & google ranking factor for $8

welcome my best friends i hope you fine this is my new amazing traffic service for you instant delivery 400,000 website worldwide targeted human traffic & google ranking factor adsense safe real permanents human visitor Quality of service real human traffic life time guaranteed traffic 100% safe tracking link is available instant delivery fast response safe service for you i not accept download link just place order & see result i’m happy for your order

by: trustedseller20
Created: —
Category: Traffic
Viewed: 192


Instant delivery 200,000 website worldwide targeted human traffic & google ranking factor for $4

welcome my best friends i hope you fine this is my new amazing traffic service for you instant delivery 200,000 website worldwide targeted human traffic & google ranking factor adsense safe real permanents human visitor Quality of service real human traffic life time guaranteed traffic 100% safe tracking link is available instant delivery fast response safe service for you i not accept download link just place order & see result i’m happy for your order

by: trustedseller20
Created: —
Category: Traffic
Viewed: 144


Instant delivery 100,000 website worldwide targeted human traffic & google ranking factor for $2

welcome my best friends  i hope you fine  this is my new amazing traffic service for you  instant delivery 100,000 website worldwide targeted human traffic & google ranking factor adsense safe real permanents human visitor Quality of service  real human traffic  life time guaranteed traffic 100% safe  tracking link is available  instant delivery  fast response  safe service for you  i not accept download link  just place order & see result  i’m happy for your order 

by: trustedseller20
Created: —
Category: Traffic
Viewed: 106


How can I buy Path of Exile fast delivery?

Trading and crafting items can certainly seem daunting to newcomers, but our aim is to make it easy and convenient for our customers. We offer a huge selection of unique Path of Exile items with different sockets and links. We also have packs with different amounts of POE Currency, including every single one of them such as Exalted, Chaos, Jeweller's Orb, Orb of Fusing and Orb of Regret.

You can also find discount packs where you…

How can I buy Path of Exile fast delivery?