WordPress.org

Forums

WP eCommerce
Change WP-Ecommerce variant dropdown selector to radio button? (2 posts)

  1. scrista
    Member
    Posted 1 year ago #

    I really like some of the features in WP-Ecommerce but I'm wondering if I can use buttons for variant selection instead of the dropdown selector? It seems like it would be possible but I haven't found any answers on the internet. Something like the Woocoomerce Variation Swatches and Photos plugin for WP-Ecommerce would be awesome.

    https://wordpress.org/plugins/wp-e-commerce/

  2. Rajan V
    Member
    Posted 9 months ago #

    Just Add this code on your theme JS file

    $(function(){
    	$('.wpsc_variation_forms').append('<div class="new-variation-div"></div>');
    	var i = 0;
    	$( ".wpsc_variation_forms" ).each(function() {
    		var output = '';
    		var variation = '';
    		$(this).find('.wpsc_select_variation').each(function(){
    			var name = $(this).attr('name');
    				$(this).find('option').each(function(){
    					var val = $(this).text();
    					var value = $(this).attr('value');
    					if( value != '0' ){
    						variation = variation + '<label class="new-variation-radio radio-variation" for="'+name+i+'"><input class="wpsc_select_variation" type="radio" id="'+name+i+'" name="'+name+'" value="'+value+'" rel=' + val +' />'+val+'</label>';
    					}
    					i++;
    				});
    				variation = '<div class="variation-variation">'+variation+'</div>';
    			output = color + variation;
    		});
    		$(this).find('.new-variation-div').html( output );
    		$(this).find('table').hide();
    	});
    });

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic