How To

How to remove custom options price from the dropdown 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!

Click to rate this post!
[Total: 18 Average: 4.6]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate ?️ Certified Magento Developer?‍?. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.?

View Comments

  • 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.

  • 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?

    • 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);
      }
      });
      });
      });
      });

  • 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?

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

  • 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?

  • 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

    • 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.

  • 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

Recent Posts

How to Add Tooltip in Checkout Shipping Field in Magento 2?

Hello Magento Friends, In today’s blog, I will explain How to Add Tooltip in Checkout…

3 days ago

How to Integrate and Use MongoDB with Laravel?

MongoDB is a popular NoSQL database that offers flexibility and scalability when handling modern web…

4 days ago

NodeJS | Callback Function

In NodeJS, callbacks empower developers to execute asynchronous operations like reading files, handling requests, and…

5 days ago

How to Show SKU in Order Summary in Magento 2?

Hello Magento Friends, In today’s blog, we will learn How to Show SKU in Order…

7 days ago

Best Colors to Use for CTA Buttons

The "Buy Now" and "Add to Cart" buttons serve as the primary call-to-action (CTA) elements…

1 week ago

Magento 2: How to Save Custom Field Value to quote_address for Multi-Shipping Orders

Hello Magento Friends, In Magento 2, the checkout process allows customers to choose multiple shipping…

1 week ago