Add custom block under selected shipping methode magento 2 not workingHow to show custom block on shipping method select in Magento 2Custom Shipping Method - Retrieve Shipping address in collectRatesShipping method that changes shipping address magentoMagento 2 - Add custom block to admin order create formHow to show custom block on shipping method select in Magento 2Get customer chosen shipping method with jQueryMagento 2 checkout - move Shipping methods blockM2 - Forget selected shipping methodMagento 2: Shipping Methods not reload automaticallyHow can I set a default shipping method if there is multiple and how can I add charge of it to total in Checkout?Free shipping code is not working for UPS in magento 2

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

Why do I get two different answers for this counting problem?

What typically incentivizes a professor to change jobs to a lower ranking university?

Important Resources for Dark Age Civilizations?

Alternative to sending password over mail?

Roll the carpet

How much of data wrangling is a data scientist's job?

Is it possible for a square root function,f(x), to map to a finite number of integers for all x in domain of f?

Why doesn't H₄O²⁺ exist?

What's the point of deactivating Num Lock on login screens?

Which country benefited the most from UN Security Council vetoes?

Perform and show arithmetic with LuaLaTeX

When a company launches a new product do they "come out" with a new product or do they "come up" with a new product?

Today is the Center

Horror movie about a virus at the prom; beginning and end are stylized as a cartoon

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

What does the "remote control" for a QF-4 look like?

What does it mean to describe someone as a butt steak?

What would happen to a modern skyscraper if it rains micro blackholes?

Revoked SSL certificate

How does quantile regression compare to logistic regression with the variable split at the quantile?

Maximum likelihood parameters deviate from posterior distributions

RSA: Danger of using p to create q

Can a Cauchy sequence converge for one metric while not converging for another?



Add custom block under selected shipping methode magento 2 not working


How to show custom block on shipping method select in Magento 2Custom Shipping Method - Retrieve Shipping address in collectRatesShipping method that changes shipping address magentoMagento 2 - Add custom block to admin order create formHow to show custom block on shipping method select in Magento 2Get customer chosen shipping method with jQueryMagento 2 checkout - move Shipping methods blockM2 - Forget selected shipping methodMagento 2: Shipping Methods not reload automaticallyHow can I set a default shipping method if there is multiple and how can I add charge of it to total in Checkout?Free shipping code is not working for UPS in magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am creating a magento2 module and I want to add an html block to selected shipping method:
I am using jQuery to achieve this but I will accept other workarounds all I want is to make this work.



I tried this :



https://magento.stackexchange.com/a/162967/78274



But the problem is the block is added after all shipping methods which isn't what I am looking for. However I tried to use it.



I used jQuery and managed to add my block under selected shipping method but my problem is this works only the first time I load the page when mychippingmethod is selected by default, but when I reload the page even though mychippingmethod is selected by default nothing is added.
But if I click on my shipping method my block is added.



Then I tried to switch between after and append but nothing changed I had the same problem.



What I tried so far :



jQuery("tr:contains('mychippingmethod')").append("#my-carrier-custom-block-wrapper");


I also tried



var myelement = "example";
jQuery("tr:contains('mychippingmethod')").after(myelement);


Even trying to append a simple text doesn't work.



I wouldn't say that magento2 isn't allowing me to edit the shipping block since it does work the first time and this is what's making me frustrated why would it work the first time and then stops.



I would accept a solution to uncheck all the shipping methods by default too.



EDIT :



If i append :



<tr class="row"><td>aaaaaaaaa</td></tr>


My after function doesn't work even in the first time but If i select my shippingmethode my text gets appended ! so maybe I am adding it wrong



Please help.










share|improve this question









New contributor




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


























    1















    I am creating a magento2 module and I want to add an html block to selected shipping method:
    I am using jQuery to achieve this but I will accept other workarounds all I want is to make this work.



    I tried this :



    https://magento.stackexchange.com/a/162967/78274



    But the problem is the block is added after all shipping methods which isn't what I am looking for. However I tried to use it.



    I used jQuery and managed to add my block under selected shipping method but my problem is this works only the first time I load the page when mychippingmethod is selected by default, but when I reload the page even though mychippingmethod is selected by default nothing is added.
    But if I click on my shipping method my block is added.



    Then I tried to switch between after and append but nothing changed I had the same problem.



    What I tried so far :



    jQuery("tr:contains('mychippingmethod')").append("#my-carrier-custom-block-wrapper");


    I also tried



    var myelement = "example";
    jQuery("tr:contains('mychippingmethod')").after(myelement);


    Even trying to append a simple text doesn't work.



    I wouldn't say that magento2 isn't allowing me to edit the shipping block since it does work the first time and this is what's making me frustrated why would it work the first time and then stops.



    I would accept a solution to uncheck all the shipping methods by default too.



    EDIT :



    If i append :



    <tr class="row"><td>aaaaaaaaa</td></tr>


    My after function doesn't work even in the first time but If i select my shippingmethode my text gets appended ! so maybe I am adding it wrong



    Please help.










    share|improve this question









    New contributor




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






















      1












      1








      1








      I am creating a magento2 module and I want to add an html block to selected shipping method:
      I am using jQuery to achieve this but I will accept other workarounds all I want is to make this work.



      I tried this :



      https://magento.stackexchange.com/a/162967/78274



      But the problem is the block is added after all shipping methods which isn't what I am looking for. However I tried to use it.



      I used jQuery and managed to add my block under selected shipping method but my problem is this works only the first time I load the page when mychippingmethod is selected by default, but when I reload the page even though mychippingmethod is selected by default nothing is added.
      But if I click on my shipping method my block is added.



      Then I tried to switch between after and append but nothing changed I had the same problem.



      What I tried so far :



      jQuery("tr:contains('mychippingmethod')").append("#my-carrier-custom-block-wrapper");


      I also tried



      var myelement = "example";
      jQuery("tr:contains('mychippingmethod')").after(myelement);


      Even trying to append a simple text doesn't work.



      I wouldn't say that magento2 isn't allowing me to edit the shipping block since it does work the first time and this is what's making me frustrated why would it work the first time and then stops.



      I would accept a solution to uncheck all the shipping methods by default too.



      EDIT :



      If i append :



      <tr class="row"><td>aaaaaaaaa</td></tr>


      My after function doesn't work even in the first time but If i select my shippingmethode my text gets appended ! so maybe I am adding it wrong



      Please help.










      share|improve this question









      New contributor




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












      I am creating a magento2 module and I want to add an html block to selected shipping method:
      I am using jQuery to achieve this but I will accept other workarounds all I want is to make this work.



      I tried this :



      https://magento.stackexchange.com/a/162967/78274



      But the problem is the block is added after all shipping methods which isn't what I am looking for. However I tried to use it.



      I used jQuery and managed to add my block under selected shipping method but my problem is this works only the first time I load the page when mychippingmethod is selected by default, but when I reload the page even though mychippingmethod is selected by default nothing is added.
      But if I click on my shipping method my block is added.



      Then I tried to switch between after and append but nothing changed I had the same problem.



      What I tried so far :



      jQuery("tr:contains('mychippingmethod')").append("#my-carrier-custom-block-wrapper");


      I also tried



      var myelement = "example";
      jQuery("tr:contains('mychippingmethod')").after(myelement);


      Even trying to append a simple text doesn't work.



      I wouldn't say that magento2 isn't allowing me to edit the shipping block since it does work the first time and this is what's making me frustrated why would it work the first time and then stops.



      I would accept a solution to uncheck all the shipping methods by default too.



      EDIT :



      If i append :



      <tr class="row"><td>aaaaaaaaa</td></tr>


      My after function doesn't work even in the first time but If i select my shippingmethode my text gets appended ! so maybe I am adding it wrong



      Please help.







      magento2 php jquery






      share|improve this question









      New contributor




      Nicole 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




      Nicole 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 3 hours ago







      Nicole













      New contributor




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









      asked 4 hours ago









      NicoleNicole

      83




      83




      New contributor




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





      New contributor





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






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




















          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
          );



          );






          Nicole 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%2f268990%2fadd-custom-block-under-selected-shipping-methode-magento-2-not-working%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








          Nicole is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Nicole is a new contributor. Be nice, and check out our Code of Conduct.












          Nicole is a new contributor. Be nice, and check out our Code of Conduct.











          Nicole 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%2f268990%2fadd-custom-block-under-selected-shipping-methode-magento-2-not-working%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

          Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

          Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

          Aasi (pallopeli) Navigointivalikko