Change Shipping Method Name programmaticallyCan't override Sales Shipping model fileoverride USPS shipping...

How exactly does Hawking radiation decrease the mass of black holes?

Does Gita support doctrine of eternal cycle of birth and death for evil people?

Is it idiomatic to construct against `this`?

How can the Zone of Truth spell be defeated without the caster knowing?

Why was Germany not as successful as other Europeans in establishing overseas colonies?

What are the potential pitfalls when using metals as a currency?

US visa is under administrative processing, I need the passport back ASAP

A ​Note ​on ​N!

How to make a pipeline wait for end-of-file or stop after an error?

Is there a way to get a compiler for the original B programming language?

What does the "ep" capability mean?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

How does a program know if stdout is connected to a terminal or a pipe?

what is the sudo password for a --disabled-password user

Why do games have consumables?

Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?

Symbolic Multivariate Distribution

What is Niska's accent?

How much cash can I safely carry into the USA and avoid civil forfeiture?

Apply MapThread to all but one variable

Fizzy, soft, pop and still drinks

How come there are so many candidates for the 2020 Democratic party presidential nomination?

Why does nature favour the Laplacian?

How did Captain America manage to do this?



Change Shipping Method Name programmatically


Can't override Sales Shipping model fileoverride USPS shipping method nameShipping price in one page checkout - order review return zeroShipping Rate Calculating for given Country,State,Postcode and PriceMagento 2 checkout Shipping Prices missingCheckout Form - How to wrap multiple elements in a class - Magento 2Magento 2.2.0 - checkout_index_index.xml shippingAdditional not workingChange Magento Shipping Method from 'Custom' to Courier's NameChange price before rendering payment gatway in magento 2Shipping rate calculation in Table rate Shipping method Magento 2






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







1















i want to change the Shipping Method Name programmatically in some cases.
enter image description here



(This store is in german)



So I want to change "Versand oder Abholung" to another different text depending on the case.



How can I manipulate this text?



I have found the .html file which contains this div. (Maybe this will help?)
appdesignfrontendMyStoreMyStoreThemeMagento_Checkoutwebshipping.html



<form class="form methods-shipping" id="co-shipping-method-form" data-bind="submit: setShippingInformation" novalidate="novalidate">
<div id="checkout-shipping-method-load">
<table class="table-checkout-shipping-method">
<thead>
<tr class="row">
<th class="col col-method" data-bind="i18n: 'Select Method'"></th>
<th class="col col-price" data-bind="i18n: 'Price'"></th>
<th class="col col-method" data-bind="i18n: 'Method Title'"></th>
<th class="col col-carrier" data-bind="i18n: 'Carrier Title'"></th>
</tr>
</thead>
<tbody>


...
...
...



<td class="col col-method" data-bind="text: method.method_title, attr: {'id': 'label_method_' + method.method_code + '_' + method.carrier_code}"></td>


Any ideas? ;)










share|improve this question














bumped to the homepage by Community 18 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    1















    i want to change the Shipping Method Name programmatically in some cases.
    enter image description here



    (This store is in german)



    So I want to change "Versand oder Abholung" to another different text depending on the case.



    How can I manipulate this text?



    I have found the .html file which contains this div. (Maybe this will help?)
    appdesignfrontendMyStoreMyStoreThemeMagento_Checkoutwebshipping.html



    <form class="form methods-shipping" id="co-shipping-method-form" data-bind="submit: setShippingInformation" novalidate="novalidate">
    <div id="checkout-shipping-method-load">
    <table class="table-checkout-shipping-method">
    <thead>
    <tr class="row">
    <th class="col col-method" data-bind="i18n: 'Select Method'"></th>
    <th class="col col-price" data-bind="i18n: 'Price'"></th>
    <th class="col col-method" data-bind="i18n: 'Method Title'"></th>
    <th class="col col-carrier" data-bind="i18n: 'Carrier Title'"></th>
    </tr>
    </thead>
    <tbody>


    ...
    ...
    ...



    <td class="col col-method" data-bind="text: method.method_title, attr: {'id': 'label_method_' + method.method_code + '_' + method.carrier_code}"></td>


    Any ideas? ;)










    share|improve this question














    bumped to the homepage by Community 18 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1








      i want to change the Shipping Method Name programmatically in some cases.
      enter image description here



      (This store is in german)



      So I want to change "Versand oder Abholung" to another different text depending on the case.



      How can I manipulate this text?



      I have found the .html file which contains this div. (Maybe this will help?)
      appdesignfrontendMyStoreMyStoreThemeMagento_Checkoutwebshipping.html



      <form class="form methods-shipping" id="co-shipping-method-form" data-bind="submit: setShippingInformation" novalidate="novalidate">
      <div id="checkout-shipping-method-load">
      <table class="table-checkout-shipping-method">
      <thead>
      <tr class="row">
      <th class="col col-method" data-bind="i18n: 'Select Method'"></th>
      <th class="col col-price" data-bind="i18n: 'Price'"></th>
      <th class="col col-method" data-bind="i18n: 'Method Title'"></th>
      <th class="col col-carrier" data-bind="i18n: 'Carrier Title'"></th>
      </tr>
      </thead>
      <tbody>


      ...
      ...
      ...



      <td class="col col-method" data-bind="text: method.method_title, attr: {'id': 'label_method_' + method.method_code + '_' + method.carrier_code}"></td>


      Any ideas? ;)










      share|improve this question














      i want to change the Shipping Method Name programmatically in some cases.
      enter image description here



      (This store is in german)



      So I want to change "Versand oder Abholung" to another different text depending on the case.



      How can I manipulate this text?



      I have found the .html file which contains this div. (Maybe this will help?)
      appdesignfrontendMyStoreMyStoreThemeMagento_Checkoutwebshipping.html



      <form class="form methods-shipping" id="co-shipping-method-form" data-bind="submit: setShippingInformation" novalidate="novalidate">
      <div id="checkout-shipping-method-load">
      <table class="table-checkout-shipping-method">
      <thead>
      <tr class="row">
      <th class="col col-method" data-bind="i18n: 'Select Method'"></th>
      <th class="col col-price" data-bind="i18n: 'Price'"></th>
      <th class="col col-method" data-bind="i18n: 'Method Title'"></th>
      <th class="col col-carrier" data-bind="i18n: 'Carrier Title'"></th>
      </tr>
      </thead>
      <tbody>


      ...
      ...
      ...



      <td class="col col-method" data-bind="text: method.method_title, attr: {'id': 'label_method_' + method.method_code + '_' + method.carrier_code}"></td>


      Any ideas? ;)







      magento2 shipping shipping-methods programmatically






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 6 '17 at 7:49









      LehtisLehtis

      14




      14





      bumped to the homepage by Community 18 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 18 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Ok I have found a solution.



          use MagentoQuoteModelQuoteAddressRateRequest;

          class Tablerate extends MagentoOfflineShippingModelCarrierTablerate
          {
          public function collectRates(RateRequest $request)
          {
          $result = $this->_rateResultFactory->create()
          $method = $this->_resultMethodFactory->create();
          $method->setMethod('bestway');
          $method->setMethodTitle("test1234");
          $result->append($method);
          return $result;
          }
          }





          share|improve this answer
























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


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f192137%2fchange-shipping-method-name-programmatically%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Ok I have found a solution.



            use MagentoQuoteModelQuoteAddressRateRequest;

            class Tablerate extends MagentoOfflineShippingModelCarrierTablerate
            {
            public function collectRates(RateRequest $request)
            {
            $result = $this->_rateResultFactory->create()
            $method = $this->_resultMethodFactory->create();
            $method->setMethod('bestway');
            $method->setMethodTitle("test1234");
            $result->append($method);
            return $result;
            }
            }





            share|improve this answer




























              0














              Ok I have found a solution.



              use MagentoQuoteModelQuoteAddressRateRequest;

              class Tablerate extends MagentoOfflineShippingModelCarrierTablerate
              {
              public function collectRates(RateRequest $request)
              {
              $result = $this->_rateResultFactory->create()
              $method = $this->_resultMethodFactory->create();
              $method->setMethod('bestway');
              $method->setMethodTitle("test1234");
              $result->append($method);
              return $result;
              }
              }





              share|improve this answer


























                0












                0








                0







                Ok I have found a solution.



                use MagentoQuoteModelQuoteAddressRateRequest;

                class Tablerate extends MagentoOfflineShippingModelCarrierTablerate
                {
                public function collectRates(RateRequest $request)
                {
                $result = $this->_rateResultFactory->create()
                $method = $this->_resultMethodFactory->create();
                $method->setMethod('bestway');
                $method->setMethodTitle("test1234");
                $result->append($method);
                return $result;
                }
                }





                share|improve this answer













                Ok I have found a solution.



                use MagentoQuoteModelQuoteAddressRateRequest;

                class Tablerate extends MagentoOfflineShippingModelCarrierTablerate
                {
                public function collectRates(RateRequest $request)
                {
                $result = $this->_rateResultFactory->create()
                $method = $this->_resultMethodFactory->create();
                $method->setMethod('bestway');
                $method->setMethodTitle("test1234");
                $result->append($method);
                return $result;
                }
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 6 '17 at 9:59









                LehtisLehtis

                14




                14






























                    draft saved

                    draft discarded




















































                    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%2f192137%2fchange-shipping-method-name-programmatically%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

                    迭戈·戈丁...

                    A phrase ”follow into" in a context The 2019 Stack Overflow Developer Survey Results Are...

                    1960s short story making fun of James Bond-style spy fiction The 2019 Stack Overflow Developer...