The WooCommerce Xmas Bundle

Don’t miss the offer we at WooThemes are running up to Christmas – 3 WooCommerce themes and 8 extensions (including Jay’s super cool responsive Argentum theme and the ever popular table-rate shipping extension) for just $150. If you’ve been waiting for the right moment to jump onto the WooCommerce bandwagon nows the time!

I’d like to close with a massive thank you to all of our contributors, users, supporters, and the WordPress community as a whole — Merry Christmas and a happy new year!
http://zfer.us/kMa8w?d=www.woothemes.com/woocommerce-xmas-bundle/

WooCommerce – Output a simple, printable stock/inventory report

screen-capture-1

Another user request today to output a list of products, as well as their stock levels, to be used to compare the amount of real stock in hand with what WooCommerce thinks is in stock.

The code below can be added as a page template in your theme. Once added to your template, just create a page in WordPress admin and assign it the “Stock Report” page template.

Theres a check at the top of the page to only let admin users in, and when viewed the page will give you a simple list of products, SKU’s and stock levels which you can then print out.

I hope you find it useful 🙂


<?php
/*
Template Name: Stock Report 🙂
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php _e('Stock Report'); ?></title>
<style>
body { background:white; color:black; width: 95%; margin: 0 auto; }
table { border: 1px solid #000; width: 100%; }
table td, table th { border: 1px solid #000; padding: 6px; }
</style>
</head>
<body>
<header>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1 class="title"><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</header>
<section>
<?php
global $woocommerce;
?>
<table cellspacing="0" cellpadding="2">
<thead>
<tr>
<th scope="col" style="text-align:left;"><?php _e('Product', 'woothemes'); ?></th>
<th scope="col" style="text-align:left;"><?php _e('SKU', 'woothemes'); ?></th>
<th scope="col" style="text-align:left;"><?php _e('Stock', 'woothemes'); ?></th>
</tr>
</thead>
<tbody>
<?php
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => –1,
'orderby' => 'title',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => '_manage_stock',
'value' => 'yes'
)
),
'tax_query' => array(
array(
'taxonomy' => 'product_type',
'field' => 'slug',
'terms' => array('simple'),
'operator' => 'IN'
)
)
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
global $product;
?>
<tr>
<td><?php echo $product->get_title(); ?></td>
<td><?php echo $product->sku; ?></td>
<td><?php echo $product->stock; ?></td>
</tr>
<?php
endwhile;
?>
</tbody>
</table>
<h2>Variations</h2>
<table cellspacing="0" cellpadding="2">
<thead>
<tr>
<th scope="col" style="text-align:left;"><?php _e('Variation', 'woothemes'); ?></th>
<th scope="col" style="text-align:left;"><?php _e('Parent', 'woothemes'); ?></th>
<th scope="col" style="text-align:left;"><?php _e('SKU', 'woothemes'); ?></th>
<th scope="col" style="text-align:left;"><?php _e('Stock', 'woothemes'); ?></th>
</tr>
</thead>
<tbody>
<?php
$args = array(
'post_type' => 'product_variation',
'post_status' => 'publish',
'posts_per_page' => –1,
'orderby' => 'title',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => '_stock',
'value' => array('', false, null),
'compare' => 'NOT IN'
)
)
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$product = new WC_Product_Variation( $loop->post->ID );
?>
<tr>
<td><?php echo $product->get_title(); ?></td>
<td><?php echo get_the_title( $loop->post->post_parent ); ?></td>
<td><?php echo $product->sku; ?></td>
<td><?php echo $product->stock; ?></td>
</tr>
<?php
endwhile;
?>
</tbody>
</table>
</body>
</html>

WooCommerce: Output a printable list of processing orders

screen-capture

Someone requested a way to print out a list of their processing orders for WooCommerce so I came up with a snippet to do so 🙂

The code below can be added as a page template in your theme. Once added to your template, just create a page in WordPress admin and assign it the “Print processing orders” page template.

Theres a check at the top of the page to only let admin users in, and when viewed the page will give you a nice list of processing orders which you can then print out.


<?php
/*
Template Name: Print Processing Orders 🙂
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php _e('Processing Orders'); ?></title>
<style>
body { background:white; color:black; width: 95%; margin: 0 auto; }
table { border: 1px solid #000; width: 100%; }
table td, table th { border: 1px solid #000; padding: 6px; }
article { border-top: 2px dashed #000; padding: 20px 0; }
</style>
</head>
<body>
<header>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1 class="title"><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</header>
<section>
<?php
global $woocommerce;
$args = array(
'post_type' => 'shop_order',
'post_status' => 'publish',
'posts_per_page' => –1,
'tax_query' => array(
array(
'taxonomy' => 'shop_order_status',
'field' => 'slug',
'terms' => array('processing')
)
)
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$order_id = $loop->post->ID;
$order = new WC_Order($order_id);
?>
<article>
<header>
<h2>Order #<?php echo $order_id; ?> &mdash; <time datetime="<?php the_time('c'); ?>"><?php echo the_time('d/m/Y'); ?></time></h2>
</header>
<table cellspacing="0" cellpadding="2">
<thead>
<tr>
<th scope="col" style="text-align:left;"><?php _e('Product', 'woothemes'); ?></th>
<th scope="col" style="text-align:left;"><?php _e('Quantity', 'woothemes'); ?></th>
<th scope="col" style="text-align:left;"><?php _e('Price', 'woothemes'); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="row" colspan="2" style="text-align:left; padding-top: 12px;"><?php _e('Subtotal:', 'woothemes'); ?></th>
<td style="text-align:left; padding-top: 12px;"><?php echo $order->get_subtotal_to_display(); ?></td>
</tr>
<?php if ($order->order_shipping > 0) : ?><tr>
<th scope="row" colspan="2" style="text-align:left;"><?php _e('Shipping:', 'woothemes'); ?></th>
<td style="text-align:left;"><?php echo $order->get_shipping_to_display(); ?></td>
</tr><?php endif; ?>
<?php if ($order->order_discount > 0) : ?><tr>
<th scope="row" colspan="2" style="text-align:left;"><?php _e('Discount:', 'woothemes'); ?></th>
<td style="text-align:left;"><?php echo woocommerce_price($order->order_discount); ?></td>
</tr><?php endif; ?>
<?php if ($order->get_total_tax() > 0) : ?><tr>
<th scope="row" colspan="2" style="text-align:left;"><?php _e('Tax:', 'woothemes'); ?></th>
<td style="text-align:left;"><?php echo woocommerce_price($order->get_total_tax()); ?></td>
</tr><?php endif; ?>
<tr>
<th scope="row" colspan="2" style="text-align:left;"><?php _e('Total:', 'woothemes'); ?></th>
<td style="text-align:left;"><?php echo woocommerce_price($order->order_total); ?> <?php _e('- via', 'woothemes'); ?> <?php echo ucwords($order->payment_method); ?></td>
</tr>
</tfoot>
<tbody>
<?php echo $order->email_order_items_table(); ?>
</tbody>
</table>
<h2><?php _e('Customer details', 'woothemes'); ?></h2>
<?php if ($order->billing_email) : ?>
<p><strong><?php _e('Email:', 'woothemes'); ?></strong> <?php echo $order->billing_email; ?></p>
<?php endif; ?>
<?php if ($order->billing_phone) : ?>
<p><strong><?php _e('Tel:', 'woothemes'); ?></strong> <?php echo $order->billing_phone; ?></p>
<?php endif; ?>
<div style="float:left; width: 49%;">
<h3><?php _e('Billing address', 'woothemes'); ?></h3>
<p>
<?php echo $order->get_formatted_billing_address(); ?>
</p>
</div>
<div style="float:right; width: 49%;">
<h3><?php _e('Shipping address', 'woothemes'); ?></h3>
<p>
<?php echo $order->get_formatted_shipping_address(); ?>
</p>
</div>
<div style="clear:both;"></div>
</article>
<?php endwhile; ?>
</section>
</body>
</html>

Say hello to WooCommerce; simple, beautiful WordPress eCommerce

Today I’m proud to announce WooCommerce has arrived. Its been a tough week preparing it’s launch, and a busy month of development work but its all paid off. The WooThemes team, myself included, are incredibly excited by its completion and we hope it’s a hit with the WordPress community as a whole.

WooCommerce is an open source eCommerce plugin for WordPress with loads of cool features. Adding products, managing orders, setting up tax and shipping rates – WooCommerce makes it easy.

Whilst developing WooCommerce we focused on extending core WordPress functionality and keeping the UI consistant; this gives you an simple, easy to use, familiar admin interface which is a joy to use.

We made full use of WordPress custom post types, post type archives, and custom taxonomies making it both extendable and easy to theme. Theme developers will be relieved by its simplicity – after using several other eCommerce plugins in the past I know that it will be a breath of fresh air to many.

Alongside the release of the WooCommerce plugin we’ve also released three new themes (WooStoreCoquette and Wootique) as well as several child themes and extensions.

WooTique is our free WooCommerce theme

You can read more about WooCommerce on the WooThemes site. Be sure to check out WooCommerce on WordPress.org, and if your a developer (or a translator) why not say hi on Github and contribute to the project 🙂

Loading...