| Server IP : 10.19.1.101 / Your IP : 216.73.216.158 Web Server : Apache System : Linux web1f13.kinghost.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64 User : schererimoveisrs ( 170628) PHP Version : 7.4.33 Disable Function : apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/schererimoveisrs/www/wp-content/themes/sleeky/ |
Upload File : |
<?php
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
add_action( 'woocommerce_single_product_summary', 'sleeky_woocommerce_template_single_title', 9 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
function sleeky_count_related_products( $args ) {
$args = array(
'posts_per_page' => 4,
'columns' => 4,
"orderby" => "rand", // @codingStandardsIgnoreLine.
);
return $args;
}
if ( ! function_exists( 'sleeky_woocommerce_single_gallery_thumbnail_size' ) ) :
/**
* Change the gallery thumbnail image size.
*/
function sleeky_woocommerce_single_gallery_thumbnail_size( $size ) {
return array(
'width' => 170,
'height' => 180,
'crop' => 1,
);
}
endif;
add_filter(
'woocommerce_get_image_size_gallery_thumbnail',
'sleeky_woocommerce_single_gallery_thumbnail_size'
);
?>
<?php
function sleeky_woocommerce_template_single_title() {
the_title( '<div class="upper-box"><h3 class="product_title entry-title">', '</h3>' );
}
add_action(
'woocommerce_before_single_product',
'sleeky_before_single_product_markup'
);
function sleeky_before_single_product_markup() {
?>
<!-- shop-details -->
<section class="shop-details">
<div class="large-container">
<?php
} // woocommerce_product header banner
add_action(
'woocommerce_before_single_product_summary',
'sleeky_before_single_product_summary'
);
function sleeky_before_single_product_summary() {
?>
<div class="shop-details-content">
<div class="row clearfix">
<?php
}
add_action(
'woocommerce_before_single_product_summary',
'sleeky_before_single_product_summary_markup',
21
);
function sleeky_before_single_product_summary_markup() {
?>
<div class="col-lg-6 col-md-12 col-sm-12 content-column">
<div class="content-box">
<?php
}
add_action(
'woocommerce_single_product_summary',
'sleeky_before_single_product_excerpt_markup',
19
);
function sleeky_before_single_product_excerpt_markup() {
?>
<div class="text">
<?php
}
add_action(
'woocommerce_single_product_summary',
'sleeky_before_single_product_excerpt_markup_end',
21
);
function sleeky_before_single_product_excerpt_markup_end() {
global $product;
$stock_quantity = $product->get_stock_quantity();
$sale_stock_quantity = get_post_meta( $product->get_id(), 'total_sales', true );
$thepostid = get_the_ID();
$sale_price_dates_to = ( $date = get_post_meta( $thepostid, '_sale_price_dates_to', true ) ) ? date_i18n( 'Y-m-d', $date ) : '';
$schedule_title = get_post_meta( $thepostid, '_product_schedule_title_meta_key', true );
?>
</div>
<?php woocommerce_template_single_price(); ?>
<span class="product-status"><?php echo wp_kses( $product->get_stock_status(), 'code_contxt' ); ?></span>
</div>
<?php if ( $product->is_on_sale() || ( $stock_quantity ) ) { ?>
<div class="timer-box">
<?php if ( $product->is_on_sale() ) { ?>
<div class="countdown-box clearfix">
<?php if ( ! empty( $schedule_title ) ) { ?>
<div class="left-inner pull-left"><h6><?php echo wp_kses( $schedule_title, 'code_contxt' ); ?></h6></div>
<?php } ?>
<div class="right-inner timer pull-left">
<div class="cs-countdown" data-countdown="<?php echo esc_attr( $sale_price_dates_to ); ?>"></div>
</div>
</div>
<?php
}
if ( $stock_quantity ) :
$sale_percentage = ( $sale_stock_quantity / $stock_quantity ) * 100;
if ( $sale_percentage < 50 ) {
$bar_class = 'border-green';
} elseif ( $sale_percentage >= 75 ) {
$bar_class = 'border-red';
} elseif ( $sale_percentage >= 50 ) {
$bar_class = 'border-yellow';
}
?>
<div class="progress-inner clearfix">
<div class="left-inner pull-left"><h6><?php _e( 'In', 'sleeky' ); ?> <br /><?php _e( 'Stocks', 'sleeky' ); ?></h6></div>
<div class="right-inner progress-box pull-left">
<div class="bar">
<div class="bar-inner count-bar" data-percent="<?php echo esc_attr( $sale_percentage ); ?>%"></div>
</div>
<div class="stock"><?php _e( 'Sold', 'sleeky' ); ?> <span><?php echo esc_html( $sale_stock_quantity ); ?>/<?php echo esc_html( $stock_quantity ); ?></span></div>
</div>
</div>
<?php endif; ?>
</div>
<?php
}
}
add_action(
'woocommerce_single_product_summary',
'sleeky_single_product_meta',
29
);
function sleeky_single_product_meta() {
?>
<?php woocommerce_template_single_meta(); ?>
<?php
}
add_action(
'woocommerce_single_product_summary',
'sleeky_single_add_to_cart',
28
);
function sleeky_single_add_to_cart() {
woocommerce_template_single_add_to_cart();
$sleeky_payment_on_off_switch = sleeky_get_options( 'sleeky_payment_on_off_switch' );
$visa_card_repeater_settings = sleeky_get_options( 'visa_card_repeater_sett' );
$single_payment_title = sleeky_get_options( 'single_payment_title' );
if ( $sleeky_payment_on_off_switch == '1' ) {
?>
<div class="card-box">
<h6><?php echo wp_kses( $single_payment_title, 'code_contxt' ); ?></h6>
<ul class="card-list clearfix">
<?php
foreach ( $visa_card_repeater_settings as $visa_card_settings ) {
$card_image = $visa_card_settings['visa_image'];
$link_url = $visa_card_settings['link_url'];
?>
<li>
<figure class="card-img"><a href="<?php echo esc_url( $link_url ); ?>"><img src="<?php echo esc_url( $card_image ); ?>" alt="<?php esc_attr_e( 'Payment Icon', 'sleeky' ); ?>"></a></figure>
</li>
<?php } ?>
</ul>
</div>
<?php
}
}
add_action(
'woocommerce_after_single_product_summary',
'sleeky_after_single_product_summary',
7
);
function sleeky_after_single_product_summary() {
?>
</div>
</div>
<?php
}
add_action(
'woocommerce_after_single_product_summary',
'sleeky_woocommerce_output_product_data_tabs',
7
);
function sleeky_woocommerce_output_product_data_tabs() {
?>
</div>
</div>
<?php
woocommerce_output_product_data_tabs();
}
add_action( 'woocommerce_after_single_product_summary', 'sleeky_related_after_single_product_summary', 22 );
function sleeky_related_after_single_product_summary() {
?>
<?php
global $product;
$related = wc_get_related_products( $product->get_id() );
$related_products = array_filter( array_map( 'wc_get_product', wc_get_related_products( $product->get_id(), 4, $product->get_upsell_ids() ) ), 'wc_products_array_filter_visible' );
?>
<?php
if ( count( $related ) > 0 ) {
?>
<div class="related-products">
<div class="title-box centred">
<h2><?php esc_html_e( 'Related Product', 'sleeky' ); ?></h2>
</div>
<div class="four-item-carousel">
<div class="swiper-wrapper">
<?php sleeky_output_related_products(); ?>
</div>
<?php
if ( count( $related ) > 4 ) {
?>
<div class="swiper-nav">
<div class="prev-btn nav-btn"><i class="fal fa-angle-left"></i></div>
<div class="next-btn nav-btn"><i class="fal fa-angle-right"></i></div>
</div>
<?php } ?>
</div>
</div>
<?php
}
}
add_filter( 'woocommerce_output_related_products', 'sleeky_output_related_products', 10 );
function sleeky_output_related_products() {
global $product;
$related_products = array_filter( array_map( 'wc_get_product', wc_get_related_products( $product->get_id(), 4, $product->get_upsell_ids() ) ), 'wc_products_array_filter_visible' );
$len = count( $related_products );
?>
<?php
$i = 1;
foreach ( $related_products as $related_product ) :
?>
<?php
$post_object = get_post( $related_product->get_id() );
setup_postdata( $GLOBALS['post'] = &$post_object );
wc_get_template_part( 'content', 'relproduct' );
?>
<?php
$i++;
endforeach;
}
add_action( 'woocommerce_after_single_product', 'sleeky_woocommerce_after_single_product', 20 );
function sleeky_woocommerce_after_single_product() {
?>
</div>
</section>
<?php
}
if ( ! function_exists( 'sleeky_product_comments' ) ) {
function sleeky_product_comments( $comment, $args, $depth ) {
extract( $args, EXTR_SKIP );
$args['reply_text'] = esc_html__( 'Reply', 'sleeky' );
$class = '';
if ( $depth > 1 ) {
$class = '';
}
if ( $depth == 1 ) {
$child_html_el = '<ul><li>';
$child_html_end_el = '</li></ul>';
}
if ( $depth >= 2 ) {
$child_html_el = '<li>';
$child_html_end_el = '</li>';
}
global $comment;
$rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );
?>
<div class="comment single-comment-box" id="comment-<?php comment_ID(); ?>">
<div class="inner-box">
<figure class="comment-thumb">
<?php print get_avatar( $comment, 115, null, null, array( 'class' => array() ) ); ?>
</figure>
<div class="inner">
<?php
if ( $rating && wc_review_ratings_enabled() ) {
echo wc_get_rating_html( $rating ); // WPCS: XSS ok.
}
?>
<h5><?php echo get_comment_author_link(); ?>, <span><?php echo get_comment_date(); ?></span></h5>
<p><?php comment_text(); ?></p>
</div>
</div>
</div>
<?php
}
}