A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
33

Here is what I've done. I removed the shipping step and used a default shipping method that I know is always going to be available. Not sure if this is what you need but you can at least use it as a starting point. Here is my idea. I created a new module with an enable/disable shipping step config setting, so you can always re-enable the shipping step from ...


17

Magento checkout does not support any kind of form for shipping method additional data. But it provides shippingAdditional block in the checkout which can be used for this. The following solution will work for standard magento checkout. First let's prepare our container where we can put some form. To do this create a file in view/frontend/layout/...


13

I am not sure if you can achieve that. Table with carrier rates is rendered based on rest request to rest/en/V1/guest-carts/estimate-shipping-methods. You need to add extension attributes to ShippingMethodInterface and add your extension attributes for the output of ShipmentEstimationInterface::estimateByExtendedAddress and ShippingMethodManagementInterface::...


11

You simply need to update the UPS Gateway URL to use "https" To change this setting, login to the backend of your Magento website and then go to : System > Configuration Click “Shipping Methods” Click the tab for “UPS” Find the “Gateway URL” setting and change the url from “http://www.ups.com/using/services/rave/qcostcgi.cgi” to “https://www.ups.com/using/...


9

I use an Plugin in a custom module to set the isAvailable function for CashOnDelivery to false when shipping method "flatrate_flatrate" is selected. file: <magento-root>/app/code/MyCompany/MyModule/Plugin/CashonDeliveryPlug.php <?php namespace MyCompany\MyModule\Plugin; use Magento\Payment\Model\Method\AbstractMethod; use Magento\Quote\...


9

$_product = $block->getProduct(); $myattribute = $_product->getResource()->getAttribute('Your_Attribute_Code')->getFrontend()->getValue($_product); echo $myattribute; if want to show value of custom attribute in product page can use this code.


9

Or you can use Magento\Shipping\Model\Config\Source\Allmethods that does just that!


9

You can get the shipping method by $order->getShippingMethod(); or $order->getShippingAddress()->getShippingMethod();


9

In order to make custom product attribute available in quote item, simply add the attribute in the file: Vendor/Module/etc/catalog_attributes.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="...


8

Unfortunately there's not much in the UI for debugging these types of issues. You could try enabling the Debug setting. That will log the API requests and responses to your var/logs/ directory, which might provide some clues. If that doesn't provide any clarity, you'll probably need to poke around the core functionality. Mage_Shipping_Model_Shipping::...


8

I have got the solution, this is because we need to define processAdditionalValidation method inside the carrier class and for checking the result you can return true in this function. public function processAdditionalValidation(\Magento\Framework\DataObject $request) { return true; } Please note processAdditionalValidation is different than ...


7

I got an answer to this same question on StackOverflow by user Elvarasan. His answer provided me with everything I needed to get this working. To hide some payment methods based on shipping method you don't need to observe things at all: Every methods(in one page check out) post the methods which are chosen to the next level. So you can get the ...


7

Make your product as Virtual Product and it will automatically removed.


7

I have a better solution than the one of @marius which doesn't need any rewrites. You still need to create an own module, there are tons of tutorials for that so I won't explain it here. You have to create an observer and trigger it via the config.xml. You may have to adapt the template app/design/frontend/base/default/template/checkout/onepage.phtml In ...


7

This worked out for me https://github.com/mageplaza/magento-2-shipping-method/issues/1 => Changing "enable" for "active" in: /app/code/Mageplaza/Simpleshipping/Model/Carrier/Shipping.php 53 /app/code/Mageplaza/Simpleshipping/etc/config.xml 6 /app/code/Mageplaza/Simpleshipping/etc/adminhtml/system.xml 10


6

Override the CartController and add this code in the indexAction class Ajaxy_Core_Checkout_CartController extends Mage_Checkout_CartController { public function indexAction() { parent::indexAction(); $shippingAddress = $this->_getQuote()->getShippingAddress(); if (!$shippingAddress->getShippingMethod())...


6

Here is a quick(ish) and dirty way of doing it. You have to modify the shipping methods template in the checkout process. (checkout/onepage/shipping_method/available.phtml and checkout/multishipping/shipping.phtml). The idea is that before printing the available shipping methods you can loop through them and see if there is one with the price 0. So add ...


6

Take a look at Mage_Shipping_Model_Rate_Request. If you have several methods, in the collectRates() method of the class that extends Mage_Shipping_Model_Carrier_Abstract you can create an array with method details. Then you can loop through the array: public function collectRates(Mage_Shipping_Model_Rate_Request $request) { if (!Mage::getStoreConfig('...


6

For the googlers landing on this page, here is the solution : To always display the carrier, Magento is looking for the showmethod attribute in your carrier configuration. You should add this code in your config.xml : <?xml version="1.0" encoding="UTF-8"?> <config> <default> <carriers> <my_carrier> ...


6

Try this code $cart = Mage::getSingleton('checkout/cart'); $address = $cart->getQuote()->getShippingAddress(); $shipping = Mage::getModel('shipping/shipping'); $result=$shipping->collectRatesByAddress($address)->getResult(); $newrates = array(); $newrateCodes = array(); $shippingRates=$result->getAllRates(); ...


6

In line 43 <input name="estimate_method" type="radio" value="<?php echo $this->escapeHtml($_rate->getCode()) ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" /> the checkbox is being checked (echo checked = "...


6

Write a plugin to disable flat rate shipping method when free shipping is actually enabled based on cart sub total. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\OfflineShipping\Model\Carrier\...


6

In addition to answer of keyur shah You can get all active shipping using below code: protected $scopeConfig; protected $shipconfig; public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Shipping\Model\Config $shipconfig ) { $this->shipconfig=$shipconfig; $this->scopeConfig = $scopeConfig; } ...


6

Follow below steps: Vendor: Vendor ModuleName: CheckoutStep 1) Override checkout_index_index.xml in your module and define your own component in shipping step app/code/Vendor/CheckoutStep/view/frontend/layout/checkout_index_index.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="...


5

There is a function on the payment abstract that checks if a method can be used based on the quote. Mage_Payment_Model_Method_Abstract::isApplicableToQuote if this only is applicable to the pay on delivery method then simply rewrite the payment method Mage_Payment_Model_Method_Cashondelivery and add your own isApplicableToQuote. Here you can check on the ...


5

You problem is that your code is always executed from admin area. So it it always getting store ID of admin store. Which is 0. To change this you have to fetch the store ID from the order and use as a second parameter of Mage::getStoreConfig(). So in your method it should look like this: public function salesOrderShipmentSaveBefore($observer) { ... ...


5

Following blog could help you: http://www.blog.magepsycho.com/how-to-filter-shipping-method-in-onepage-checkout/


5

Just incase the site given in another answer goes down for some reason. You may want to filter shipping method in onepage checkout for one of the following cases: Filter shipping method based on Customer Group Filter Shipping method based on Country, State, Zipcode etc Filter Shipping method based on products etc. Unlike event: ‘payment_method_is_active’ ...


5

Use the extension ShippingTweaks.


5

Here's how to allow the COD payment method for only specified countries: Go to system -> configuration -> Payment Methods Expand the section "Cash on Delivery Payment Change "Payment from Applicable Countries" to "Specific countries." In the Payment from Specific Countries list, select only the countries where you want Cash on Delivery to appear. (Tip: hold ...


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