HEX
Server: nginx/1.26.3
System: Linux debian 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64
User: www (1001)
PHP: 5.6.40
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/gxdaosen.net/wp-content/themes/blossom-shop/sections/recent_product.php
<?php
/**
 * Recent Products Section
 * 
 * @package Blossom_Shop
 */
if( blossom_shop_is_woocommerce_activated() ) {
	
	$sec_title    	= get_theme_mod( 'recent_product_title', __( 'New Arrivals', 'blossom-shop' ) );
	$sub_title  = get_theme_mod( 'recent_product_subtitle', __( 'Add our new arrivals to your weekly lineup.', 'blossom-shop' ) );

	$ed_crop_all    = get_theme_mod( 'ed_crop_all', false );
    $image_size = ( $ed_crop_all ) ? 'full' : 'blossom-shop-recent';

	$args = array(
        'post_type'           => 'product',                        
        'ignore_sticky_posts' => true,
        'posts_per_page'	  => get_theme_mod( 'no_of_products', 5 ),  
    );
    
	$qry = new WP_Query( $args );

	if( $qry->have_posts() ) { ?>

		<section id="recent_product_section" class="recent-prod-section style-one">
			<div class="container">
				<?php if( $sec_title || $sub_title ){ ?>
	            	<div class="recent-prod-wrap">	
		                <?php
			            if( $sec_title ) echo '<h2 class="section-title">' . esc_html( $sec_title ) . '</h2>';
			            if( $sub_title ) echo '<div class="section-desc">' . esc_html( $sub_title ) . '</div>'; 
		        		?>
		    		</div>
		        <?php } ?>

	            <div class="recent-prod-grid">
	                <div class="recent-prod-slider owl-carousel">
	                <?php
	                    while( $qry->have_posts() ){
	                        $qry->the_post(); global $product; ?>
	                        <div class="item">
	                        	<?php
	                                $stock = get_post_meta( get_the_ID(), '_stock_status', true );
	                                
	                                if( $stock == 'outofstock' ){
	                                    echo '<span class="outofstock">' . esc_html__( 'Sold Out', 'blossom-shop' ) . '</span>';
	                                }else{
	                                    woocommerce_show_product_sale_flash();    
	                                }
	                            ?>	                            
	                            <div class="recent-prod-image">
	                                <a href="<?php the_permalink(); ?>" rel="bookmark">
	                                    <?php 
	                                    if( has_post_thumbnail() ){
	                                        the_post_thumbnail( $image_size );    
	                                    }else{
	                                        blossom_shop_get_fallback_svg( $image_size );
	                                    }
	                                    ?>
	                                </a>
	                                <?php woocommerce_template_loop_add_to_cart(); ?>
	                            </div>
	                            
	                            <?php                            
	                            the_title( '<h3><a href="' . esc_url( get_permalink() ) . '">', '</a></h3>' ); 
	                            echo wc_get_rating_html( $product->get_average_rating() );                                  
	                            woocommerce_template_single_price(); //price                                
	                            
	                        	?>
	                        </div>
	                        <?php
	                    }
	                    ?>
	                </div>
	            </div>
			</div>
		</section> <!-- .recent-prod-section -->
	<?php }
	wp_reset_postdata();
}