%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/friendstravel.al/wp-content/themes/friendstravel/travel-booking/
Upload File :
Create Path :
Current File : /var/www/html/friendstravel.al/wp-content/themes/friendstravel/travel-booking/travel-booking.php

<?php
if ( !defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
// custom hook content product
if ( !function_exists( 'travel_tours_renders_stars_rating' ) ) {
	function travel_tours_renders_stars_rating( $rating ) {
		$stars_html = '<div class="item_rating"><div class="star-rating" title="' . sprintf( esc_html__( 'Rated %s out of 5', 'travelwp' ), $rating ) . '">';
		$stars_html .= '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%"></span>';
		$stars_html .= '</div></div>';
		printf( '%s', $stars_html );
	}
}
add_action( 'woocommerce_item_rating', 'woocommerce_template_loop_rating', 5 );

if ( !function_exists( 'travelwp_option_column_content' ) ) {
	function travelwp_option_column_content( $layout, $theme_option ) {
		$classes = array();
		if ( $layout == 'list' ) {
			$classes[] = 'item-list-tour col-md-12';
		} else {
			$column_product = 4;
			if ( travelwp_get_option( $theme_option ) ) {
				$column_product = 12 / travelwp_get_option( $theme_option );
			}
			$cat_obj = travelwp_get_wp_query()->get_queried_object();
			if ( isset( $cat_obj->term_id ) ) {
				$cat_ID                = $cat_obj->term_id;
				$custom_layout_content = get_tax_meta( $cat_ID, 'phys_layout_content', true );
				if ( $custom_layout_content == 'grid' ) {
					$custom_layout_content = get_tax_meta( $cat_ID, 'phys_layout_content_column', true );
					$column_product        = 12 / $custom_layout_content;
				}
			}
			$classes[] = 'item-tour col-md-' . $column_product . ' col-sm-6';
		}

		return $classes;
	}
}

// custom hook content product
if ( !function_exists( 'travel_loop_item_title_price' ) ) {
	function travel_loop_item_title_price() {
		global $product;
		$price      = get_post_meta( get_the_ID(), '_regular_price', true );
		$price_sale = get_post_meta( get_the_ID(), '_sale_price', true );
		$from       = '';
		if ( $price != '' && $price_sale == '' ) {
			$from = '<span class="text">' . esc_html__( 'From', 'travelwp' ) . '</span>';
		}
		?>
		<?php if ( $price_html = $product->get_price_html() ) : ?>
			<span class="price">
				<?php echo ent2ncr( $from . $price_html ); ?>
			</span>
		<?php endif;
	}
}
add_action( 'travel_loop_item_title_price', 'travel_loop_item_title_price', 5 );

?>

Zerion Mini Shell 1.0