Guest User

Untitled

a guest
Jul 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. if ( ! function_exists( 'techmarket_deals_carousel_and_products_carousel_tabs' ) ) {
  2. function techmarket_deals_carousel_and_products_carousel_tabs() {
  3. if( techmarket_is_woocommerce_activated() ) {
  4.  
  5. $home_v1 = techmarket_get_home_v1_meta();
  6. $ptc_options = $home_v1['dwtc']['ptc'];
  7.  
  8. $is_enabled = isset( $home_v1['dwtc']['is_enabled'] ) ? $home_v1['dwtc']['is_enabled'] : 'no';
  9.  
  10. if ( $is_enabled !== 'yes' ) {
  11. return;
  12. }
  13.  
  14. $animation = isset( $home_v1['dwtc']['animation'] ) ? $home_v1['dwtc']['animation'] : '';
  15.  
  16. $tabs_args = apply_filters( 'techmarket_dwtc_v1_products_carousel_tabs_args', array(
  17. 'animation' => $animation,
  18. 'section_title' => '',
  19. 'tabs' => array(
  20. array(
  21. 'title' => isset( $ptc_options['tabs'][0]['title'] ) ? $ptc_options['tabs'][0]['title'] : esc_html__( 'New Arrivals', 'techmarket' ),
  22. 'shortcode_tag' => isset( $ptc_options['tabs'][0]['shortcode_content']['shortcode'] ) ? $ptc_options['tabs'][0]['shortcode_content']['shortcode'] : 'recent_products',
  23. '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' )
  24.  
  25. ),
  26. array(
  27. 'title' => isset( $ptc_options['tabs'][1]['title'] ) ? $ptc_options['tabs'][1]['title'] : esc_html__( 'On Sale', 'techmarket' ),
  28. 'shortcode_tag' => isset( $ptc_options['tabs'][1]['shortcode_content']['shortcode'] ) ? $ptc_options['tabs'][1]['shortcode_content']['shortcode'] : 'featured_products',
  29. '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' )
  30. ),
  31. array(
  32. 'title' => isset( $ptc_options['tabs'][2]['title'] ) ? $ptc_options['tabs'][2]['title'] : esc_html__( 'Best Rated', 'techmarket' ),
  33. 'shortcode_tag' => isset( $ptc_options['tabs'][2]['shortcode_content']['shortcode'] ) ? $ptc_options['tabs'][2]['shortcode_content']['shortcode'] : 'sale_products',
  34. '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' )
  35. ),
  36. ),
  37. 'carousel_args' => array(
  38. 'rows' => isset( $ptc_options['carousel_args']['rows'] ) ? intval( $ptc_options['carousel_args']['rows'] ) : 2,
  39. 'slidesPerRow' => isset( $ptc_options['carousel_args']['slidesPerRow'] ) ? intval( $ptc_options['carousel_args']['slidesPerRow'] ) : 5,
  40. 'slidesToShow' => isset( $ptc_options['carousel_args']['slidesToShow'] ) ? intval( $ptc_options['carousel_args']['slidesToShow'] ) : 1,
  41. 'slidesToScroll' => isset( $ptc_options['carousel_args']['slidesToScroll'] ) ? intval( $ptc_options['carousel_args']['slidesToScroll'] ) : 1,
  42. 'dots' => isset( $ptc_options['carousel_args']['dots'] ) ? filter_var( $ptc_options['carousel_args']['dots'], FILTER_VALIDATE_BOOLEAN ) : true,
  43. 'arrows' => isset( $ptc_options['carousel_args']['arrows'] ) ? filter_var( $ptc_options['carousel_args']['arrows'], FILTER_VALIDATE_BOOLEAN ) : false,
  44. 'responsive' => array(
  45. array(
  46. 'breakpoint' => 1023,
  47. 'settings' => array(
  48. 'slidesPerRow' => 2
  49. )
  50. ),
  51. array(
  52. 'breakpoint' => 1169,
  53. 'settings' => array(
  54. 'slidesPerRow' => 4
  55. )
  56. ),
  57. array(
  58. 'breakpoint' => 1400,
  59. 'settings' => array(
  60. 'slidesPerRow' => 3
  61. )
  62. )
  63. )
  64. )
  65. ) );
  66.  
  67. ?><div class="section-deals-carousel-and-products-carousel-tabs">
  68. <?php techmarket_products_carousel_tabs( $tabs_args ); ?>
  69. </div>
  70. <?php
  71. }
  72. }
  73. }
Add Comment
Please, Sign In to add comment