• I know this isn’t part of the default functionality and proved to very important to my client. I wanted to give you a snippet of code which seemed to work for my needs so that others might be able to use it.

    $( ".tawcvs-swatches" ).append( "<div class='variationTitle'></div>" );
    			
    	$('.swatch').on('click', function() {
    	var title = $(this).attr('title');
    	$(this).siblings('.variationTitle').text(title);
    	});
    • This topic was modified 7 years, 7 months ago by Jean LeSheep.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Nicole

    (@calirockangel)

    Where do you put this code? I need this functionality. Thank you for sharing!

    Thread Starter Jean LeSheep

    (@cyarema)

    I have it in my header file like this:

    	<script>
    
    		(function($){ //create closure so we can safely use $ as alias for jQuery
    
    			$(document).ready(function(){
    				
    		
    			$( ".tawcvs-swatches" ).append( "<div class='variationTitle'></div>" );
    			
    			$('.swatch').on('click', function() {
    			  var title = $(this).attr('title');
    			  $(this).siblings('.variationTitle').text(title);
    			});
    
    			
    			});
    
    		})(jQuery);
    	</script>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to Add Variation Titles Display’ is closed to new replies.