Advertisement
BDHexor

ওকমার্স নিয়ে কিছু টিপস ।

Sep 18th, 2014
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. ওকমার্স নিয়ে কিছু টিপস
  2. ==============================
  3.  
  4. সব শর্টকোড
  5. ========================
  6. http://docs.woothemes.com/document/woocommerce-shortcodes/
  7. [featured_products per_page="12" columns="3"]
  8.  
  9.  
  10. রিসেণ্ট প্রোডাক্ট আনার জন্য
  11. ================================
  12.  
  13. <section id="recent">
  14.  
  15. <h1>Recently Added</h1>
  16.  
  17. <ul class="row-fluid">
  18.  
  19. <?php
  20. $args = array( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => 4, 'orderby' =>'date','order' => 'DESC' );
  21. $loop = new WP_Query( $args );
  22. while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
  23.  
  24. <li class="span3">
  25.  
  26. <a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
  27.  
  28. <?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="65px" height="115px" />'; ?>
  29.  
  30. <h3><?php the_title(); ?></h3>
  31.  
  32. <span class="price"><?php echo $product->get_price_html(); ?></span>
  33.  
  34. </a>
  35.  
  36. <?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
  37. </li><!-- /span3 -->
  38. <?php endwhile; ?>
  39. <?php wp_reset_query(); ?>
  40.  
  41. </ul><!-- /row-fluid -->
  42. </section><!-- /recent -->
  43.  
  44.  
  45.  
  46.  
  47. ফিচার প্রোডাক্ট অ্যাড করার জন্য
  48. ============================================
  49. <?php
  50. $args = array( 'post_type' => 'product', 'meta_key' => '_featured','posts_per_page' => 15,'columns' => '3', 'meta_value' => 'yes' );
  51. $loop = new WP_Query( $args );
  52. while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
  53. <li class="product">
  54. <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); ?>">
  55. <h3><?php the_title(); ?></h3><br /><span class="price"><?php echo $product->get_price_html(); ?></span><br />
  56. <?php woocommerce_show_product_sale_flash( $post, $product ); ?>
  57. <?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>
  58. <span class="motangan"><?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?></span><br />
  59. </li>
  60. <?php
  61. /**
  62. * woocommerce_pagination hook
  63. *
  64. * @hooked woocommerce_pagination - 10
  65. * @hooked woocommerce_catalog_ordering - 20
  66. */
  67. do_action( 'woocommerce_pagination' );
  68. ?>
  69. <?php endwhile; ?>
  70. <?php wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement