0

is it possible to set default shipping price as text in my custom shipping method look like

$method->setCarrierTitle($this->getConfigData('title'));
            $method->setMethod($this->_code);
            $method->setMethodTitle($this->getConfigData('name'));
            $shippingPrice = 'my text';
            $method->setPrice($shippingPrice);
            $result->append($method);
4
  • As per magento stander you can not set text in price. can you share what do you want to achieve to set text in price? – Chirag Patel Apr 15 '20 at 9:54
  • i have custom shipping method when go to checkout default shipping price is 0 when customer entered address than by address it's calculate rate so first time instead of 0 set to By Distance i also try this magento.stackexchange.com/questions/277422/… but it replace all shipping price where found 0 but i want just my custom shipping method – Chandresh Chauhan Apr 15 '20 at 10:03
  • so you can add condition if selected shipping method is this then display text – Chirag Patel Apr 15 '20 at 10:17
  • You can get shipping method using window.checkoutConfig.selectedShippingMethod – Chirag Patel Apr 15 '20 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.