6

The top-rated answer doesn't work because he forgot to set the "description" value inside of the \Magento\Quote\Model\Quote\Address\Rate class. If we do not create a Plugin to set the Description value on this class, then $rateModel->getMethodDescription() will always return empty. Here is a full-working version of the solution: [Vendor]/[Module]/etc/...


2

etc/di.xml <type name="Magento\Quote\Model\ShippingMethodManagement"> <plugin name="vendor_module_plugin_model_quote_shipping_method_management" type="Vendor\Module\Plugin\Model\ShippingMethodManagement" disabled="false"/> </type> Plugin/Model/ShippingMethodManagement.php public function afterEstimateByAddress($...


2

Now this is available out of the box starting from 2.4.0. Please check https://docs.magento.com/user-guide/shipping/shipping-in-store-delivery.html


2

Anyone who wants to use a plugin to implement this should use something like this public function beforeGetRate( \Acme\Shipping\Model\ResourceModel\Carrier\Matrixrate $subject, $request ) { // Shipping package value should be calculated // with discount applied // $getPackageValueWithDiscount = $request->...


2

I faced the same issue. 1.rest/default/V1/carts/mine/estimate-shipping-methods 500 Internal Server Error 2.rest/default/V1/carts/guest/estimate-shipping-methods 500 Internal Server Error At checkout page shipping methods were not displaying. This is issue with Magento_Amqp ,Magento_MysqlMq and Temando_Shipping modules. I solved this issue by updating ...


2

For your requirement, you can use the sorting procedure. You can get this through the Magento admin panel. In Magento admin Store -> Configuration -> Sales(left menu) -> Shipping Methods -> Choose your desired shipping method and give the sort order. You can find the Sort Order textbox for every shipping method. By giving the low valued numbers, you can ...


2

I found my solution (yours may be different). For us the problem was that the name used on the site did not match the name (or nickname) used in UPS. Name on site is found at: Stores > Configuration > General > General > Store Information > Store Name. I'm guessing that the address may need to match as well. How I found that info... was to edit the ...


2

Create plugin <type name="Magento\OfflineShipping\Model\Carrier\Flatrate"> <plugin name="flaterate_custom_shipping" type="Vendor\Module\Plugin\Flatrate" /> </type> Plugin file <?php namespace Vendor\Module\Plugin; class Flatrate { protected $customerSession; protected $...


2

You can use a ready made module, It is free and from BSS commerce. https://bsscommerce.com/magento-2-preselect-shipping-payment-extension.html Note: You can select shipping of your choice Or first one I used above module in some of my project.


1

After did some research on this task I have found a solution for this. Here I am posting the solution based on the requirement it may help others if the will get the same kind of task as per the requirement. app/code/Vendor/ShippingRestriction/etc/catalog_attributes.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/...


1

Just to help future searchers, I identified a specific REST API that was returning a 500 error, by checking the JS console in the browser. /rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id The 500 error was caused by disabling the AMPQ module, and I had to patch the composer package named magento/framework-message-queue Git issue , ...


1

I faced a similar issue after updating a site from 2.3.3 to 2.3.4. Where the checkout would get stuck loading shipping methods. In my case the ajax request for fetching shipping methods would eventually return a 500 error after running out of memory. It turned out to be a 3rd party module that introduced a cyclical dependency loop. By adding a new user ...


1

After set the shipping address in quote use below code to set shipping method programatically $shippingAddress = $quote->getShippingAddress(); $shippingAddress->setCollectShippingRates(true) ->collectShippingRates() ->setShippingMethod('shippingMethod') //shipping method ->setShippingDescription('shipping method ...


1

Please follow the below steps to get the shipping method and its details in phtml file. app/code/Test/RoomDelivery/view/adminhtml/layout/sales_order_view.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/...


1

Try the following way: if($request->getPackageWeight() > $this->getConfigData('max_weight')) { return false; }


1

In your custom shipping method module. there is a model defined in app/code/vendorname/packagename/etc/config.xml In your custom shipping model file add below code. <?php namespace Stackoverflow\Customshipping\Model\Carrier; use Magento\Quote\Model\Quote\Address\RateRequest; use Magento\Shipping\Model\Rate\Result; class Custom extends \Magento\Shipping\...


1

Try it like this:- first create a custom module using below link https://www.mageplaza.com/magento-2-module-development/ now follow up form here vendor/module/etc/di.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/...


1

This is the solution for anyone facing the same issue. Since the newer versions of CentOS all come with SELinux enabled, we need to adjust the httpd can network connect boolean so that curl can be used. /usr/sbin/setsebool httpd_can_network_connect 1


1

I would suggest going with sales_quote_product_add_after instead of checkout_cart_product_add_after


1

Update your plugin file using this below code. afterCollectRates function missing one arguement. <?php namespace MyLearning\CustomFlatrate\Plugin; class Flatrate { protected $_customerSession; protected $_rateMethodFactory; public function __construct( \Magento\Customer\Model\Session $customerSession, \Magento\Quote\Model\...


1

The origCountryId is never populated. The rate request object is populated in \Magento\Quote\Model\Quote\Address::requestShippingRates. There is no trace of orig in there. Actually I looked for getOrigCountryId everywhere. It only appears in the method hinting in the class RateRequest. Also looked for orig_coutry_id. It only appears in test classes. If you ...


1

In the table sales_order_item, you should save the column product_options as JSON and in that, there must have one key = info_buyRequest


1

Case 3: Please create one new order table for split orders and it will have a foreign key reference with the main order table. For e.g. let say vendor_order or category_order. So split order entries will be stored into that for your reference of split order related things like shipping method, payment method, totals, etc. In admin panel, you can show the ...


1

You need to override core file in your theme vendor/magento/module-checkout/view/frontend/web/js/model/checkout-data-resolver.js Override file in your theme : sendorname/theme/Magento_Chekout/web/js/checkout-data-resolver.js and check line number 151 code if (ratesData.length === 1) { //set shipping rate if we have only one available shipping ...


1

I was having the same issue and found that you need to use this model $shippingQuoteRate = $objectManager->get('\Magento\Quote\Model\Quote\Address\Rate'); then you need to set the quote_shipping_rate parameters. The values can be found in the the database table quote_shipping_rate Here is my complete working: $orderData =[ 'currency_id' => 'USD', '...


1

I was looking for the same thing, but only found paid modules that required a monthly service fee. Ended up having this module made from an old magento v1 exention that is no longer supported. Try this module. It works with Magento v2 and adds the option to get UPS LTL Freight Shipping. https://github.com/jerdill/jmodz


1

run this in your sql as a temporary solution UPDATE sales_order_grid as t1 LEFT JOIN sales_order as t2 ON t1.entity_id = t2.entity_id SET t1.status = t2.status WHERE t1.status != t2.status This will update orders status in orders grid view


1

Just a note to previous answers. Both are using payment_method_is_active event, let's see the code (2.3 here) $this->_eventManager->dispatch( 'payment_method_is_active', [ 'result' => $checkResult, 'method_instance' => $this, 'quote' => $quote ] ); So, quote is accessible through the event itself, and so ...


Only top voted, non community-wiki answers of a minimum length are eligible