Kingshuk Deb
Kingshuk Deb

Reputation: 1720

Want to update custom options text in magento 1.7.2

enter image description here

check the custom options. I need to change this. Onclick on each options the div showing price ([Add $200] or [Substract $50]) should get display none. means when you click on green the corresponding price block must not visible but red and yellow price block should be visible.

similar when you click on yellow [substract $50] must not visible but other price blocks should be visible

Upvotes: 0

Views: 597

Answers (1)

Rajiv Ranjan
Rajiv Ranjan

Reputation: 1869

Add below jQuery code to view.phtml. I have tested it with default magento layout.

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery('ul.options-list li .product-custom-option').click(function(){
            var inputId = jQuery(this).attr('id');
            jQuery('ul.options-list li span.price-notice').css('display','block');              
            jQuery('ul.options-list li').removeClass('active');
            jQuery("#"+inputId).parent().addClass('active');
            jQuery('ul.options-list li.active span span.price-notice').css('display','none');   

        });
    });
</script>

Hope will work for you!

Upvotes: 1

Related Questions