Guest User

Untitled

a guest
Apr 23rd, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <ul class="products-list">
  2. <?php
  3. $args = array( 'post_type' => 'product', 'posts_per_page' => 10, 'product_cat' => 'product-category', 'orderby' => 'rand' );
  4. $loop = new WP_Query( $args );
  5. while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
  6.  
  7. <li class="product">
  8. <a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
  9. <?php woocommerce_show_product_sale_flash( $post, $product ); ?>
  10. <?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" width="300px" height="300px" />'; ?></a>
  11. <h3><?php the_title(); ?></h3>
  12. <span class="price"><?php echo $product->get_price_html(); ?></span>
  13. <p class="shortdescription"><?php echo $product->get_short_description();?></p>
  14.  
  15. //QUNATITY
  16.  
  17. <?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
  18. </li>
  19. <?php endwhile; ?>
  20. <?php wp_reset_query(); ?>
  21. </ul><!--/.products-->
  22.  
  23. <form class="cart" action="http://localhost/product/safelogic-basic/" method="post" enctype="multipart/form-data">
  24. <div class="quantity buttons_added clearfix">
  25. <div class="quantity_controll_con">
  26. <input type="button" class="quantity_controll minus" value="-">
  27. <input type="number" step="1" min="1" max="" name="quantity" value="1" title="Qty" class="input-text qty text" size="4" pattern="[0-9]*"
  28. inputmode="numeric">
  29. <input type="button" class="quantity_controll plus" value="+">
  30. </div>
  31. </div>
  32.  
  33. <button type="submit" name="add-to-cart" value="6995" class="single_add_to_cart_button button alt">Add to cart</button>
Add Comment
Please, Sign In to add comment