Home Forums Basel support forum Attributes order

Attributes order

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2134

    graphe
    Participant

    Hello,

    I ordered the color attributs in products->attributs.

    In page product it looks ok, but in shop page the attributs are disordered. Each product has its own order. The same happens in related products.

    I don’t know how to fix it.

    Thanks for your help

    correct order of attributes

    wrong order attributes

    #2136

    Artem Temos
    Keymaster

    Hello,

    Thank you for this report.

    It seems to be small bug in our theme with swatches order. As a quick workaround try to add the code in the file basel/inc/woocommerce.php

    After this line #309 $swatch_size = basel_wc_get_attribute_term( $attribute_name, 'swatch_size' );

    Paste this code

    
    if( apply_filters( 'basel_swatches_on_grid_right_order', true ) ) {
    	$terms = wc_get_product_terms( $product->id, $attribute_name, array( 'fields' => 'slugs' ) );
    
    	$swatches_to_show_tmp = $swatches_to_show;
    
    	$swatches_to_show = array();
    
    	foreach ($terms as $id => $slug) {
    		$swatches_to_show[$slug] = $swatches_to_show_tmp[$slug];
    	}
    }
    
    #2138

    graphe
    Participant

    Hello,

    It works!

    thank you for your fast response!

    #2141

    Artem Temos
    Keymaster

    Great, you are welcome 🙂

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