eC-Gem: Featured Categories – I can't sort categories by id

Home Support eCommerce Gem eC-Gem: Featured Categories – I can't sort categories by id

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  nuslu 3 days, 5 hours ago.

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

    nuslu
    Participant

    Greetings from Turkey 🙂

    “eC-Gem: Featured Categories widget” / I can’t sort categories by id

    #17008

    Hello Nuslu,

    Hope you are doing good!

    Unfortunately, the theme does not support the category sorting option. You will need to create the child theme and will need to write the additional code to customize the widget.

    Hope this helps!

    Have a great day ahead!

    Regards,
    Team ProDesigns

    #17015

    nuslu
    Participant

    Thanks you so much 🙂

    foreach ( $featured_cats as $term_id => $value ) {
    				        	$taxonomy 		= 'product_cat';
    				        	$term_details 	= get_term_by( 'id', $term_id, $taxonomy );
    				        	if( !empty( $term_details ) ){
    					        	$term_title 	= $term_details->name;
    				        		$term_link 		= get_term_link( $term_id, $taxonomy );
    				        		$thumbnail_id 	= get_term_meta( $term_id, 'thumbnail_id', true );
    				        		$image_url 		= wp_get_attachment_image_src( $thumbnail_id, 'shop_catalog');
    				        		if( !empty( $image_url ) ){
    				        			$cat_image = $image_url[0];
    				        		}else{
    				        			$cat_image = wc_placeholder_img_src();
    				        		} ?>
    				        		<li class="product-cat product">
    				        			<div class="product-thumb-wrap">
    				        				<img src="<?php echo esc_url( $cat_image ); ?>" alt="<?php echo esc_html( $term_title ); ?>">
    
    				        				<?php if( !empty( $view_details ) ){ ?>
    					        				<div class="add-to-cart-wrap view-details-wrap">
    					        					<a href="<?php echo esc_url( $term_link ); ?>" class="button btn-view-details"><?php echo esc_html( $view_details ) ?></a>
    					        				</div>
    				        				<?php } ?>
    				        			</div>
    				        			<div class="product-info-wrap">
    				        				<a href="<?php echo esc_url( $term_link ); ?>"><h4 class="featured-cat-title"><?php echo esc_html( $term_title ); ?><?php if( 1 === $show_counts ){ ?><span class="count"><?php echo ' ('.absint( $term_details->count ).')'; ?></span><?php } ?></h4></a>
    				        			</div>
    				        		</li>
    				        		<?php
    				        	}
    		                }

    Can you help with updating this code? if possible 🙂

    #17017

    nuslu
    Participant

    I don’t know how I did it but I did it.

    Thank you very much for your support and beautiful theme.

    I wish good work. 🙂

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

You must be logged in to reply to this topic.