Guest User

Untitled

a guest
Sep 12th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. <?php if ( class_exists( 'WooCommerce' ) ):
  2. $arilewp_wooshop_disabled = get_theme_mod('arilewp_wooshop_disabled', true);
  3. $arilewp_wooshop_area_title = get_theme_mod('arilewp_wooshop_area_title', 'Our Shop');
  4. $arilewp_wooshop_area_des = get_theme_mod('arilewp_wooshop_area_des', '<b>Best Selling</b> Products');
  5. $arilewp_wooshop_front_container_size = get_theme_mod('arilewp_wooshop_front_container_size', 'container-full');
  6. $arilewp_wooshop_area_before_content = get_theme_mod('arilewp_wooshop_area_before_content');
  7. $arilewp_wooshop_area_after_content = get_theme_mod('arilewp_wooshop_area_after_content');
  8. if($arilewp_wooshop_area_before_content != null):
  9. echo do_shortcode($arilewp_wooshop_area_before_content);
  10. endif;
  11. if($arilewp_wooshop_disabled == true): ?>
  12. <!--Product-->
  13. <section class="theme-block shop bg-grey" id="theme-shop">
  14. <?php if($arilewp_wooshop_area_title != null || $arilewp_wooshop_area_des != null): ?>
  15. <div class="container">
  16. <div class="row">
  17. <div class="col-lg-12 col-md-12 col-xs-12">
  18. <div class="theme-section-module text-center">
  19. <?php if($arilewp_wooshop_area_title != null): ?>
  20. <p class="theme-section-subtitle"><?php echo $arilewp_wooshop_area_title; ?></p>
  21. <?php endif; ?>
  22. <?php if($arilewp_wooshop_area_des != null): ?>
  23. <h2 class="theme-section-title"><?php echo $arilewp_wooshop_area_des; ?></h2>
  24. <?php endif; ?>
  25. <div class="theme-separator-line-horrizontal-full"></div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <?php endif; ?>
  31. <div class="<?php echo $arilewp_wooshop_front_container_size; ?>">
  32. <div class="row">
  33. <?php
  34. $args = array( 'post_type' => 'product', 'product_cat' => 'gg',);
  35. $args['tax_query'] = array(
  36. array('taxonomy' => 'product_visibility','field' => 'name','terms' => 'exclude-from-catalog','operator' => 'NOT IN',),
  37. );
  38. ?>
  39. <div id="product-slider" class="owl-carousel owl-theme col-lg-12 products">
  40. <?php $loop = new WP_Query( $args );
  41. while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
  42. <div class="item <?php echo the_title(); ?>" data-profile="<?php echo $loop->post->ID; ?>">
  43. <div class="product">
  44. <a href="<?php the_permalink(); ?>" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">
  45. <?php if ( $product->is_on_sale() ) : ?>
  46. <?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale', 'arilewp' ) . '</span>', $post, $product ); ?>
  47. <?php endif; ?>
  48. <?php the_post_thumbnail(); ?>
  49. <h2 class="woocommerce-loop-product__title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" tabindex="-1"><?php the_title(); ?></a></h2>
  50. <?php if ($average = $product->get_average_rating()) : ?>
  51. <div class="woocommerce">
  52. <?php echo '<div class="star-rating" title="'.sprintf(__( 'Rated %s out of 5', 'arilewp' ), $average).'"><span style="width:'.( ( $average / 5 ) * 100 ) . '%"><strong itemprop="ratingValue" class="rating">'.$average.'</strong> '.__( 'out of 5', 'arilewp' ).'</span></div>'; ?>
  53. </div>
  54. <?php endif; ?>
  55. <span class="price">
  56. <span class="woocommerce-Price-amount amount"><?php echo $product->get_price_html(); ?></span>
  57. </span>
  58. </a>
  59. <?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
  60. </div>
  61. </div>
  62. <?php endwhile; ?> <?php wp_reset_postdata(); ?>
  63. </div>
  64. </div>
  65. </div>
  66. </section>
  67. <!-- /Product --->
  68. <?php endif;
  69. if($arilewp_wooshop_area_after_content != null):
  70. echo do_shortcode($arilewp_wooshop_area_after_content);
  71. endif;
  72. endif;
  73. ?>
Advertisement
Add Comment
Please, Sign In to add comment