[SOLVED] show text description of selected option in different place on product page when click radio button of option
Posted: Tue Jun 24, 2025 4:59 am
I added a textarea box in the option tab of the admin product form page next to the select dropdown option value column in opencart 3.0.4.0.
On the front end, the options are radio buttons so for example if I select a specific radio product option, it shows the text description related to the option selected just above the add to cart button
I currently got the following code but that just shows all the options for the product and I would like to click on option value 17 radio button and it shows the text description related to number 17 option then if I click on option value 18 and it shows the text description related to number 18 option
On the front end, the options are radio buttons so for example if I select a specific radio product option, it shows the text description related to the option selected just above the add to cart button
I currently got the following code but that just shows all the options for the product and I would like to click on option value 17 radio button and it shows the text description related to number 17 option then if I click on option value 18 and it shows the text description related to number 18 option
Code: Select all
<!-- FOR OPTION TEXT FOR RADIO OPTIONS VALUES -->
{% if options %}
{% for option in options %}
{% if option.type == 'radio' %}
<div id="input-option{{ option.product_option_id }}">
{% for option_value in option.product_option_value %}
<span style="font-weight: bold;">{{ option_value.name }}</span>
<br>
{{ option_value.o_description }}
{% endfor %}
</div>
{% endif %}
{% endfor %}
{% endif %}