Product options on the Product details page

Hi. I have gone through all the product options templates, and even tried editing the “show_product_options” variable but haven’t solved the issue yet.

The issue is, I want to display only Unit of Measurement as the only product option on the product details page.

I only want the Unit of Measurement option. If I set the “show_product _options” as false, it removes all of them. Is there a way how to fix this?

Thank you.

I am afraid, the only way to hide it without code changes is to set the status for corresponding options to Disabled

With code changes, how is it possible? I have looked through it and can’t seem to get anywhere.

I think, you will not find ready-to-use instruction. Hire someone to make this modification

Well, I am a developer working on this. I have taken a look at the template files and have only found skeletal code for the options mentioned. Any push in the right direction would be much appreciated.

As a solution, you can change the $product.product_options array

1 Like

I looked for the references for the $product.product_options array and I couldn’t find a definitive method because the $product_options array is empty in the view.tpl template.

Upon inspecting the above data, they appear in the $product.product_features array which is odd. Why does putting false value on $product_options not show product_features?

Also, where exactly would I need to make the change for $product.product_options array? Because I’ve only so far found references. The same goes for $product_features as well, because there is no function in the view file that displays the one value.

I don’t want to disrupt the functionality inside, I just want to remove them from the front end and keep Unit of Measurement.

if you use product variations, product feature are displayed in the same way as product options (depending on the selected feature type)

Is there no way to just edit the template?

The $product.product_features array is processing the necessary features, so I think it should be left as it is. The template does hold the $product.product_options but there seems no way to edit the variable as desired.

You can alter it in the following way

{$product.product_options = $product.product_options|fn_my_function}

Then create the fn_my_function function in the func.php file of the My changes module and do necessary actions there