Sunday, April 14, 2019

Display Out of Stock Products on a separate page

Show out of stock products on a separate page.

Add the below PHP to your theme functions.php file (I always recommend to create a child theme).

Use the shortcode [out_of_stock_products] on any page you like.

Note – all products must be set to “Manage Stock”

1. How to create WooCommerce shortcode.
2. How to use a WordPress query to return those products that have 0 stock.


1:  /* Display All Out of Stock Products via a Shortcode - WooCommerce */  
2:  add_shortcode( 'out_of_stock_products', 'wpsohel_out_of_stock_products_shortcode' );  
3:  function wpsohel_out_of_stock_products_shortcode() {  
4:  global $product, $woocommerce, $woocommerce_loop;  
5:  $columns = 4;  
6:  $args = array(  
7:    'post_type'       => 'product',  
8:    'post_status'      => 'publish',  
9:    'meta_query'      => array(  
10:      array(  
11:        'key'      => '_stock',  
12:        'value'     => 1,  
13:        'compare'    => '<'  
14:      )  
15:    )  
16:  );  
17:  $loop = new WP_Query($args);  
18:  ob_start();  
19:  woocommerce_product_loop_start();  
20:  while ( $loop->have_posts() ) : $loop->the_post();  
21:  wc_get_template_part( 'content', 'product' );  
22:  endwhile;   
23:  woocommerce_product_loop_end();  
24:  woocommerce_reset_loop();  
25:  wp_reset_postdata();  
26:  return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';  
27:  }  

Saturday, February 3, 2018

Build WordPress eCommerce store by WooCommerce

Creative and technical WordPress WooCommerce expert building rich and interactive eCommerce online store by WordPress WooCommerce with 4 years of experience.

If you are looking for eCommerce website by WordPress then you are in the right place.

I build with the latest technology which will accelerate the development process, with the best security and responsive design.

Services I am offering:
✓ Install Wordpress
✓ Setup Google analytics
✓ WooCommerce Setup & Settings update
✓ Upload Product with the variation
✓ Theme Customization
✓ Responsive with mobiles & tablets on all browsers
✓ Slider at Top
✓ All payment methods available & payment integration
✓ Live Chat
✓ Subscriber Form Sign Up
✓ Coupon System
✓ Transfer site to another hosting if necessary
✓ Integrate Social Plugins. etc...

Why me : 
✓ Free 1 month support
✓ The quickest website delivery
✓ Unlimited revision until complete project
✓ Top communication service
✓ 100% Customer Satisfaction

https://www.fiverr.com/s2/cb2f5dc668