Home Forums Basel support forum Show dropdown at single product.

Show dropdown at single product.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2049

    anqi89
    Participant

    I create color swatch to see the color in shop page. But i want use dropdown list inside single product instead of the round color option. Any solution?

    #2058

    Artem Temos
    Keymaster

    Hello,

    Thank you for the question.

    Unfortunately there is no such option in our theme. But as a solution you try to add the following code to your child theme to make it work as you want (show color circles only on shop page)

    function basel_has_swatches( $id, $attr_name, $options, $available_variations, $swatches_use_variation_images = false ) {
    	$swatches = array();
    
    	if( is_singular('product') ) return array();
    
    	foreach ($options as $key => $value) {
    		$swatch = basel_has_swatch($id, $attr_name, $value);
    
    		if( ! empty( $swatch ) ) {
    
    			if( $swatches_use_variation_images && basel_get_opt( 'grid_swatches_attribute' ) == $attr_name ) {
    
    				$variation = basel_get_option_variations( $attr_name, $available_variations, $value );
    
    				$swatch = array_merge( $swatch, $variation);
    			}
    
    			$swatches[$key] = $swatch;
    		}
    	}
    
    	return $swatches;
    }

    Kind regards,
    Xtemos

Viewing 2 posts - 1 through 2 (of 2 total)