diff --git a/admin/post-types/writepanels/writepanel-product_data.php b/admin/post-types/writepanels/writepanel-product_data.php index 4315c77f8a3..20fb9c7522b 100644 --- a/admin/post-types/writepanels/writepanel-product_data.php +++ b/admin/post-types/writepanels/writepanel-product_data.php @@ -510,6 +510,9 @@ function woocommerce_process_product_meta( $post_id, $post ) { $woocommerce_errors = array(); + // Add any default post meta + add_post_meta( $post_id, 'total_sales', '0', true ); + // Get types $product_type = sanitize_title( stripslashes( $_POST['product-type'] ) ); $is_downloadable = (isset($_POST['_downloadable'])) ? 'yes' : 'no'; diff --git a/admin/woocommerce-admin-init.php b/admin/woocommerce-admin-init.php index 440c3dad056..b94c23f0007 100644 --- a/admin/woocommerce-admin-init.php +++ b/admin/woocommerce-admin-init.php @@ -452,7 +452,7 @@ function woocommerce_exclude_image_from_product_page_field_save( $post, $attachm } function woocommerce_exclude_image_from_product_page_field_add( $post_id ) { - add_post_meta( $post_id, '_woocommerce_exclude_image', 0); + add_post_meta( $post_id, '_woocommerce_exclude_image', 0, true ); } /** diff --git a/readme.txt b/readme.txt index 99818b256a4..83fe633ab82 100644 --- a/readme.txt +++ b/readme.txt @@ -174,6 +174,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Tweak - Locale settings change placeholder dynamically like the label * Tweak - PayPal standard - separate option for address_override * Tweak - Only show weight/dimensions in bulk/quick edit when enabled +* Tweak - Add total sales meta to products even if unsold * Fix - Search/filter compatibility with relevanssi * Fix - Ecommerce tracking enable/disable option * Fix - After tax coupons for categories diff --git a/woocommerce.php b/woocommerce.php index 1576b1f9538..fce7fa1865c 100644 --- a/woocommerce.php +++ b/woocommerce.php @@ -1050,7 +1050,7 @@ class Woocommerce { * Domain-mapping safe ajax url */ function ajax_url() { - $url = ( is_admin() ) ? admin_url( 'admin-ajax.php' ) : home_url( 'wp-admin/admin-ajax.php' ); + $url = admin_url( 'admin-ajax.php' ); $url = ( is_ssl() ) ? $url : str_replace( 'https', 'http', $url );