Hi Guys,
I have a field for greeting card yes/no and would like to show greeting card message if the client opts to have a greetings card with their gift.
Is there an extension or a way I can hide the message box unless the gift card select is yes/true.
Thanks
I have a field for greeting card yes/no and would like to show greeting card message if the client opts to have a greetings card with their gift.
Is there an extension or a way I can hide the message box unless the gift card select is yes/true.
Thanks
You have not really provided any detailed information to what version you are using or where in your Open Cart this shows up. However, just use jQuery to "show" the message box when the check box is checked. Hide the message box with CSS with style="display:none;"
Example of a hidden textarea field + jquery to reveal it:
Example of a hidden textarea field + jquery to reveal it:
Code: Select all
<input type="checkbox" name="name" value="value" id="myCheckBox" />
<textarea name="name" cols="40" rows="5" id="myTextArea" style="display:none;">Initial Value, if any</textarea>
<script>$('#myCheckBox').bind('change',function(){
$('#myTextArea').show();
});
</script>
Thank you very much, the options are part of the product options section on the products page (product.tpl)
I am using 1.5.2.1
How would I use your code with the option checkbox when these are dynamically created from the Options in the database please?
I am using 1.5.2.1
How would I use your code with the option checkbox when these are dynamically created from the Options in the database please?
Hi
I am looking for something like this. I have 5 options on a product, and depending on what is selected in one of the options, I want to hide or show another of the options.
I can understand the response given, in the jquery would do this, but since the options are dynamic and created on the fly I do not see how this can be implemented on the tpl file in question.
Did you ever find a way to do this at all?
I am looking for something like this. I have 5 options on a product, and depending on what is selected in one of the options, I want to hide or show another of the options.
I can understand the response given, in the jquery would do this, but since the options are dynamic and created on the fly I do not see how this can be implemented on the tpl file in question.
Did you ever find a way to do this at all?
Now you are taking about an array of options where each option set has an id. For example your select box option(s) will all have id's tied to them. As long as you have this you can do whatever you want with jQuery.
Example: (You could go inside of a radio button group option and compare the current selected radio button with the current echo'd value, all in jQuery)
Example: (You could go inside of a radio button group option and compare the current selected radio button with the current echo'd value, all in jQuery)
Code: Select all
<script>
//set up the onclick event according to radio button ID.
$('#option-value-'+'<?php echo $option_value['product_option_value_id']; ?>').bind('click', function() {
//get current option_value_id
var value = '<?php echo $option_value['product_option_value_id'];?>';
//set up a conditional to show/hide other elements on the page
if(value == 120){
$("#element1").show();
$("#element2").hide();
}else if(value == 121){
$("#element3").show();
$("#element4").hide();
}else{
$("#element1").hide();
$("#element1").hide();
$("#element3").hide();
$("#element4").hide();
}
});
</script>
much to my own surprise, I actually understand what you have put, lol, but as it turns out it is no longer a requirement, too much work for just a single option, customer not bothered about it, however, perhaps you can help me with another issue, which would be a vast improvement for my customer at the very least.
http://forum.opencart.com/viewtopic.php?f=20&t=86904
http://forum.opencart.com/viewtopic.php?f=20&t=86904
ok, this is now back in the requested list again, sheesh, customers.
ok, my basic and limited understanding on opencart is that options are dynamic, so there is no actual hard code that can be edited that corelates with each of the individual options, so how would I embed this code to an option that is not in the actual code itself
ok, my basic and limited understanding on opencart is that options are dynamic, so there is no actual hard code that can be edited that corelates with each of the individual options, so how would I embed this code to an option that is not in the actual code itself
I have Dependent Options which works with dropdown select-type options. There's also Product Configurator but I don't have any experience with it personally. Edit: Support is no longer offered for Product Configurator so it's probably not a good choice.
-Ryan
avvici
please can you explain me what values should be changed to this code?
please can you explain me what values should be changed to this code?
Code: Select all
<input type="checkbox" name="name" value="value" id="myCheckBox" />
<textarea name="name" cols="40" rows="5" id="myTextArea" style="display:none;">Initial Value, if any</textarea>
<script>$('#myCheckBox').bind('change',function(){
$('#myTextArea').show();
});
</script>
Who is online
Users browsing this forum: No registered users and 141 guests