Hey guys,
I have set up a the monogramming feature set up here https://tinyurl.com/y6waod2s8 (written by another developer)
When a customer selects “Initials” or “DOB” I need to show the next Option below it.
I have been advised that this is a php question from the Javascript forums.
Code in the twig template file
{% if options %}
<div class="options {{ journal2.settings.get('product_page_options_push_classes') }}">
<h3>{{ text_option }}</h3>
{% for option in options %}
{% if option.type == 'select' %}
<div class="option form-group{% if option.required %} required {% endif %} option-{{ option.type }}">
<label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
<select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id }}" class="form-control">
<option value="">{{ text_select }}</option>
{% for option_value in option.product_option_value %}
<option value="{{ option_value.product_option_value_id }}">{{ option_value.name }}
{% if option_value.price %}
({{ option_value.price_prefix }}{{ option_value.price }})
{% endif %} </option>
{% endfor %}
</select>
</div>
{% endif %}
I tried doing it in JQuery but this is as far as I got
$(".option-date").hide();
$(".option-text").hide();
$(function() {
$('.option-select').change(function(){
$('.option-date').hide();
$('.option-text' + $(this).val()).show();
});
});
Referred to PHP thread from original JS thread here JS Noob, what's the best way to achieve this?