Magento 2 how to hide fedex / ups shipping rates for some products

By | April 22, 2024
Spread the love

To hide FedEx or UPS shipping rates for specific products in Magento 2, you typically need to customize the shipping module or use a third-party extension that provides such functionality. Here’s a general guide on how you can achieve this:

  1. Identify the Products: Determine which products you want to hide FedEx or UPS shipping rates for. You might do this based on product attributes, categories, or any other criteria relevant to your store.

    See below plugin for your needs:

    https://commercemarketplace.adobe.com/ecomplugins-upscarrier.html

    https://commercemarketplace.adobe.com/ecomplugins-fedexaddon.html

  2. Customize Shipping Module (Advanced):
    • Create a custom module or extend the existing shipping module in Magento 2.
    • Override the method responsible for retrieving shipping rates from FedEx or UPS APIs.
    • Add logic to check if the current cart contains any of the products you want to hide shipping rates for.
    • If those products are found, exclude FedEx or UPS shipping rates from the available options.
  3. Use a Third-Party Extension:
    • Look for extensions in the Magento Marketplace or other trusted sources that offer advanced shipping rules.
    • Install and configure the extension according to your requirements.
    • These extensions often provide a user-friendly interface to set up rules for hiding shipping rates based on various conditions, including product attributes.
  4. Consider Product Groups or Categories:
    • Instead of individual products, you might want to hide shipping rates for entire product categories or groups.
    • Utilize Magento’s built-in product attributes or create custom attributes to categorize products.
    • Modify the shipping logic to check for these attributes and hide the shipping rates accordingly.
  5. Test Thoroughly:
    • Once you’ve implemented the changes or installed the extension, thoroughly test the shipping functionality.
    • Test scenarios where products with hidden shipping rates are in the cart along with other products.
    • Verify that the correct shipping rates are displayed based on the configured rules.
  6. Maintenance and Updates:
    • Regularly review and update your custom code or extensions to ensure compatibility with Magento updates and changes.
    • Monitor your shipping rules to make sure they continue to meet your business requirements.

Remember to take a backup of your site before making any significant changes, especially if you’re modifying core functionality or installing new extensions. This ensures you can revert back in case something goes wrong during the implementation process.