Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! function_exists( 'techmarket_deals_carousel_and_products_carousel_tabs' ) ) {
- function techmarket_deals_carousel_and_products_carousel_tabs() {
- if( techmarket_is_woocommerce_activated() ) {
- $home_v1 = techmarket_get_home_v1_meta();
- $ptc_options = $home_v1['dwtc']['ptc'];
- $is_enabled = isset( $home_v1['dwtc']['is_enabled'] ) ? $home_v1['dwtc']['is_enabled'] : 'no';
- if ( $is_enabled !== 'yes' ) {
- return;
- }
- $animation = isset( $home_v1['dwtc']['animation'] ) ? $home_v1['dwtc']['animation'] : '';
- $tabs_args = apply_filters( 'techmarket_dwtc_v1_products_carousel_tabs_args', array(
- 'animation' => $animation,
- 'section_title' => '',
- 'tabs' => array(
- array(
- 'title' => isset( $ptc_options['tabs'][0]['title'] ) ? $ptc_options['tabs'][0]['title'] : esc_html__( 'New Arrivals', 'techmarket' ),
- 'shortcode_tag' => isset( $ptc_options['tabs'][0]['shortcode_content']['shortcode'] ) ? $ptc_options['tabs'][0]['shortcode_content']['shortcode'] : 'recent_products',
- 'shortcode_atts'=> isset( $ptc_options['tabs'][0]['shortcode_content'] ) ? techmarket_get_atts_for_shortcode( $ptc_options['tabs'][0]['shortcode_content'] ) : array('columns' => '5','per_page' => '20' )
- ),
- array(
- 'title' => isset( $ptc_options['tabs'][1]['title'] ) ? $ptc_options['tabs'][1]['title'] : esc_html__( 'On Sale', 'techmarket' ),
- 'shortcode_tag' => isset( $ptc_options['tabs'][1]['shortcode_content']['shortcode'] ) ? $ptc_options['tabs'][1]['shortcode_content']['shortcode'] : 'featured_products',
- 'shortcode_atts'=> isset( $ptc_options['tabs'][1]['shortcode_content'] ) ? techmarket_get_atts_for_shortcode( $ptc_options['tabs'][1]['shortcode_content'] ) : array( 'columns' => '5','per_page' => '20' )
- ),
- array(
- 'title' => isset( $ptc_options['tabs'][2]['title'] ) ? $ptc_options['tabs'][2]['title'] : esc_html__( 'Best Rated', 'techmarket' ),
- 'shortcode_tag' => isset( $ptc_options['tabs'][2]['shortcode_content']['shortcode'] ) ? $ptc_options['tabs'][2]['shortcode_content']['shortcode'] : 'sale_products',
- 'shortcode_atts'=> isset( $ptc_options['tabs'][2]['shortcode_content'] ) ? techmarket_get_atts_for_shortcode( $ptc_options['tabs'][2]['shortcode_content'] ) : array( 'columns' => '5','per_page' => '20' )
- ),
- ),
- 'carousel_args' => array(
- 'rows' => isset( $ptc_options['carousel_args']['rows'] ) ? intval( $ptc_options['carousel_args']['rows'] ) : 2,
- 'slidesPerRow' => isset( $ptc_options['carousel_args']['slidesPerRow'] ) ? intval( $ptc_options['carousel_args']['slidesPerRow'] ) : 5,
- 'slidesToShow' => isset( $ptc_options['carousel_args']['slidesToShow'] ) ? intval( $ptc_options['carousel_args']['slidesToShow'] ) : 1,
- 'slidesToScroll' => isset( $ptc_options['carousel_args']['slidesToScroll'] ) ? intval( $ptc_options['carousel_args']['slidesToScroll'] ) : 1,
- 'dots' => isset( $ptc_options['carousel_args']['dots'] ) ? filter_var( $ptc_options['carousel_args']['dots'], FILTER_VALIDATE_BOOLEAN ) : true,
- 'arrows' => isset( $ptc_options['carousel_args']['arrows'] ) ? filter_var( $ptc_options['carousel_args']['arrows'], FILTER_VALIDATE_BOOLEAN ) : false,
- 'responsive' => array(
- array(
- 'breakpoint' => 1023,
- 'settings' => array(
- 'slidesPerRow' => 2
- )
- ),
- array(
- 'breakpoint' => 1169,
- 'settings' => array(
- 'slidesPerRow' => 4
- )
- ),
- array(
- 'breakpoint' => 1400,
- 'settings' => array(
- 'slidesPerRow' => 3
- )
- )
- )
- )
- ) );
- ?><div class="section-deals-carousel-and-products-carousel-tabs">
- <?php techmarket_products_carousel_tabs( $tabs_args ); ?>
- </div>
- <?php
- }
- }
- }
Add Comment
Please, Sign In to add comment