How to remove custom options price from the dropdown in Magento 2

How to remove custom option price from dropdown from product page in magento 2

Understanding the customer needs and selling products according to that not only increase store sales but also helps to serve products accordingly. Magento 2 comes with preloaded options to create up to six different product types along with the custom options that allows the store owner to one product with multiple variations. By creating custom options from the backend, a store owner can sell various varieties of the product. But by default, Magento served these product options as a drop-down in the store front-end with name and price. But sometimes store owner is willing to hide those prices until a customer makes a selection from the product page, but there is no option in the store backend to do this.

To make it easier for you, here is the blog about “How to remove custom options price from the dropdown in Magento 2 product page”. For this purpose, you need to add this small piece of code to “select.pthml” file available inside your theme folder at below location.

app\design\frontend\Themes\yourtheme\Magento_Catalog\templates\product\…
…\view\options\type\select.phtml


Using this code will help you to hide custom options price in store frontend dropdown.
Lastly, Comment down below if you face an issue while using this code.
Happy Coding!

Previous Article

How to Programmatically Clear Shopping Cart in Magento 2

Next Article

How to Create a New Page Layout Option in Magento

Write a Comment
  1. Pratik Mehta

    Hello Dhiren Vasoya,

    You blogs are really helpfull for me tahnks a lot for that.

    I need your help. I want to make customisation select option to text box convert and when i write in textbox then give option as a suggetions. It it possible to make?

    Thank you in advance.
    Pratik Mehta

    1. Yes, that’s possible, but for that one you will need to make more customization where instead of dropdown it can show the textbox, and you can use jquery to auto populate the options.

  2. Pratik Mehta

    Hello Dhiren Vasoya,

    You blogs are really helpfull for me tahnks a lot for that.

    I need your help. I want to make customisation select option to text box convert and when i write in textbox then give option as a suggetions. It it possible to make?

    Thank you in advance.
    Pratik Mehta

  3. This is a great solution I’ve been look to remove the prices from the product options dropdown and this solution worked for me Thank you.

    Is there any way of keeping the Select Option instead of just having a blank selection box?

  4. Noman Siddiqui

    This is a great solution I’ve been look to remove the prices from the product options dropdown and this solution worked for me Thank you.

    Is there any way of keeping the Select Option instead of just having a blank selection box?

    1. Dharmesh Patel

      Change else if (selectedOption.indexOf(‘-‘) > -1) to else if (selectedOption.indexOf(‘-‘) > 0) .

  5. Dharmesh Patel

    This is a great solution I’ve been look to remove the prices from the product options dropdown and this solution worked for me Thank you.

    Is there any way of keeping the Select Option instead of just having a blank selection box?

    1. Dharmesh Patel

      Sorted now. Change else if (selectedOption.indexOf(‘-‘) > -1) to else if (selectedOption.indexOf(‘-‘) > 0) .

      require([
      ‘jquery’,
      ‘domReady!’
      ], function ($) {
      $(document).ready(function () {
      $(‘select.product-custom-option’).change(function(){
      $(‘option’).each(function(){
      var selectedOption = $(this).text();
      if (selectedOption.indexOf(‘+’) > -1) {
      selectedOption = selectedOption.substring(0, selectedOption.indexOf(‘+’));
      $(this).text(selectedOption);
      } else if (selectedOption.indexOf(‘-‘) > 0) {
      selectedOption = selectedOption.substring(0, selectedOption.indexOf(‘-‘));
      $(this).text(selectedOption);
      }
      });
      });
      });
      });

  6. Hi, is there any solution to remove the price from dropdown fields with bundle products in Magento 2?

    So, I just need to remove the “+Price” part of the field, and the total price should calculate normally.

    Thanks.

Leave a Comment

Your email address will not be published. Required fields are marked *

Get Connect With Us

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨