|
@ -3,4 +3,7 @@ logs/
|
||||||
project.xml
|
project.xml
|
||||||
project.properties
|
project.properties
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
.buildpath
|
||||||
|
.project
|
||||||
|
.settings*
|
||||||
|
|
|
@ -4,7 +4,7 @@ Community made patches, localisations, bug reports and contributions are always
|
||||||
|
|
||||||
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
|
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
|
||||||
|
|
||||||
__note__ GitHub is for bug reports and contributions only - if you have a support question or a request for a customisation don't post here. Use [WooThemes Support](http://support.woothemes.com) and [WooJobs](http://jobs.woothemes.com) respectively.
|
__note:__ GitHub is for bug reports and contributions only - if you have a support question or a request for a customization don't post here. Use [WooThemes Support](http://support.woothemes.com) and [WooJobs](http://jobs.woothemes.com) respectively.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
@ -13,20 +13,20 @@ __note__ GitHub is for bug reports and contributions only - if you have a suppor
|
||||||
* Clearly describe the issue including steps to reproduce when it is a bug.
|
* Clearly describe the issue including steps to reproduce when it is a bug.
|
||||||
* Make sure you fill in the earliest version that you know has the issue.
|
* Make sure you fill in the earliest version that you know has the issue.
|
||||||
|
|
||||||
## Making Changes
|
## Making Changes
|
||||||
|
|
||||||
* Fork the repository on GitHub
|
* Fork the repository on GitHub.
|
||||||
* Make the changes to your forked repository
|
* Make the changes to your forked repository.
|
||||||
* Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards)
|
* **Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards).**
|
||||||
* Ensure you use LF line endings - no crazy windows line endings :)
|
* Ensure you use LF line endings - no crazy windows line endings. :)
|
||||||
* When committing, reference your issue (#1234) and include a note about the fix
|
* When committing, reference your issue (#1234) and include a note about the fix.
|
||||||
* Push the changes to your fork and submit a pull request on the master WooCommerce repository
|
* Push the changes to your fork and submit a pull request on the master WooCommerce repository.
|
||||||
|
|
||||||
At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
|
At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
|
||||||
|
|
||||||
# Additional Resources
|
# Additional Resources
|
||||||
|
|
||||||
* [General GitHub documentation](http://help.github.com/)
|
* [General GitHub documentation](http://help.github.com/)
|
||||||
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
|
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
|
||||||
* [WooCommerce Docs](http://wcdocs.woothemes.com/)
|
* [WooCommerce Docs](http://docs.woothemes.com/)
|
||||||
* [WooThemes Support](http://support.woothemes.com)
|
* [WooThemes Support](http://support.woothemes.com)
|
||||||
|
|
|
@ -59,7 +59,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||||
else
|
else
|
||||||
$file = ABSPATH . $this->file_url;
|
$file = ABSPATH . $this->file_url;
|
||||||
|
|
||||||
add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
|
add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
|
||||||
|
|
||||||
if ( function_exists( 'gc_enable' ) )
|
if ( function_exists( 'gc_enable' ) )
|
||||||
gc_enable();
|
gc_enable();
|
||||||
|
@ -149,28 +149,32 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||||
$postcodes = explode( ';', $postcode );
|
$postcodes = explode( ';', $postcode );
|
||||||
$postcodes = array_map( 'strtoupper', array_map( 'woocommerce_clean', $postcodes ) );
|
$postcodes = array_map( 'strtoupper', array_map( 'woocommerce_clean', $postcodes ) );
|
||||||
foreach( $postcodes as $postcode ) {
|
foreach( $postcodes as $postcode ) {
|
||||||
$wpdb->insert(
|
if ( ! empty( $postcode ) && $postcode != '*' ) {
|
||||||
$wpdb->prefix . "woocommerce_tax_rate_locations",
|
$wpdb->insert(
|
||||||
array(
|
$wpdb->prefix . "woocommerce_tax_rate_locations",
|
||||||
'location_code' => $postcode,
|
array(
|
||||||
'tax_rate_id' => $tax_rate_id,
|
'location_code' => $postcode,
|
||||||
'location_type' => 'postcode',
|
'tax_rate_id' => $tax_rate_id,
|
||||||
)
|
'location_type' => 'postcode',
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$city = woocommerce_clean( $city );
|
$city = woocommerce_clean( $city );
|
||||||
$cities = explode( ';', $city );
|
$cities = explode( ';', $city );
|
||||||
$cities = array_map( 'strtoupper', array_map( 'woocommerce_clean', $cities ) );
|
$cities = array_map( 'strtoupper', array_map( 'woocommerce_clean', $cities ) );
|
||||||
foreach( $cities as $city ) {
|
foreach( $cities as $city ) {
|
||||||
$wpdb->insert(
|
if ( ! empty( $city ) && $city != '*' ) {
|
||||||
$wpdb->prefix . "woocommerce_tax_rate_locations",
|
$wpdb->insert(
|
||||||
array(
|
$wpdb->prefix . "woocommerce_tax_rate_locations",
|
||||||
'location_code' => $city,
|
array(
|
||||||
'tax_rate_id' => $tax_rate_id,
|
'location_code' => $city,
|
||||||
'location_type' => 'city',
|
'tax_rate_id' => $tax_rate_id,
|
||||||
)
|
'location_type' => 'city',
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$loop ++;
|
$loop ++;
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?php
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
||||||
?>
|
|
||||||
<div id="message" class="updated woocommerce-message wc-connect">
|
|
||||||
<div class="squeezer">
|
|
||||||
<h4><?php _e( '<strong>WooCommerce has been installed</strong> – You\'re ready to start selling :)', 'woocommerce' ); ?></h4>
|
|
||||||
|
|
||||||
<p class="submit"><a href="<?php echo admin_url('admin.php?page=woocommerce_settings'); ?>" class="button-primary"><?php _e( 'Settings', 'woocommerce' ); ?></a> <a class="docs button-primary" href="http://www.woothemes.com/woocommerce-docs/"><?php _e( 'Docs', 'woocommerce' ); ?></a></p>
|
|
||||||
|
|
||||||
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully." data-via="WooThemes" data-size="large" data-hashtags="WooCommerce">Tweet</a>
|
|
||||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
?>
|
||||||
|
<div id="message" class="updated woocommerce-message wc-connect">
|
||||||
|
<div class="squeezer">
|
||||||
|
<h4><?php _e( '<strong>Your theme does not declare WooCommerce support</strong> – if you encounter layout issues please read our integration guide or choose a WooCommerce theme :)', 'woocommerce' ); ?></h4>
|
||||||
|
<p class="submit"><a href="http://docs.woothemes.com/document/third-party-custom-theme-compatibility/" class="button-primary"><?php _e( 'Theme Integration Guide', 'woocommerce' ); ?></a> <a class="skip button-primary" href="<?php echo add_query_arg( 'hide_woocommerce_theme_support_check', 'true' ); ?>"><?php _e( 'Hide this notice', 'woocommerce' ); ?></a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -1,13 +0,0 @@
|
||||||
<?php
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
||||||
?>
|
|
||||||
<div id="message" class="updated woocommerce-message wc-connect">
|
|
||||||
<div class="squeezer">
|
|
||||||
<h4><?php _e( '<strong>WooCommerce has been updated</strong> – You\'re ready to continue selling :)', 'woocommerce' ); ?></h4>
|
|
||||||
|
|
||||||
<p class="submit"><a href="<?php echo admin_url('admin.php?page=woocommerce_settings'); ?>" class="button-primary"><?php _e( 'Settings', 'woocommerce' ); ?></a> <a class="docs button-primary" href="http://www.woothemes.com/woocommerce-docs/"><?php _e( 'Docs', 'woocommerce' ); ?></a></p>
|
|
||||||
|
|
||||||
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully." data-via="WooThemes" data-size="large" data-hashtags="WooCommerce">Tweet</a>
|
|
||||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
global $wpdb, $woocommerce;
|
global $wpdb, $woocommerce;
|
||||||
|
|
||||||
// Upgrade old style files paths to support multiple file paths
|
// Upgrade old style files paths to support multiple file paths
|
||||||
$existing_file_paths = $wpdb->get_results( "SELECT * FROM {$wpdb->postmeta} WHERE meta_key = '_file_path'" );
|
$existing_file_paths = $wpdb->get_results( "SELECT * FROM {$wpdb->postmeta} WHERE meta_key = '_file_path' AND meta_value != '';" );
|
||||||
|
|
||||||
if ( $existing_file_paths ) {
|
if ( $existing_file_paths ) {
|
||||||
|
|
||||||
|
@ -22,8 +22,7 @@ if ( $existing_file_paths ) {
|
||||||
$old_file_path = trim( $existing_file_path->meta_value );
|
$old_file_path = trim( $existing_file_path->meta_value );
|
||||||
|
|
||||||
if ( ! empty( $old_file_path ) ) {
|
if ( ! empty( $old_file_path ) ) {
|
||||||
$file_paths = maybe_serialize( array( md5( $old_file_path ) => $old_file_path ) );
|
$file_paths = serialize( array( md5( $old_file_path ) => $old_file_path ) );
|
||||||
|
|
||||||
|
|
||||||
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_key = '_file_paths', meta_value = %s WHERE meta_id = %d", $file_paths, $existing_file_path->meta_id ) );
|
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_key = '_file_paths', meta_value = %s WHERE meta_id = %d", $file_paths, $existing_file_path->meta_id ) );
|
||||||
|
|
||||||
|
@ -176,6 +175,9 @@ update_option( 'woocommerce_local_tax_rates_backup', $local_tax_rates );
|
||||||
delete_option( 'woocommerce_tax_rates' );
|
delete_option( 'woocommerce_tax_rates' );
|
||||||
delete_option( 'woocommerce_local_tax_rates' );
|
delete_option( 'woocommerce_local_tax_rates' );
|
||||||
|
|
||||||
|
// Create lost password page
|
||||||
|
woocommerce_create_page( esc_sql( _x( 'lost-password', 'page_slug', 'woocommerce' ) ), 'woocommerce_lost_password_page_id', __( 'Lost Password', 'woocommerce' ), '[woocommerce_lost_password]', woocommerce_get_page_id( 'myaccount' ) );
|
||||||
|
|
||||||
|
|
||||||
// Now its time for the massive update to line items - move them to the new DB tables
|
// Now its time for the massive update to line items - move them to the new DB tables
|
||||||
// Reverse with UPDATE `wpwc_postmeta` SET meta_key = '_order_items' WHERE meta_key = '_order_items_old'
|
// Reverse with UPDATE `wpwc_postmeta` SET meta_key = '_order_items' WHERE meta_key = '_order_items_old'
|
||||||
|
@ -293,4 +295,24 @@ foreach ( $order_tax_rows as $order_tax_row ) {
|
||||||
unset( $tax_amount );
|
unset( $tax_amount );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Grab the pre 2.0 Image options and use to populate the new image options settings,
|
||||||
|
// cleaning up afterwards like nice people do
|
||||||
|
|
||||||
|
foreach ( array( 'catalog', 'single', 'thumbnail' ) as $value ) {
|
||||||
|
|
||||||
|
$old_settings = array_filter( array(
|
||||||
|
'width' => get_option( 'woocommerce_' . $value . '_image_width' ),
|
||||||
|
'height' => get_option( 'woocommerce_' . $value . '_image_height' ),
|
||||||
|
'crop' => get_option( 'woocommerce_' . $value . '_image_crop' )
|
||||||
|
) );
|
||||||
|
|
||||||
|
if ( ! empty( $old_settings ) && update_option( 'shop_' . $value . '_image_size', $old_settings ) ){
|
||||||
|
|
||||||
|
delete_option( 'woocommerce_' . $value . '_image_width' );
|
||||||
|
delete_option( 'woocommerce_' . $value . '_image_height' );
|
||||||
|
delete_option( 'woocommerce_' . $value . '_image_crop' );
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,432 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Welcome Page Class
|
||||||
|
*
|
||||||
|
* Shows a feature overview for the new version (major) and credits.
|
||||||
|
*
|
||||||
|
* Adapted from code in EDD (Copyright (c) 2012, Pippin Williamson) and WP.
|
||||||
|
*
|
||||||
|
* @author WooThemes
|
||||||
|
* @category Admin
|
||||||
|
* @package WooCommerce/Admin
|
||||||
|
* @version 2.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WC_Welcome_Page class.
|
||||||
|
*
|
||||||
|
* @since 2.0
|
||||||
|
*/
|
||||||
|
class WC_Welcome_Page {
|
||||||
|
|
||||||
|
private $plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __construct function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
$this->plugin = 'woocommerce/woocommerce.php';
|
||||||
|
|
||||||
|
add_action( 'admin_menu', array( $this, 'admin_menus') );
|
||||||
|
add_action( 'admin_head', array( $this, 'admin_head' ) );
|
||||||
|
add_action( 'admin_init', array( $this, 'welcome' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add admin menus/screens
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function admin_menus() {
|
||||||
|
|
||||||
|
$welcome_page_title = __( 'Welcome to WooCommerce', 'woocommerce' );
|
||||||
|
|
||||||
|
// About
|
||||||
|
$about = add_dashboard_page( $welcome_page_title, $welcome_page_title, 'manage_options', 'wc-about', array( $this, 'about_screen' ) );
|
||||||
|
|
||||||
|
// Credits
|
||||||
|
$credits = add_dashboard_page( $welcome_page_title, $welcome_page_title, 'manage_options', 'wc-credits', array( $this, 'credits_screen' ) );
|
||||||
|
|
||||||
|
add_action( 'admin_print_styles-'. $about, array( $this, 'admin_css' ) );
|
||||||
|
add_action( 'admin_print_styles-'. $credits, array( $this, 'admin_css' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* admin_css function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function admin_css() {
|
||||||
|
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/activation.css', dirname( dirname( __FILE__ ) ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add styles just for this page, and remove dashboard page links.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function admin_head() {
|
||||||
|
global $woocommerce;
|
||||||
|
|
||||||
|
remove_submenu_page( 'index.php', 'wc-about' );
|
||||||
|
remove_submenu_page( 'index.php', 'wc-credits' );
|
||||||
|
|
||||||
|
// Badge for welcome page
|
||||||
|
$badge_url = $woocommerce->plugin_url() . '/assets/images/welcome/wc-badge.png';
|
||||||
|
?>
|
||||||
|
<style type="text/css">
|
||||||
|
/*<![CDATA[*/
|
||||||
|
.wc-badge {
|
||||||
|
padding-top: 150px;
|
||||||
|
height: 52px;
|
||||||
|
width: 185px;
|
||||||
|
color: #9c5d90;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
|
||||||
|
margin: 0 -5px;
|
||||||
|
background: url('<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/wc-welcome.png'; ?>') no-repeat center center;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media
|
||||||
|
(-webkit-min-device-pixel-ratio: 2),
|
||||||
|
(min-resolution: 192dpi) {
|
||||||
|
.wc-badge {
|
||||||
|
background-image:url('<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/wc-welcome@2x.png'; ?>');
|
||||||
|
background-size: 173px 194px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.about-wrap .wc-badge {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
/*]]>*/
|
||||||
|
</style>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Into text/links shown on all about pages.
|
||||||
|
*
|
||||||
|
* @access private
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function intro() {
|
||||||
|
global $woocommerce;
|
||||||
|
|
||||||
|
// Flush after upgrades
|
||||||
|
if ( ! empty( $_GET['wc-updated'] ) || ! empty( $_GET['wc-installed'] ) )
|
||||||
|
flush_rewrite_rules();
|
||||||
|
|
||||||
|
// Drop minor version if 0
|
||||||
|
$major_version = substr( $woocommerce->version, 0, 3 );
|
||||||
|
?>
|
||||||
|
<h1><?php printf( __( 'Welcome to WooCommerce %s', 'woocommerce' ), $major_version ); ?></h1>
|
||||||
|
|
||||||
|
<div class="about-text woocommerce-about-text">
|
||||||
|
<?php
|
||||||
|
if ( ! empty( $_GET['wc-installed'] ) )
|
||||||
|
$message = __( 'Thanks, all done!', 'woocommerce' );
|
||||||
|
elseif ( ! empty( $_GET['wc-updated'] ) )
|
||||||
|
$message = __( 'Thank you for updating to the latest version!', 'woocommerce' );
|
||||||
|
else
|
||||||
|
$message = __( 'Thanks for installing!', 'woocommerce' );
|
||||||
|
|
||||||
|
printf( __( '%s WooCommerce %s is more powerful, stable, and secure than ever before. We hope you enjoy it.', 'woocommerce' ), $message, $major_version );
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="wc-badge"><?php printf( __( 'Version %s' ), $woocommerce->version ); ?></div>
|
||||||
|
|
||||||
|
<p class="woocommerce-actions">
|
||||||
|
<a href="<?php echo admin_url('admin.php?page=woocommerce_settings'); ?>" class="button button-primary"><?php _e( 'Settings', 'woocommerce' ); ?></a>
|
||||||
|
<a class="docs button button-primary" href="http://docs.woothemes.com/"><?php _e( 'Docs', 'woocommerce' ); ?></a>
|
||||||
|
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully." data-via="WooThemes" data-size="large" data-hashtags="WooCommerce">Tweet</a>
|
||||||
|
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2 class="nav-tab-wrapper">
|
||||||
|
<a class="nav-tab <?php if ( $_GET['page'] == 'wc-about' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wc-about' ), 'index.php' ) ) ); ?>">
|
||||||
|
<?php _e( "What's New", 'woocommerce' ); ?>
|
||||||
|
</a><a class="nav-tab <?php if ( $_GET['page'] == 'wc-credits' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wc-credits' ), 'index.php' ) ) ); ?>">
|
||||||
|
<?php _e( 'Credits', 'woocommerce' ); ?>
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the about screen.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function about_screen() {
|
||||||
|
global $woocommerce;
|
||||||
|
?>
|
||||||
|
<div class="wrap about-wrap">
|
||||||
|
|
||||||
|
<?php $this->intro(); ?>
|
||||||
|
|
||||||
|
<!--<div class="changelog point-releases"></div>-->
|
||||||
|
|
||||||
|
<div class="changelog">
|
||||||
|
|
||||||
|
<h3><?php _e( 'Security in mind', 'woocommerce' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="feature-section images-stagger-right">
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/badge-sucuri.png'; ?>" alt="Sucuri Safe Plugin" style="padding: 1em" />
|
||||||
|
<h4><?php _e( 'Sucuri Safe Plugin', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'You will be happy to learn that WooCommerce has been audited and certified by the Sucuri Security team. Whilst there is not much to be seen visually to understand the amount of work that went into this audit, rest assured that your website is powered by one of the most powerful and stable eCommerce plugins available.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3><?php _e( 'A Smoother Admin Experience', 'woocommerce' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="feature-section col three-col">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/product.png'; ?>" alt="Product panel screenshot" style="width: 99%; margin: 0 0 1em;" />
|
||||||
|
<h4><?php _e( 'New Product Panel', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'We have revised the product data panel making it cleaner, more streamlined, and more logical. Adding products is a breeze!', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/orders.png'; ?>" alt="Order panel screenshot" style="width: 99%; margin: 0 0 1em;" />
|
||||||
|
<h4><?php _e( 'Nicer Order Screens', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'Order pages have had a cleanup, with a more easily scannable interface. We particularly like the new status icons!', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="last-feature">
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/downloads.png'; ?>" alt="Download panel screenshot" style="width: 99%; margin: 0 0 1em;" />
|
||||||
|
<h4><?php _e( 'Multi-Download Support', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'Products can have multiple downloadable files - purchasers will get access to all the files added.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3><?php _e( 'Less Taxing Taxes', 'woocommerce' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="feature-section col two-col">
|
||||||
|
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/taxes.png'; ?>" alt="Tax Options" style="width:99%; margin: 0 0 1em 0;" />
|
||||||
|
<div>
|
||||||
|
<h4><?php _e( 'New Tax Input Panel', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'The tax input pages have been streamlined to make inputting taxes simpler - adding multiple taxes for a single jurisdiction is now much easier using the priority system. There is also CSV import/export support.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="last-feature">
|
||||||
|
<h4><?php _e( 'Improved Tax Options', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'As requested by some users, we now support taxing the billing address instead of shipping (optional), and we allow you to choose which tax class applies to shipping.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3><?php _e( 'Product Listing Improvements Customers Will Love', 'woocommerce' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="feature-section col three-col">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/sorting.png'; ?>" alt="Sorting" style="width: 99%; margin: 0 0 1em;" />
|
||||||
|
<h4><?php _e( 'New Sorting Options', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'Customers can now sort products by popularity and ratings.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/pagination.png'; ?>" alt="Pagination" style="width: 99%; margin: 0 0 1em;" />
|
||||||
|
<h4><?php _e( 'Better Pagination and Result Counts', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'Numbered pagination has been added to core, and we show the number of results found above the listings.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="last-feature">
|
||||||
|
<img src="<?php echo $woocommerce->plugin_url() . '/assets/images/welcome/rating.png'; ?>" alt="Ratings" style="width: 99%; margin: 0 0 1em;" />
|
||||||
|
<h4><?php _e( 'Inline Star Rating Display', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'We have added star ratings to the catalog which are pulled from reviews.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="changelog">
|
||||||
|
<h3><?php _e( 'Under the Hood', 'woocommerce' ); ?></h3>
|
||||||
|
|
||||||
|
<div class="feature-section col three-col">
|
||||||
|
<div>
|
||||||
|
<h4><?php _e( 'New product classes', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'The product classes have been rewritten and are now factory based. Much more extendable, and easier to query products using the new <code>get_product()</code> function.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4><?php _e( 'Capability overhaul', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'More granular capabilities for admin/shop manager roles covering products, orders and coupons.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="last-feature">
|
||||||
|
<h4><?php _e( 'API Improvements', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( '<code>WC-API</code> now has real endpoints, and we\'ve optimised the gateways API significantly by only loading gateways when needed.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="feature-section col three-col">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4><?php _e( 'Cache-friendly cart widgets', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'Cart widgets and other "fragments" are now pulled in via AJAX - this works wonders with static page caching.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4><?php _e( 'Session handling', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'PHP SESSIONS have been a problem for many users in the past, so we\'ve developed our own handler using cookies and options to make these more reliable.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="last-feature">
|
||||||
|
<h4><?php _e( 'Retina Ready', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'All graphics within WC have been optimised for HiDPI displays.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="feature-section col three-col">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4><?php _e( 'Better stock handling', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'We have added an option to hold stock for unpaid orders (defaults to 60mins). When this time limit is reached, and the order is not paid for, stock is released and the order is cancelled.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h4><?php _e( 'Improved Line-item storage', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'We have changed how order items get stored making them easier (and faster) to access for reporting. Order items are no longer serialised within an order - they are stored within their own table.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="last-feature">
|
||||||
|
<h4><?php _e( 'Autoload', 'woocommerce' ); ?></h4>
|
||||||
|
<p><?php _e( 'We have setup autoloading for classes - this has dramatically reduced memory usage in 2.0.', 'woocommerce' ); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="return-to-dashboard">
|
||||||
|
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'woocommerce_settings' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to WooCommerce Settings', 'woocommerce' ); ?></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the credits.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function credits_screen() {
|
||||||
|
?>
|
||||||
|
<div class="wrap about-wrap">
|
||||||
|
|
||||||
|
<?php $this->intro(); ?>
|
||||||
|
|
||||||
|
<p class="about-description"><?php _e( 'WooCommerce is developed and maintained by a worldwide team of passionate individuals and backed by an awesome developer community. Want to see your name? <a href="https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md">Contribute to WooCommerce</a>.', 'woocommerce' ); ?></p>
|
||||||
|
|
||||||
|
<?php echo $this->contributors(); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render Contributors List
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return string $contributor_list HTML formatted list of contributors.
|
||||||
|
*/
|
||||||
|
public function contributors() {
|
||||||
|
$contributors = $this->get_contributors();
|
||||||
|
|
||||||
|
if ( empty( $contributors ) )
|
||||||
|
return '';
|
||||||
|
|
||||||
|
$contributor_list = '<ul class="wp-people-group">';
|
||||||
|
|
||||||
|
foreach ( $contributors as $contributor ) {
|
||||||
|
$contributor_list .= '<li class="wp-person">';
|
||||||
|
$contributor_list .= sprintf( '<a href="%s" title="%s">',
|
||||||
|
esc_url( 'https://github.com/' . $contributor->login ),
|
||||||
|
esc_html( sprintf( __( 'View %s', 'woocommerce' ), $contributor->login ) )
|
||||||
|
);
|
||||||
|
$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
|
||||||
|
$contributor_list .= '</a>';
|
||||||
|
$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
|
||||||
|
$contributor_list .= '</a>';
|
||||||
|
$contributor_list .= '</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$contributor_list .= '</ul>';
|
||||||
|
|
||||||
|
return $contributor_list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retreive list of contributors from GitHub.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function get_contributors() {
|
||||||
|
$contributors = get_transient( 'woocommerce_contributors' );
|
||||||
|
|
||||||
|
if ( false !== $contributors )
|
||||||
|
return $contributors;
|
||||||
|
|
||||||
|
$response = wp_remote_get( 'https://api.github.com/repos/woothemes/woocommerce/contributors', array( 'sslverify' => false ) );
|
||||||
|
|
||||||
|
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
|
||||||
|
return array();
|
||||||
|
|
||||||
|
$contributors = json_decode( wp_remote_retrieve_body( $response ) );
|
||||||
|
|
||||||
|
if ( ! is_array( $contributors ) )
|
||||||
|
return array();
|
||||||
|
|
||||||
|
set_transient( 'woocommerce_contributors', $contributors, 3600 );
|
||||||
|
|
||||||
|
return $contributors;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends user to the welcome page on first activation
|
||||||
|
*/
|
||||||
|
public function welcome() {
|
||||||
|
|
||||||
|
// Bail if no activation redirect transient is set
|
||||||
|
if ( ! get_transient( '_wc_activation_redirect' ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Delete the redirect transient
|
||||||
|
delete_transient( '_wc_activation_redirect' );
|
||||||
|
|
||||||
|
// Bail if we are waiting to install or update via the interface update/install links
|
||||||
|
if ( get_option( '_wc_needs_update' ) == 1 || get_option( '_wc_needs_pages' ) == 1 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Bail if activating from network, or bulk, or within an iFrame
|
||||||
|
if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'woocommerce.php' ) ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
wp_safe_redirect( admin_url( 'index.php?page=wc-about' ) );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new WC_Welcome_Page();
|
|
@ -73,16 +73,17 @@ add_action( 'post_submitbox_start', 'woocommerce_duplicate_product_post_button'
|
||||||
* @param mixed $columns
|
* @param mixed $columns
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function woocommerce_edit_product_columns( $columns ) {
|
function woocommerce_edit_product_columns( $existing_columns ) {
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
|
|
||||||
if ( empty( $columns ) && ! is_array( $columns ) )
|
if ( empty( $existing_columns ) && ! is_array( $existing_columns ) )
|
||||||
$columns = array();
|
$existing_columns = array();
|
||||||
|
|
||||||
unset( $columns['title'], $columns['comments'], $columns['date'] );
|
unset( $existing_columns['title'], $existing_columns['comments'], $existing_columns['date'] );
|
||||||
|
|
||||||
|
$columns = array();
|
||||||
$columns["cb"] = "<input type=\"checkbox\" />";
|
$columns["cb"] = "<input type=\"checkbox\" />";
|
||||||
$columns["thumb"] = __( 'Image', 'woocommerce' );
|
$columns["thumb"] = '<img src="' . $woocommerce->plugin_url() . '/assets/images/image.png" alt="' . __( 'Image', 'woocommerce' ) . '" class="tips" data-tip="' . __( 'Image', 'woocommerce' ) . '" width="14" height="14" />';
|
||||||
|
|
||||||
$columns["name"] = __( 'Name', 'woocommerce' );
|
$columns["name"] = __( 'Name', 'woocommerce' );
|
||||||
|
|
||||||
|
@ -100,10 +101,10 @@ function woocommerce_edit_product_columns( $columns ) {
|
||||||
$columns["product_type"] = '<img src="' . $woocommerce->plugin_url() . '/assets/images/product_type_head.png" alt="' . __( 'Type', 'woocommerce' ) . '" class="tips" data-tip="' . __( 'Type', 'woocommerce' ) . '" width="14" height="12" />';
|
$columns["product_type"] = '<img src="' . $woocommerce->plugin_url() . '/assets/images/product_type_head.png" alt="' . __( 'Type', 'woocommerce' ) . '" class="tips" data-tip="' . __( 'Type', 'woocommerce' ) . '" width="14" height="12" />';
|
||||||
$columns["date"] = __( 'Date', 'woocommerce' );
|
$columns["date"] = __( 'Date', 'woocommerce' );
|
||||||
|
|
||||||
return $columns;
|
return array_merge( $columns, $existing_columns );
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter('manage_edit-product_columns', 'woocommerce_edit_product_columns');
|
add_filter( 'manage_edit-product_columns', 'woocommerce_edit_product_columns' );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,12 +115,14 @@ add_filter('manage_edit-product_columns', 'woocommerce_edit_product_columns');
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocommerce_custom_product_columns( $column ) {
|
function woocommerce_custom_product_columns( $column ) {
|
||||||
global $post, $woocommerce;
|
global $post, $woocommerce, $the_product;
|
||||||
$product = get_product($post);
|
|
||||||
|
if ( empty( $the_product ) || $the_product->id != $post->ID )
|
||||||
|
$the_product = get_product( $post );
|
||||||
|
|
||||||
switch ($column) {
|
switch ($column) {
|
||||||
case "thumb" :
|
case "thumb" :
|
||||||
echo $product->get_image();
|
echo '<a href="' . get_edit_post_link( $post->ID ) . '">' . $the_product->get_image() . '</a>';
|
||||||
break;
|
break;
|
||||||
case "name" :
|
case "name" :
|
||||||
$edit_link = get_edit_post_link( $post->ID );
|
$edit_link = get_edit_post_link( $post->ID );
|
||||||
|
@ -145,24 +148,26 @@ function woocommerce_custom_product_columns( $column ) {
|
||||||
$actions['id'] = 'ID: ' . $post->ID;
|
$actions['id'] = 'ID: ' . $post->ID;
|
||||||
|
|
||||||
if ( $can_edit_post && 'trash' != $post->post_status ) {
|
if ( $can_edit_post && 'trash' != $post->post_status ) {
|
||||||
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline', 'woocommerce' ) ) . '">' . __( 'Quick Edit', 'woocommerce' ) . '</a>';
|
$actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
|
||||||
|
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>';
|
||||||
}
|
}
|
||||||
if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
|
if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
|
||||||
if ( 'trash' == $post->post_status )
|
if ( 'trash' == $post->post_status )
|
||||||
$actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash', 'woocommerce' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore', 'woocommerce' ) . "</a>";
|
$actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
|
||||||
elseif ( EMPTY_TRASH_DAYS )
|
elseif ( EMPTY_TRASH_DAYS )
|
||||||
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash', 'woocommerce' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash', 'woocommerce' ) . "</a>";
|
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
|
||||||
if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
|
if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
|
||||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently', 'woocommerce' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently', 'woocommerce' ) . "</a>";
|
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
|
||||||
}
|
}
|
||||||
if ( $post_type_object->public ) {
|
if ( $post_type_object->public ) {
|
||||||
if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) {
|
if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
|
||||||
if ( $can_edit_post )
|
if ( $can_edit_post )
|
||||||
$actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”', 'woocommerce' ), $title ) ) . '" rel="permalink">' . __( 'Preview', 'woocommerce' ) . '</a>';
|
$actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
|
||||||
} elseif ( 'trash' != $post->post_status ) {
|
} elseif ( 'trash' != $post->post_status ) {
|
||||||
$actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”', 'woocommerce' ), $title ) ) . '" rel="permalink">' . __( 'View', 'woocommerce' ) . '</a>';
|
$actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$actions = apply_filters( 'post_row_actions', $actions, $post );
|
$actions = apply_filters( 'post_row_actions', $actions, $post );
|
||||||
|
|
||||||
echo '<div class="row-actions">';
|
echo '<div class="row-actions">';
|
||||||
|
@ -183,51 +188,51 @@ function woocommerce_custom_product_columns( $column ) {
|
||||||
echo '
|
echo '
|
||||||
<div class="hidden" id="woocommerce_inline_' . $post->ID . '">
|
<div class="hidden" id="woocommerce_inline_' . $post->ID . '">
|
||||||
<div class="menu_order">' . $post->menu_order . '</div>
|
<div class="menu_order">' . $post->menu_order . '</div>
|
||||||
<div class="sku">' . $product->sku . '</div>
|
<div class="sku">' . $the_product->sku . '</div>
|
||||||
<div class="regular_price">' . $product->regular_price . '</div>
|
<div class="regular_price">' . $the_product->regular_price . '</div>
|
||||||
<div class="sale_price">' . $product->sale_price . '</div>
|
<div class="sale_price">' . $the_product->sale_price . '</div>
|
||||||
<div class="weight">' . $product->weight . '</div>
|
<div class="weight">' . $the_product->weight . '</div>
|
||||||
<div class="length">' . $product->length . '</div>
|
<div class="length">' . $the_product->length . '</div>
|
||||||
<div class="width">' . $product->width . '</div>
|
<div class="width">' . $the_product->width . '</div>
|
||||||
<div class="height">' . $product->height . '</div>
|
<div class="height">' . $the_product->height . '</div>
|
||||||
<div class="visibility">' . $product->visibility . '</div>
|
<div class="visibility">' . $the_product->visibility . '</div>
|
||||||
<div class="stock_status">' . $product->stock_status . '</div>
|
<div class="stock_status">' . $the_product->stock_status . '</div>
|
||||||
<div class="stock">' . $product->stock . '</div>
|
<div class="stock">' . $the_product->stock . '</div>
|
||||||
<div class="manage_stock">' . $product->manage_stock . '</div>
|
<div class="manage_stock">' . $the_product->manage_stock . '</div>
|
||||||
<div class="featured">' . $product->featured . '</div>
|
<div class="featured">' . $the_product->featured . '</div>
|
||||||
<div class="product_type">' . $product->product_type . '</div>
|
<div class="product_type">' . $the_product->product_type . '</div>
|
||||||
<div class="product_is_virtual">' . $product->virtual . '</div>
|
<div class="product_is_virtual">' . $the_product->virtual . '</div>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "sku" :
|
case "sku" :
|
||||||
if ($product->get_sku()) echo $product->get_sku(); else echo '<span class="na">–</span>';
|
if ($the_product->get_sku()) echo $the_product->get_sku(); else echo '<span class="na">–</span>';
|
||||||
break;
|
break;
|
||||||
case "product_type" :
|
case "product_type" :
|
||||||
if( $product->product_type == 'grouped' ):
|
if( $the_product->product_type == 'grouped' ):
|
||||||
echo '<span class="product-type tips '.$product->product_type.'" data-tip="' . __( 'Grouped', 'woocommerce' ) . '"></span>';
|
echo '<span class="product-type tips '.$the_product->product_type.'" data-tip="' . __( 'Grouped', 'woocommerce' ) . '"></span>';
|
||||||
elseif ( $product->product_type == 'external' ):
|
elseif ( $the_product->product_type == 'external' ):
|
||||||
echo '<span class="product-type tips '.$product->product_type.'" data-tip="' . __( 'External/Affiliate', 'woocommerce' ) . '"></span>';
|
echo '<span class="product-type tips '.$the_product->product_type.'" data-tip="' . __( 'External/Affiliate', 'woocommerce' ) . '"></span>';
|
||||||
elseif ( $product->product_type == 'simple' ):
|
elseif ( $the_product->product_type == 'simple' ):
|
||||||
|
|
||||||
if ($product->is_virtual()) {
|
if ($the_product->is_virtual()) {
|
||||||
echo '<span class="product-type tips virtual" data-tip="' . __( 'Virtual', 'woocommerce' ) . '"></span>';
|
echo '<span class="product-type tips virtual" data-tip="' . __( 'Virtual', 'woocommerce' ) . '"></span>';
|
||||||
} elseif ($product->is_downloadable()) {
|
} elseif ($the_product->is_downloadable()) {
|
||||||
echo '<span class="product-type tips downloadable" data-tip="' . __( 'Downloadable', 'woocommerce' ) . '"></span>';
|
echo '<span class="product-type tips downloadable" data-tip="' . __( 'Downloadable', 'woocommerce' ) . '"></span>';
|
||||||
} else {
|
} else {
|
||||||
echo '<span class="product-type tips '.$product->product_type.'" data-tip="' . __( 'Simple', 'woocommerce' ) . '"></span>';
|
echo '<span class="product-type tips '.$the_product->product_type.'" data-tip="' . __( 'Simple', 'woocommerce' ) . '"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ( $product->product_type == 'variable' ):
|
elseif ( $the_product->product_type == 'variable' ):
|
||||||
echo '<span class="product-type tips '.$product->product_type.'" data-tip="' . __( 'Variable', 'woocommerce' ) . '"></span>';
|
echo '<span class="product-type tips '.$the_product->product_type.'" data-tip="' . __( 'Variable', 'woocommerce' ) . '"></span>';
|
||||||
else:
|
else:
|
||||||
// Assuming that we have other types in future
|
// Assuming that we have other types in future
|
||||||
echo '<span class="product-type tips '.$product->product_type.'" data-tip="' . ucwords($product->product_type) . '"></span>';
|
echo '<span class="product-type tips '.$the_product->product_type.'" data-tip="' . ucwords($the_product->product_type) . '"></span>';
|
||||||
endif;
|
endif;
|
||||||
break;
|
break;
|
||||||
case "price":
|
case "price":
|
||||||
if ($product->get_price_html()) echo $product->get_price_html(); else echo '<span class="na">–</span>';
|
if ($the_product->get_price_html()) echo $the_product->get_price_html(); else echo '<span class="na">–</span>';
|
||||||
break;
|
break;
|
||||||
case "product_cat" :
|
case "product_cat" :
|
||||||
case "product_tag" :
|
case "product_tag" :
|
||||||
|
@ -241,23 +246,26 @@ function woocommerce_custom_product_columns( $column ) {
|
||||||
echo implode( ', ', $termlist );
|
echo implode( ', ', $termlist );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "featured" :
|
case 'featured':
|
||||||
$url = wp_nonce_url( admin_url('admin-ajax.php?action=woocommerce-feature-product&product_id=' . $post->ID), 'woocommerce-feature-product' );
|
$url = wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-feature-product&product_id=' . $post->ID ), 'woocommerce-feature-product' );
|
||||||
echo '<a href="'.$url.'" title="'.__( 'Change', 'woocommerce' ) .'">';
|
echo '<a href="' . $url . '" title="'. __( 'Toggle featured', 'woocommerce' ) . '">';
|
||||||
if ($product->is_featured()) echo '<a href="'.$url.'"><img src="'.$woocommerce->plugin_url().'/assets/images/featured.png" alt="yes" height="14" width="14" />';
|
if ( $the_product->is_featured() ) {
|
||||||
else echo '<img src="'.$woocommerce->plugin_url().'/assets/images/featured-off.png" alt="no" height="14" width="14" />';
|
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/featured.png" alt="'. __( 'yes', 'woocommerce' ) . '" height="14" width="14" />';
|
||||||
|
} else {
|
||||||
|
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/featured-off.png" alt="'. __( 'no', 'woocommerce' ) . '" height="14" width="14" />';
|
||||||
|
}
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
break;
|
break;
|
||||||
case "is_in_stock" :
|
case "is_in_stock" :
|
||||||
|
|
||||||
if ($product->is_in_stock()) {
|
if ($the_product->is_in_stock()) {
|
||||||
echo '<mark class="instock">' . __( 'In stock', 'woocommerce' ) . '</mark>';
|
echo '<mark class="instock">' . __( 'In stock', 'woocommerce' ) . '</mark>';
|
||||||
} else {
|
} else {
|
||||||
echo '<mark class="outofstock">' . __( 'Out of stock', 'woocommerce' ) . '</mark>';
|
echo '<mark class="outofstock">' . __( 'Out of stock', 'woocommerce' ) . '</mark>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $product->managing_stock() ) :
|
if ( $the_product->managing_stock() ) :
|
||||||
echo ' × ' . $product->get_total_stock();
|
echo ' × ' . $the_product->get_total_stock();
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -283,7 +291,6 @@ add_action('manage_product_posts_custom_column', 'woocommerce_custom_product_col
|
||||||
*/
|
*/
|
||||||
function woocommerce_custom_product_sort($columns) {
|
function woocommerce_custom_product_sort($columns) {
|
||||||
$custom = array(
|
$custom = array(
|
||||||
'is_in_stock' => 'inventory',
|
|
||||||
'price' => 'price',
|
'price' => 'price',
|
||||||
'featured' => 'featured',
|
'featured' => 'featured',
|
||||||
'sku' => 'sku',
|
'sku' => 'sku',
|
||||||
|
@ -306,12 +313,6 @@ add_filter( 'manage_edit-product_sortable_columns', 'woocommerce_custom_product_
|
||||||
*/
|
*/
|
||||||
function woocommerce_custom_product_orderby( $vars ) {
|
function woocommerce_custom_product_orderby( $vars ) {
|
||||||
if (isset( $vars['orderby'] )) :
|
if (isset( $vars['orderby'] )) :
|
||||||
if ( 'inventory' == $vars['orderby'] ) :
|
|
||||||
$vars = array_merge( $vars, array(
|
|
||||||
'meta_key' => '_stock',
|
|
||||||
'orderby' => 'meta_value_num'
|
|
||||||
) );
|
|
||||||
endif;
|
|
||||||
if ( 'price' == $vars['orderby'] ) :
|
if ( 'price' == $vars['orderby'] ) :
|
||||||
$vars = array_merge( $vars, array(
|
$vars = array_merge( $vars, array(
|
||||||
'meta_key' => '_price',
|
'meta_key' => '_price',
|
||||||
|
@ -371,7 +372,7 @@ function woocommerce_products_by_type() {
|
||||||
$output = "<select name='product_type' id='dropdown_product_type'>";
|
$output = "<select name='product_type' id='dropdown_product_type'>";
|
||||||
$output .= '<option value="">'.__( 'Show all product types', 'woocommerce' ).'</option>';
|
$output .= '<option value="">'.__( 'Show all product types', 'woocommerce' ).'</option>';
|
||||||
foreach($terms as $term) :
|
foreach($terms as $term) :
|
||||||
$output .="<option value='$term->slug' ";
|
$output .="<option value='" . sanitize_title( $term->name ) . "' ";
|
||||||
if ( isset( $wp_query->query['product_type'] ) ) $output .=selected($term->slug, $wp_query->query['product_type'], false);
|
if ( isset( $wp_query->query['product_type'] ) ) $output .=selected($term->slug, $wp_query->query['product_type'], false);
|
||||||
$output .=">";
|
$output .=">";
|
||||||
|
|
||||||
|
@ -702,54 +703,54 @@ add_action( 'admin_enqueue_scripts', 'woocommerce_admin_product_quick_edit_scrip
|
||||||
*/
|
*/
|
||||||
function woocommerce_admin_product_quick_edit_save( $post_id, $post ) {
|
function woocommerce_admin_product_quick_edit_save( $post_id, $post ) {
|
||||||
|
|
||||||
if ( !$_POST ) return $post_id;
|
if ( ! $_POST || is_int( wp_is_post_revision( $post_id ) ) || is_int( wp_is_post_autosave( $post_id ) ) ) return $post_id;
|
||||||
if ( is_int( wp_is_post_revision( $post_id ) ) ) return;
|
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return $post_id;
|
||||||
if( is_int( wp_is_post_autosave( $post_id ) ) ) return;
|
if ( ! isset( $_POST['woocommerce_quick_edit_nonce'] ) || ! wp_verify_nonce( $_POST['woocommerce_quick_edit_nonce'], 'woocommerce_quick_edit_nonce' ) ) return $post_id;
|
||||||
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id;
|
if ( ! current_user_can( 'edit_post', $post_id ) ) return $post_id;
|
||||||
if ( !isset($_POST['woocommerce_quick_edit_nonce']) || (isset($_POST['woocommerce_quick_edit_nonce']) && !wp_verify_nonce( $_POST['woocommerce_quick_edit_nonce'], 'woocommerce_quick_edit_nonce' ))) return $post_id;
|
|
||||||
if ( !current_user_can( 'edit_post', $post_id )) return $post_id;
|
|
||||||
if ( $post->post_type != 'product' ) return $post_id;
|
if ( $post->post_type != 'product' ) return $post_id;
|
||||||
|
|
||||||
global $woocommerce, $wpdb;
|
global $woocommerce, $wpdb;
|
||||||
|
|
||||||
$product = get_product( $post );
|
$product = get_product( $post );
|
||||||
|
$old_regular_price = $product->regular_price;
|
||||||
|
$old_sale_price = $product->sale_price;
|
||||||
|
|
||||||
// Save fields
|
// Save fields
|
||||||
if(isset($_POST['_sku'])) update_post_meta($post_id, '_sku', esc_html(stripslashes($_POST['_sku'])));
|
if ( isset( $_POST['_sku'] ) ) update_post_meta( $post_id, '_sku', woocommerce_clean( $_POST['_sku'] ) );
|
||||||
if(isset($_POST['_weight'])) update_post_meta($post_id, '_weight', esc_html(stripslashes($_POST['_weight'])));
|
if ( isset( $_POST['_weight'] ) ) update_post_meta( $post_id, '_weight', woocommerce_clean( $_POST['_weight'] ) );
|
||||||
if(isset($_POST['_length'])) update_post_meta($post_id, '_length', esc_html(stripslashes($_POST['_length'])));
|
if ( isset( $_POST['_length'] ) ) update_post_meta( $post_id, '_length', woocommerce_clean( $_POST['_length'] ) );
|
||||||
if(isset($_POST['_width'])) update_post_meta($post_id, '_width', esc_html(stripslashes($_POST['_width'])));
|
if ( isset( $_POST['_width'] ) ) update_post_meta( $post_id, '_width', woocommerce_clean( $_POST['_width'] ) );
|
||||||
if(isset($_POST['_height'])) update_post_meta($post_id, '_height', esc_html(stripslashes($_POST['_height'])));
|
if ( isset( $_POST['_height'] ) ) update_post_meta( $post_id, '_height', woocommerce_clean( $_POST['_height'] ) );
|
||||||
if(isset($_POST['_stock_status'])) update_post_meta( $post_id, '_stock_status', stripslashes( $_POST['_stock_status'] ) );
|
if ( isset( $_POST['_stock_status'] ) ) update_post_meta( $post_id, '_stock_status', woocommerce_clean( $_POST['_stock_status'] ) );
|
||||||
if(isset($_POST['_visibility'])) update_post_meta( $post_id, '_visibility', stripslashes( $_POST['_visibility'] ) );
|
if ( isset( $_POST['_visibility'] ) ) update_post_meta( $post_id, '_visibility', woocommerce_clean( $_POST['_visibility'] ) );
|
||||||
if(isset($_POST['_featured'])) update_post_meta( $post_id, '_featured', 'yes' ); else update_post_meta( $post_id, '_featured', 'no' );
|
if ( isset( $_POST['_featured'] ) ) update_post_meta( $post_id, '_featured', 'yes' ); else update_post_meta( $post_id, '_featured', 'no' );
|
||||||
|
|
||||||
if ($product->is_type('simple') || $product->is_type('external')) {
|
if ( $product->is_type('simple') || $product->is_type('external') ) {
|
||||||
|
|
||||||
if(isset($_POST['_regular_price'])) update_post_meta( $post_id, '_regular_price', stripslashes( $_POST['_regular_price'] ) );
|
if ( isset( $_POST['_regular_price'] ) ) update_post_meta( $post_id, '_regular_price', woocommerce_clean( $_POST['_regular_price'] ) );
|
||||||
if(isset($_POST['_sale_price'])) update_post_meta( $post_id, '_sale_price', stripslashes( $_POST['_sale_price'] ) );
|
if ( isset( $_POST['_sale_price'] ) ) update_post_meta( $post_id, '_sale_price', woocommerce_clean( $_POST['_sale_price'] ) );
|
||||||
|
|
||||||
// Handle price - remove dates and set to lowest
|
// Handle price - remove dates and set to lowest
|
||||||
$price_changed = false;
|
$price_changed = false;
|
||||||
|
|
||||||
if(isset($_POST['_regular_price']) && stripslashes( $_POST['_regular_price'] )!=$product->regular_price) $price_changed = true;
|
if ( isset( $_POST['_regular_price'] ) && woocommerce_clean( $_POST['_regular_price'] ) != $old_regular_price ) $price_changed = true;
|
||||||
if(isset($_POST['_sale_price']) && stripslashes( $_POST['_sale_price'] )!=$product->sale_price) $price_changed = true;
|
if ( isset( $_POST['_sale_price'] ) && woocommerce_clean( $_POST['_sale_price'] ) != $old_sale_price ) $price_changed = true;
|
||||||
|
|
||||||
if ($price_changed) {
|
if ( $price_changed ) {
|
||||||
update_post_meta( $post_id, '_sale_price_dates_from', '');
|
update_post_meta( $post_id, '_sale_price_dates_from', '' );
|
||||||
update_post_meta( $post_id, '_sale_price_dates_to', '');
|
update_post_meta( $post_id, '_sale_price_dates_to', '' );
|
||||||
|
|
||||||
if ($_POST['_sale_price'] != '') {
|
if ( isset( $_POST['_sale_price'] ) && $_POST['_sale_price'] != '' ) {
|
||||||
update_post_meta( $post_id, '_price', stripslashes($_POST['_sale_price']) );
|
update_post_meta( $post_id, '_price', woocommerce_clean( $_POST['_sale_price'] ) );
|
||||||
} else {
|
} else {
|
||||||
update_post_meta( $post_id, '_price', stripslashes($_POST['_regular_price']) );
|
update_post_meta( $post_id, '_price', woocommerce_clean( $_POST['_regular_price'] ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle stock
|
// Handle stock
|
||||||
if (!$product->is_type('grouped')) {
|
if ( ! $product->is_type('grouped') ) {
|
||||||
if (isset($_POST['_manage_stock'])) {
|
if ( isset( $_POST['_manage_stock'] ) ) {
|
||||||
update_post_meta( $post_id, '_manage_stock', 'yes' );
|
update_post_meta( $post_id, '_manage_stock', 'yes' );
|
||||||
update_post_meta( $post_id, '_stock', (int) $_POST['_stock'] );
|
update_post_meta( $post_id, '_stock', (int) $_POST['_stock'] );
|
||||||
} else {
|
} else {
|
||||||
|
@ -1003,7 +1004,9 @@ function woocommerce_admin_product_bulk_edit_save( $post_id, $post ) {
|
||||||
|
|
||||||
global $woocommerce, $wpdb;
|
global $woocommerce, $wpdb;
|
||||||
|
|
||||||
$product = get_product( $post );
|
$product = get_product( $post );
|
||||||
|
$old_regular_price = $product->regular_price;
|
||||||
|
$old_sale_price = $product->sale_price;
|
||||||
|
|
||||||
// Save fields
|
// Save fields
|
||||||
if ( ! empty( $_REQUEST['change_weight'] ) && isset( $_REQUEST['_weight'] ) )
|
if ( ! empty( $_REQUEST['change_weight'] ) && isset( $_REQUEST['_weight'] ) )
|
||||||
|
@ -1034,7 +1037,6 @@ function woocommerce_admin_product_bulk_edit_save( $post_id, $post ) {
|
||||||
|
|
||||||
if ( ! empty( $_REQUEST['change_regular_price'] ) ) {
|
if ( ! empty( $_REQUEST['change_regular_price'] ) ) {
|
||||||
|
|
||||||
$old_price = $product->regular_price;
|
|
||||||
$change_regular_price = absint( $_REQUEST['change_regular_price'] );
|
$change_regular_price = absint( $_REQUEST['change_regular_price'] );
|
||||||
$regular_price = esc_attr( stripslashes( $_REQUEST['_regular_price'] ) );
|
$regular_price = esc_attr( stripslashes( $_REQUEST['_regular_price'] ) );
|
||||||
|
|
||||||
|
@ -1045,22 +1047,22 @@ function woocommerce_admin_product_bulk_edit_save( $post_id, $post ) {
|
||||||
case 2 :
|
case 2 :
|
||||||
if ( strstr( $regular_price, '%' ) ) {
|
if ( strstr( $regular_price, '%' ) ) {
|
||||||
$percent = str_replace( '%', '', $regular_price ) / 100;
|
$percent = str_replace( '%', '', $regular_price ) / 100;
|
||||||
$new_price = $old_price + ( $old_price * $percent );
|
$new_price = $old_regular_price + ( $old_regular_price * $percent );
|
||||||
} else {
|
} else {
|
||||||
$new_price = $old_price + $regular_price;
|
$new_price = $old_regular_price + $regular_price;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3 :
|
case 3 :
|
||||||
if ( strstr( $regular_price, '%' ) ) {
|
if ( strstr( $regular_price, '%' ) ) {
|
||||||
$percent = str_replace( '%', '', $regular_price ) / 100;
|
$percent = str_replace( '%', '', $regular_price ) / 100;
|
||||||
$new_price = $old_price - ( $old_price * $percent );
|
$new_price = $old_regular_price - ( $old_regular_price * $percent );
|
||||||
} else {
|
} else {
|
||||||
$new_price = $old_price - $regular_price;
|
$new_price = $old_regular_price - $regular_price;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $new_price ) && $new_price != $product->regular_price ) {
|
if ( isset( $new_price ) && $new_price != $old_regular_price ) {
|
||||||
$price_changed = true;
|
$price_changed = true;
|
||||||
update_post_meta( $post_id, '_regular_price', $new_price );
|
update_post_meta( $post_id, '_regular_price', $new_price );
|
||||||
$product->regular_price = $new_price;
|
$product->regular_price = $new_price;
|
||||||
|
@ -1069,7 +1071,6 @@ function woocommerce_admin_product_bulk_edit_save( $post_id, $post ) {
|
||||||
|
|
||||||
if ( ! empty( $_REQUEST['change_sale_price'] ) ) {
|
if ( ! empty( $_REQUEST['change_sale_price'] ) ) {
|
||||||
|
|
||||||
$old_price = $product->sale_price;
|
|
||||||
$change_sale_price = absint( $_REQUEST['change_sale_price'] );
|
$change_sale_price = absint( $_REQUEST['change_sale_price'] );
|
||||||
$sale_price = esc_attr( stripslashes( $_REQUEST['_sale_price'] ) );
|
$sale_price = esc_attr( stripslashes( $_REQUEST['_sale_price'] ) );
|
||||||
|
|
||||||
|
@ -1080,17 +1081,17 @@ function woocommerce_admin_product_bulk_edit_save( $post_id, $post ) {
|
||||||
case 2 :
|
case 2 :
|
||||||
if ( strstr( $sale_price, '%' ) ) {
|
if ( strstr( $sale_price, '%' ) ) {
|
||||||
$percent = str_replace( '%', '', $sale_price ) / 100;
|
$percent = str_replace( '%', '', $sale_price ) / 100;
|
||||||
$new_price = $old_price + ( $old_price * $percent );
|
$new_price = $old_sale_price + ( $old_sale_price * $percent );
|
||||||
} else {
|
} else {
|
||||||
$new_price = $old_price + $sale_price;
|
$new_price = $old_sale_price + $sale_price;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3 :
|
case 3 :
|
||||||
if ( strstr( $sale_price, '%' ) ) {
|
if ( strstr( $sale_price, '%' ) ) {
|
||||||
$percent = str_replace( '%', '', $sale_price ) / 100;
|
$percent = str_replace( '%', '', $sale_price ) / 100;
|
||||||
$new_price = $old_price - ( $old_price * $percent );
|
$new_price = $old_sale_price - ( $old_sale_price * $percent );
|
||||||
} else {
|
} else {
|
||||||
$new_price = $old_price - $sale_price;
|
$new_price = $old_sale_price - $sale_price;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4 :
|
case 4 :
|
||||||
|
@ -1103,7 +1104,7 @@ function woocommerce_admin_product_bulk_edit_save( $post_id, $post ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $new_price ) && $new_price != $product->sale_price ) {
|
if ( isset( $new_price ) && $new_price != $old_sale_price ) {
|
||||||
$price_changed = true;
|
$price_changed = true;
|
||||||
update_post_meta( $post_id, '_sale_price', $new_price );
|
update_post_meta( $post_id, '_sale_price', $new_price );
|
||||||
$product->sale_price = $new_price;
|
$product->sale_price = $new_price;
|
||||||
|
@ -1197,3 +1198,24 @@ function woocommerce_disable_checked_ontop( $args ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter( 'wp_terms_checklist_args', 'woocommerce_disable_checked_ontop' );
|
add_filter( 'wp_terms_checklist_args', 'woocommerce_disable_checked_ontop' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change label for insert buttons.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param mixed $translation
|
||||||
|
* @param mixed $original
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function woocommerce_change_insert_into_post( $strings ) {
|
||||||
|
global $post_type;
|
||||||
|
|
||||||
|
if ( $post_type == 'product' ) {
|
||||||
|
$strings['insertIntoPost'] = __( 'Insert into product', 'woocommerce' );
|
||||||
|
$strings['uploadedToThisPost'] = __( 'Uploaded to this product', 'woocommerce' );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $strings;
|
||||||
|
}
|
||||||
|
|
||||||
|
add_filter( 'media_view_strings', 'woocommerce_change_insert_into_post' );
|
||||||
|
|
|
@ -62,11 +62,11 @@ function woocommerce_custom_coupon_columns( $column ) {
|
||||||
|
|
||||||
if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
|
if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
|
||||||
if ( 'trash' == $post->post_status )
|
if ( 'trash' == $post->post_status )
|
||||||
$actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash', 'woocommerce' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore', 'woocommerce' ) . "</a>";
|
$actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
|
||||||
elseif ( EMPTY_TRASH_DAYS )
|
elseif ( EMPTY_TRASH_DAYS )
|
||||||
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash', 'woocommerce' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash', 'woocommerce' ) . "</a>";
|
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
|
||||||
if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
|
if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
|
||||||
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently', 'woocommerce' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently', 'woocommerce' ) . "</a>";
|
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$actions = apply_filters( 'post_row_actions', $actions, $post );
|
$actions = apply_filters( 'post_row_actions', $actions, $post );
|
||||||
|
|
|
@ -64,20 +64,21 @@ add_filter('manage_edit-shop_order_columns', 'woocommerce_edit_order_columns');
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocommerce_custom_order_columns( $column ) {
|
function woocommerce_custom_order_columns( $column ) {
|
||||||
|
global $post, $woocommerce, $the_order;
|
||||||
|
|
||||||
global $post, $woocommerce;
|
if ( empty( $the_order ) || $the_order->id != $post->ID )
|
||||||
$order = new WC_Order( $post->ID );
|
$the_order = new WC_Order( $post->ID );
|
||||||
|
|
||||||
switch ( $column ) {
|
switch ( $column ) {
|
||||||
case "order_status" :
|
case "order_status" :
|
||||||
|
|
||||||
printf( '<mark class="%s">%s</mark>', sanitize_title( $order->status ), esc_html__( $order->status, 'woocommerce' ) );
|
printf( '<mark class="%s tips" data-tip="%s">%s</mark>', sanitize_title( $the_order->status ), esc_html__( $the_order->status, 'woocommerce' ), esc_html__( $the_order->status, 'woocommerce' ) );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "order_title" :
|
case "order_title" :
|
||||||
|
|
||||||
if ( $order->user_id )
|
if ( $the_order->user_id )
|
||||||
$user_info = get_userdata( $order->user_id );
|
$user_info = get_userdata( $the_order->user_id );
|
||||||
|
|
||||||
if ( ! empty( $user_info ) ) {
|
if ( ! empty( $user_info ) ) {
|
||||||
|
|
||||||
|
@ -94,35 +95,35 @@ function woocommerce_custom_order_columns( $column ) {
|
||||||
$user = __( 'Guest', 'woocommerce' );
|
$user = __( 'Guest', 'woocommerce' );
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<a href="' . admin_url( 'post.php?post=' . absint( $post->ID ) . '&action=edit' ) . '"><strong>' . sprintf( __( 'Order %s', 'woocommerce' ), esc_attr( $order->get_order_number() ) ) . '</strong></a> ' . __( 'made by', 'woocommerce' ) . ' ' . $user;
|
echo '<a href="' . admin_url( 'post.php?post=' . absint( $post->ID ) . '&action=edit' ) . '"><strong>' . sprintf( __( 'Order %s', 'woocommerce' ), esc_attr( $the_order->get_order_number() ) ) . '</strong></a> ' . __( 'made by', 'woocommerce' ) . ' ' . $user;
|
||||||
|
|
||||||
if ( $order->billing_email )
|
if ( $the_order->billing_email )
|
||||||
echo '<small class="meta">' . __( 'Email:', 'woocommerce' ) . ' ' . '<a href="' . esc_url( 'mailto:' . $order->billing_email ) . '">' . esc_html( $order->billing_email ) . '</a></small>';
|
echo '<small class="meta">' . __( 'Email:', 'woocommerce' ) . ' ' . '<a href="' . esc_url( 'mailto:' . $the_order->billing_email ) . '">' . esc_html( $the_order->billing_email ) . '</a></small>';
|
||||||
|
|
||||||
if ( $order->billing_phone )
|
if ( $the_order->billing_phone )
|
||||||
echo '<small class="meta">' . __( 'Tel:', 'woocommerce' ) . ' ' . esc_html( $order->billing_phone ) . '</small>';
|
echo '<small class="meta">' . __( 'Tel:', 'woocommerce' ) . ' ' . esc_html( $the_order->billing_phone ) . '</small>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "billing_address" :
|
case "billing_address" :
|
||||||
if ( $order->get_formatted_billing_address() )
|
if ( $the_order->get_formatted_billing_address() )
|
||||||
echo '<a target="_blank" href="' . esc_url( 'http://maps.google.com/maps?&q=' . urlencode( $order->get_billing_address() ) . '&z=16' ) . '">' . esc_html( preg_replace( '#<br\s*/?>#i', ', ', $order->get_formatted_billing_address() ) ) .'</a>';
|
echo '<a target="_blank" href="' . esc_url( 'http://maps.google.com/maps?&q=' . urlencode( $the_order->get_billing_address() ) . '&z=16' ) . '">' . esc_html( preg_replace( '#<br\s*/?>#i', ', ', $the_order->get_formatted_billing_address() ) ) .'</a>';
|
||||||
else
|
else
|
||||||
echo '–';
|
echo '–';
|
||||||
|
|
||||||
if ( $order->payment_method_title )
|
if ( $the_order->payment_method_title )
|
||||||
echo '<small class="meta">' . __( 'Via', 'woocommerce' ) . ' ' . esc_html( $order->payment_method_title ) . '</small>';
|
echo '<small class="meta">' . __( 'Via', 'woocommerce' ) . ' ' . esc_html( $the_order->payment_method_title ) . '</small>';
|
||||||
break;
|
break;
|
||||||
case "shipping_address" :
|
case "shipping_address" :
|
||||||
if ( $order->get_formatted_shipping_address() )
|
if ( $the_order->get_formatted_shipping_address() )
|
||||||
echo '<a target="_blank" href="' . esc_url( 'http://maps.google.com/maps?&q=' . urlencode( $order->get_shipping_address() ) . '&z=16' ) . '">'. esc_html( preg_replace('#<br\s*/?>#i', ', ', $order->get_formatted_shipping_address() ) ) .'</a>';
|
echo '<a target="_blank" href="' . esc_url( 'http://maps.google.com/maps?&q=' . urlencode( $the_order->get_shipping_address() ) . '&z=16' ) . '">'. esc_html( preg_replace('#<br\s*/?>#i', ', ', $the_order->get_formatted_shipping_address() ) ) .'</a>';
|
||||||
else
|
else
|
||||||
echo '–';
|
echo '–';
|
||||||
|
|
||||||
if ( $order->shipping_method_title )
|
if ( $the_order->shipping_method_title )
|
||||||
echo '<small class="meta">' . __( 'Via', 'woocommerce' ) . ' ' . esc_html( $order->shipping_method_title ) . '</small>';
|
echo '<small class="meta">' . __( 'Via', 'woocommerce' ) . ' ' . esc_html( $the_order->shipping_method_title ) . '</small>';
|
||||||
break;
|
break;
|
||||||
case "total_cost" :
|
case "total_cost" :
|
||||||
echo esc_html( strip_tags( $order->get_formatted_order_total() ) );
|
echo esc_html( strip_tags( $the_order->get_formatted_order_total() ) );
|
||||||
break;
|
break;
|
||||||
case "order_date" :
|
case "order_date" :
|
||||||
|
|
||||||
|
@ -147,45 +148,45 @@ function woocommerce_custom_order_columns( $column ) {
|
||||||
|
|
||||||
?><p>
|
?><p>
|
||||||
<?php
|
<?php
|
||||||
do_action( 'woocommerce_admin_order_actions_start', $order );
|
do_action( 'woocommerce_admin_order_actions_start', $the_order );
|
||||||
|
|
||||||
$actions = array();
|
$actions = array();
|
||||||
|
|
||||||
if ( in_array( $order->status, array( 'pending', 'on-hold' ) ) )
|
if ( in_array( $the_order->status, array( 'pending', 'on-hold' ) ) )
|
||||||
$actions[] = array(
|
$actions['processing'] = array(
|
||||||
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-processing&order_id=' . $post->ID ), 'woocommerce-mark-order-processing' ),
|
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-processing&order_id=' . $post->ID ), 'woocommerce-mark-order-processing' ),
|
||||||
'name' => __( 'Processing', 'woocommerce' ),
|
'name' => __( 'Processing', 'woocommerce' ),
|
||||||
'action' => "processing"
|
'action' => "processing"
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( in_array( $order->status, array( 'pending', 'on-hold', 'processing' ) ) )
|
if ( in_array( $the_order->status, array( 'pending', 'on-hold', 'processing' ) ) )
|
||||||
$actions[] = array(
|
$actions['complete'] = array(
|
||||||
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-complete&order_id=' . $post->ID ), 'woocommerce-mark-order-complete' ),
|
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-complete&order_id=' . $post->ID ), 'woocommerce-mark-order-complete' ),
|
||||||
'name' => __( 'Complete', 'woocommerce' ),
|
'name' => __( 'Complete', 'woocommerce' ),
|
||||||
'action' => "complete"
|
'action' => "complete"
|
||||||
);
|
);
|
||||||
|
|
||||||
$actions[] = array(
|
$actions['view'] = array(
|
||||||
'url' => admin_url( 'post.php?post=' . $post->ID . '&action=edit' ),
|
'url' => admin_url( 'post.php?post=' . $post->ID . '&action=edit' ),
|
||||||
'name' => __( 'View', 'woocommerce' ),
|
'name' => __( 'View', 'woocommerce' ),
|
||||||
'action' => "view"
|
'action' => "view"
|
||||||
);
|
);
|
||||||
|
|
||||||
$actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $order );
|
$actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $the_order );
|
||||||
|
|
||||||
foreach ( $actions as $action ) {
|
foreach ( $actions as $action ) {
|
||||||
$image = ( isset( $action['image_url'] ) ) ? $action['image_url'] : $woocommerce->plugin_url() . '/assets/images/icons/' . $action['action'] . '.png';
|
$image = ( isset( $action['image_url'] ) ) ? $action['image_url'] : $woocommerce->plugin_url() . '/assets/images/icons/' . $action['action'] . '.png';
|
||||||
printf( '<a class="button tips" href="%s" data-tip="%s"><img src="%s" alt="%s" width="14" /></a>', esc_url( $action['url'] ), esc_attr( $action['name'] ), esc_attr( $image ), esc_attr( $action['name'] ) );
|
printf( '<a class="button tips" href="%s" data-tip="%s"><img src="%s" alt="%s" width="14" /></a>', esc_url( $action['url'] ), esc_attr( $action['name'] ), esc_attr( $image ), esc_attr( $action['name'] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action( 'woocommerce_admin_order_actions_end', $order );
|
do_action( 'woocommerce_admin_order_actions_end', $the_order );
|
||||||
?>
|
?>
|
||||||
</p><?php
|
</p><?php
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "note" :
|
case "note" :
|
||||||
|
|
||||||
if ( $order->customer_note )
|
if ( $the_order->customer_note )
|
||||||
echo '<img src="'.$woocommerce->plugin_url().'/assets/images/note.png" alt="yes" class="tips" data-tip="' . __( 'Yes', 'woocommerce' ) . '" width="14" height="14" />';
|
echo '<img src="'.$woocommerce->plugin_url().'/assets/images/note.png" alt="yes" class="tips" data-tip="' . __( 'Yes', 'woocommerce' ) . '" width="14" height="14" />';
|
||||||
else
|
else
|
||||||
echo '<img src="'.$woocommerce->plugin_url().'/assets/images/note-off.png" alt="no" class="tips" data-tip="' . __( 'No', 'woocommerce' ) . '" width="14" height="14" />';
|
echo '<img src="'.$woocommerce->plugin_url().'/assets/images/note-off.png" alt="no" class="tips" data-tip="' . __( 'No', 'woocommerce' ) . '" width="14" height="14" />';
|
||||||
|
@ -423,9 +424,8 @@ add_filter( 'request', 'woocommerce_custom_shop_order_orderby' );
|
||||||
function woocommerce_shop_order_search_custom_fields( $wp ) {
|
function woocommerce_shop_order_search_custom_fields( $wp ) {
|
||||||
global $pagenow, $wpdb;
|
global $pagenow, $wpdb;
|
||||||
|
|
||||||
if ( 'edit.php' != $pagenow ) return $wp;
|
if ( 'edit.php' != $pagenow || empty( $wp->query_vars['s'] ) || $wp->query_vars['post_type'] != 'shop_order' )
|
||||||
if ( ! isset( $wp->query_vars['s'] ) || ! $wp->query_vars['s'] ) return $wp;
|
return $wp;
|
||||||
if ( $wp->query_vars['post_type'] != 'shop_order' ) return $wp;
|
|
||||||
|
|
||||||
$search_fields = array_map( 'esc_attr', apply_filters( 'woocommerce_shop_order_search_fields', array(
|
$search_fields = array_map( 'esc_attr', apply_filters( 'woocommerce_shop_order_search_fields', array(
|
||||||
'_order_key',
|
'_order_key',
|
||||||
|
@ -442,42 +442,54 @@ function woocommerce_shop_order_search_custom_fields( $wp ) {
|
||||||
'_billing_phone'
|
'_billing_phone'
|
||||||
) ) );
|
) ) );
|
||||||
|
|
||||||
// Query matching custom fields - this seems faster than meta_query
|
|
||||||
$post_ids = $wpdb->get_col(
|
|
||||||
$wpdb->prepare(
|
|
||||||
"SELECT post_id FROM " . $wpdb->postmeta . " WHERE meta_key IN ('" . implode( "','", $search_fields ) . "') AND meta_value LIKE '%%%s%%'", esc_attr( $_GET['s'] )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Query matching excerpts and titles
|
|
||||||
$post_ids = array_merge( $post_ids, $wpdb->get_col( $wpdb->prepare('
|
|
||||||
SELECT ' . $wpdb->posts . '.ID
|
|
||||||
FROM ' . $wpdb->posts . '
|
|
||||||
LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id
|
|
||||||
LEFT JOIN ' . $wpdb->users . ' ON ' . $wpdb->postmeta . '.meta_value = ' . $wpdb->users . '.ID
|
|
||||||
WHERE
|
|
||||||
post_excerpt LIKE "%%%1$s%%" OR
|
|
||||||
post_title LIKE "%%%1$s%%" OR
|
|
||||||
(
|
|
||||||
meta_key = "_customer_user" AND
|
|
||||||
(
|
|
||||||
user_login LIKE "%%%1$s%%" OR
|
|
||||||
user_nicename LIKE "%%%1$s%%" OR
|
|
||||||
user_email LIKE "%%%1$s%%" OR
|
|
||||||
display_name LIKE "%%%1$s%%"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
',
|
|
||||||
esc_attr($_GET['s'])
|
|
||||||
) ) );
|
|
||||||
|
|
||||||
// Add ID
|
|
||||||
$search_order_id = str_replace( 'Order #', '', $_GET['s'] );
|
$search_order_id = str_replace( 'Order #', '', $_GET['s'] );
|
||||||
if ( is_numeric( $search_order_id ) )
|
if ( ! is_numeric( $search_order_id ) )
|
||||||
$post_ids[] = $search_order_id;
|
$search_order_id = 0;
|
||||||
|
|
||||||
// Add blank ID so not all results are returned if the search finds nothing
|
// Search orders
|
||||||
$post_ids[] = 0;
|
$post_ids = array_merge(
|
||||||
|
$wpdb->get_col(
|
||||||
|
$wpdb->prepare( "
|
||||||
|
SELECT post_id
|
||||||
|
FROM {$wpdb->postmeta}
|
||||||
|
WHERE meta_key IN ('" . implode( "','", $search_fields ) . "')
|
||||||
|
AND meta_value LIKE '%%%s%%'",
|
||||||
|
esc_attr( $_GET['s'] )
|
||||||
|
)
|
||||||
|
),
|
||||||
|
$wpdb->get_col(
|
||||||
|
$wpdb->prepare( "
|
||||||
|
SELECT order_id
|
||||||
|
FROM {$wpdb->prefix}woocommerce_order_items as order_items
|
||||||
|
WHERE order_item_name LIKE '%%%s%%'
|
||||||
|
",
|
||||||
|
esc_attr( $_GET['s'] )
|
||||||
|
)
|
||||||
|
),
|
||||||
|
$wpdb->get_col(
|
||||||
|
$wpdb->prepare( "
|
||||||
|
SELECT posts.ID
|
||||||
|
FROM {$wpdb->posts} as posts
|
||||||
|
LEFT JOIN {$wpdb->postmeta} as postmeta ON posts.ID = postmeta.post_id
|
||||||
|
LEFT JOIN {$wpdb->users} as users ON postmeta.meta_value = users.ID
|
||||||
|
WHERE
|
||||||
|
post_excerpt LIKE '%%%1\$s%%' OR
|
||||||
|
post_title LIKE '%%%1\$s%%' OR
|
||||||
|
(
|
||||||
|
meta_key = '_customer_user' AND
|
||||||
|
(
|
||||||
|
user_login LIKE '%%%1\$s%%' OR
|
||||||
|
user_nicename LIKE '%%%1\$s%%' OR
|
||||||
|
user_email LIKE '%%%1\$s%%' OR
|
||||||
|
display_name LIKE '%%%1\$s%%'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
",
|
||||||
|
esc_attr( $_GET['s'] )
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array( $search_order_id )
|
||||||
|
);
|
||||||
|
|
||||||
// Remove s - we don't want to search order name
|
// Remove s - we don't want to search order name
|
||||||
unset( $wp->query_vars['s'] );
|
unset( $wp->query_vars['s'] );
|
||||||
|
@ -526,4 +538,27 @@ function woocommerce_add_custom_query_var($public_query_vars) {
|
||||||
return $public_query_vars;
|
return $public_query_vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
add_filter('query_vars', 'woocommerce_add_custom_query_var');
|
add_filter('query_vars', 'woocommerce_add_custom_query_var');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove item meta on permanent deletion
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
**/
|
||||||
|
function woocommerce_delete_order_items( $postid )
|
||||||
|
{
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
if ( get_post_type( $postid ) == 'shop_order' )
|
||||||
|
{
|
||||||
|
$wpdb->query( "
|
||||||
|
DELETE {$wpdb->prefix}woocommerce_order_items, {$wpdb->prefix}woocommerce_order_itemmeta
|
||||||
|
FROM {$wpdb->prefix}woocommerce_order_items
|
||||||
|
JOIN {$wpdb->prefix}woocommerce_order_itemmeta ON {$wpdb->prefix}woocommerce_order_items.order_item_id = {$wpdb->prefix}woocommerce_order_itemmeta.order_item_id
|
||||||
|
WHERE {$wpdb->prefix}woocommerce_order_items.order_id = '{$postid}';
|
||||||
|
" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
add_action( 'before_delete_post', 'woocommerce_delete_order_items' );
|
|
@ -11,6 +11,8 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
<input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" />
|
<input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
|
||||||
<td class="tax_class" width="1%">
|
<td class="tax_class" width="1%">
|
||||||
<select class="tax_class" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" title="<?php _e( 'Tax class', 'woocommerce' ); ?>">
|
<select class="tax_class" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" title="<?php _e( 'Tax class', 'woocommerce' ); ?>">
|
||||||
<?php $tax_class = isset( $item['tax_class'] ) ? sanitize_title( $item['tax_class'] ) : ''; ?>
|
<?php $tax_class = isset( $item['tax_class'] ) ? sanitize_title( $item['tax_class'] ) : ''; ?>
|
||||||
|
@ -33,14 +35,20 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<td class="quantity" width="1%">1</td>
|
<td class="quantity" width="1%">1</td>
|
||||||
|
|
||||||
<td class="line_cost" width="1%">
|
<td class="line_cost" width="1%">
|
||||||
<label><?php _e( 'Total', 'woocommerce' ); ?>: <input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_total'] ) ) echo esc_attr( $item['line_total'] ); ?>" class="line_total" /></label>
|
<label><?php _e( 'Total', 'woocommerce' ); ?>: <input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_total'] ) ) echo esc_attr( $item['line_total'] ); ?>" class="line_total" /></label>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
|
||||||
<td class="line_tax" width="1%">
|
<td class="line_tax" width="1%">
|
||||||
<input type="text" name="line_tax[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_tax'] ) ) echo esc_attr( $item['line_tax'] ); ?>" class="line_tax" />
|
<input type="text" name="line_tax[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_tax'] ) ) echo esc_attr( $item['line_tax'] ); ?>" class="line_tax" />
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
|
@ -48,7 +48,6 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
'_line_subtotal_tax',
|
'_line_subtotal_tax',
|
||||||
'_line_total',
|
'_line_total',
|
||||||
'_line_tax',
|
'_line_tax',
|
||||||
'_refunded'
|
|
||||||
) ) ) ) continue;
|
) ) ) ) continue;
|
||||||
|
|
||||||
// Handle serialised fields
|
// Handle serialised fields
|
||||||
|
@ -79,6 +78,8 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
<?php do_action( 'woocommerce_admin_order_item_values', $_product, $item, absint( $item_id ) ); ?>
|
<?php do_action( 'woocommerce_admin_order_item_values', $_product, $item, absint( $item_id ) ); ?>
|
||||||
|
|
||||||
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
|
||||||
<td class="tax_class" width="1%">
|
<td class="tax_class" width="1%">
|
||||||
<select class="tax_class" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" title="<?php _e( 'Tax class', 'woocommerce' ); ?>">
|
<select class="tax_class" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" title="<?php _e( 'Tax class', 'woocommerce' ); ?>">
|
||||||
<?php
|
<?php
|
||||||
|
@ -99,6 +100,8 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<td class="quantity" width="1%">
|
<td class="quantity" width="1%">
|
||||||
<input type="number" step="<?php echo apply_filters( 'woocommerce_quantity_input_step', '1', $_product ); ?>" min="0" autocomplete="off" name="order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" value="<?php echo esc_attr( $item['qty'] ); ?>" size="4" class="quantity" />
|
<input type="number" step="<?php echo apply_filters( 'woocommerce_quantity_input_step', '1', $_product ); ?>" min="0" autocomplete="off" name="order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" value="<?php echo esc_attr( $item['qty'] ); ?>" size="4" class="quantity" />
|
||||||
</td>
|
</td>
|
||||||
|
@ -109,10 +112,14 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
<span class="subtotal"><label><?php _e( 'Subtotal', 'woocommerce' ); ?>: <input type="number" step="any" min="0" name="line_subtotal[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_subtotal'] ) ) echo esc_attr( $item['line_subtotal'] ); ?>" class="line_subtotal" /></label></span>
|
<span class="subtotal"><label><?php _e( 'Subtotal', 'woocommerce' ); ?>: <input type="number" step="any" min="0" name="line_subtotal[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_subtotal'] ) ) echo esc_attr( $item['line_subtotal'] ); ?>" class="line_subtotal" /></label></span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
|
||||||
<td class="line_tax" width="1%">
|
<td class="line_tax" width="1%">
|
||||||
<input type="number" step="any" min="0" name="line_tax[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_tax'] ) ) echo esc_attr( $item['line_tax'] ); ?>" class="line_tax" />
|
<input type="number" step="any" min="0" name="line_tax[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_tax'] ) ) echo esc_attr( $item['line_tax'] ); ?>" class="line_tax" />
|
||||||
|
|
||||||
<span class="subtotal"><input type="number" step="any" min="0" name="line_subtotal_tax[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_subtotal_tax'] ) ) echo esc_attr( $item['line_subtotal_tax'] ); ?>" class="line_subtotal_tax" /></span>
|
<span class="subtotal"><input type="number" step="any" min="0" name="line_subtotal_tax[<?php echo absint( $item_id ); ?>]" placeholder="0.00" value="<?php if ( isset( $item['line_subtotal_tax'] ) ) echo esc_attr( $item['line_subtotal_tax'] ); ?>" class="line_subtotal_tax" /></span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
|
@ -21,15 +21,21 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
// Get terms for attribute taxonomy or value if its a custom attribute
|
// Get terms for attribute taxonomy or value if its a custom attribute
|
||||||
if ( $attribute['is_taxonomy'] ) {
|
if ( $attribute['is_taxonomy'] ) {
|
||||||
|
|
||||||
$post_terms = wp_get_post_terms( $parent_data['id'], $attribute['name'] );
|
$post_terms = wp_get_post_terms( $parent_data['id'], $attribute['name'] );
|
||||||
|
|
||||||
foreach ( $post_terms as $term ) {
|
foreach ( $post_terms as $term ) {
|
||||||
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . apply_filters( 'woocommerce_variation_option_name', esc_html( $term->name ) ) . '</option>';
|
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . apply_filters( 'woocommerce_variation_option_name', esc_html( $term->name ) ) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$options = explode( '|', $attribute['value'] );
|
|
||||||
|
$options = array_map( 'trim', explode( '|', $attribute['value'] ) );
|
||||||
|
|
||||||
foreach ( $options as $option ) {
|
foreach ( $options as $option ) {
|
||||||
echo '<option ' . selected( $variation_selected_value, $option, false ) . ' value="' . esc_attr( $option ) . '">' . ucfirst( apply_filters( 'woocommerce_variation_option_name', esc_html( $option ) ) ) . '</option>';
|
echo '<option ' . selected( sanitize_title( $variation_selected_value ), sanitize_title( $option ), false ) . ' value="' . esc_attr( sanitize_title( $option ) ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</select>';
|
echo '</select>';
|
||||||
|
@ -50,11 +56,11 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="data" rowspan="2">
|
<td class="data" rowspan="2">
|
||||||
<table cellspacing="0" cellpadding="0">
|
<table cellspacing="0" cellpadding="0" class="data_table">
|
||||||
<?php if ( get_option( 'woocommerce_manage_stock' ) == 'yes' ) : ?>
|
<?php if ( get_option( 'woocommerce_manage_stock' ) == 'yes' ) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label><?php _e( 'Stock Qty:', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Enter a quantity to enable stock management for this variation, or leave blank to use the variable product stock options.', 'woocommerce' ); ?>" href="#">[?]</a></label>
|
<label><?php _e( 'Stock Qty:', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Enter a quantity to enable stock management at variation level, or leave blank to use the parent product\'s options.', 'woocommerce' ); ?>" href="#">[?]</a></label>
|
||||||
<input type="number" size="5" name="variable_stock[<?php echo $loop; ?>]" value="<?php if ( isset( $_stock ) ) echo esc_attr( $_stock ); ?>" step="any" />
|
<input type="number" size="5" name="variable_stock[<?php echo $loop; ?>]" value="<?php if ( isset( $_stock ) ) echo esc_attr( $_stock ); ?>" step="any" />
|
||||||
</td>
|
</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
@ -63,11 +69,11 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label><?php _e( 'Price:', 'woocommerce' ); ?></label>
|
<label><?php echo __( 'Regular Price:', 'woocommerce' ) . ' ('.get_woocommerce_currency_symbol().')'; ?></label>
|
||||||
<input type="number" size="5" name="variable_regular_price[<?php echo $loop; ?>]" value="<?php if ( isset( $_regular_price ) ) echo esc_attr( $_regular_price ); ?>" step="any" min="0" />
|
<input type="number" size="5" name="variable_regular_price[<?php echo $loop; ?>]" value="<?php if ( isset( $_regular_price ) ) echo esc_attr( $_regular_price ); ?>" step="any" min="0" placeholder="<?php _e( 'Variation price (required)', 'woocommerce' ); ?>" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label><?php _e( 'Sale Price:', 'woocommerce' ); ?> <a href="#" class="sale_schedule"><?php _e( 'Schedule', 'woocommerce' ); ?></a><a href="#" class="cancel_sale_schedule" style="display:none"><?php _e( 'Cancel schedule', 'woocommerce' ); ?></a></label>
|
<label><?php echo __( 'Sale Price:', 'woocommerce' ) . ' ('.get_woocommerce_currency_symbol().')'; ?> <a href="#" class="sale_schedule"><?php _e( 'Schedule', 'woocommerce' ); ?></a><a href="#" class="cancel_sale_schedule" style="display:none"><?php _e( 'Cancel schedule', 'woocommerce' ); ?></a></label>
|
||||||
<input type="number" size="5" name="variable_sale_price[<?php echo $loop; ?>]" value="<?php if ( isset( $_sale_price ) ) echo esc_attr( $_sale_price ); ?>" step="any" min="0" />
|
<input type="number" size="5" name="variable_sale_price[<?php echo $loop; ?>]" value="<?php if ( isset( $_sale_price ) ) echo esc_attr( $_sale_price ); ?>" step="any" min="0" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -110,7 +116,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
$args = array(
|
$args = array(
|
||||||
'taxonomy' => 'product_shipping_class',
|
'taxonomy' => 'product_shipping_class',
|
||||||
'hide_empty' => 0,
|
'hide_empty' => 0,
|
||||||
'show_option_all' => __( 'Same as parent', 'woocommerce' ),
|
'show_option_none' => __( 'Same as parent', 'woocommerce' ),
|
||||||
'name' => 'variable_shipping_class[' . $loop . ']',
|
'name' => 'variable_shipping_class[' . $loop . ']',
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'selected' => isset( $shipping_class ) ? esc_attr( $shipping_class ) : '',
|
'selected' => isset( $shipping_class ) ? esc_attr( $shipping_class ) : '',
|
||||||
|
@ -120,11 +126,13 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
echo wp_dropdown_categories( $args );
|
echo wp_dropdown_categories( $args );
|
||||||
?></td>
|
?></td>
|
||||||
<td>
|
<td>
|
||||||
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
<label><?php _e( 'Tax class:', 'woocommerce' ); ?></label>
|
<label><?php _e( 'Tax class:', 'woocommerce' ); ?></label>
|
||||||
<select name="variable_tax_class[<?php echo $loop; ?>]"><?php
|
<select name="variable_tax_class[<?php echo $loop; ?>]"><?php
|
||||||
foreach ( $parent_data['tax_class_options'] as $key => $value )
|
foreach ( $parent_data['tax_class_options'] as $key => $value )
|
||||||
echo '<option value="' . esc_attr( $key ) . '" ' . selected( $key, $_tax_class, false ) . '>' . esc_html( $value ) . '</option>';
|
echo '<option value="' . esc_attr( $key ) . '" ' . selected( $key, $_tax_class, false ) . '>' . esc_html( $value ) . '</option>';
|
||||||
?></select>
|
?></select>
|
||||||
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="show_if_variation_downloadable">
|
<tr class="show_if_variation_downloadable">
|
||||||
|
@ -132,7 +140,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
<div class="file_path_field">
|
<div class="file_path_field">
|
||||||
<label><?php _e( 'File paths:', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Enter one or more File Paths, one per line, to make this variation a downloadable product, or leave blank.', 'woocommerce' ); ?>" href="#">[?]</a></label>
|
<label><?php _e( 'File paths:', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Enter one or more File Paths, one per line, to make this variation a downloadable product, or leave blank.', 'woocommerce' ); ?>" href="#">[?]</a></label>
|
||||||
<textarea style="float:left;" class="short file_paths" cols="20" rows="2" placeholder="<?php _e( 'File paths/URLs, one per line', 'woocommerce' ); ?>" name="variable_file_paths[<?php echo $loop; ?>]" wrap="off"><?php if ( isset( $_file_paths ) ) echo esc_textarea( $_file_paths ); ?></textarea>
|
<textarea style="float:left;" class="short file_paths" cols="20" rows="2" placeholder="<?php _e( 'File paths/URLs, one per line', 'woocommerce' ); ?>" name="variable_file_paths[<?php echo $loop; ?>]" wrap="off"><?php if ( isset( $_file_paths ) ) echo esc_textarea( $_file_paths ); ?></textarea>
|
||||||
<input type="button" class="upload_file_button button" value="<?php _e( 'Upload a file', 'woocommerce' ); ?>" title="<?php _e( 'Upload', 'woocommerce' ); ?>" />
|
<input type="button" class="upload_file_button button" value="<?php _e( 'Choose a file', 'woocommerce' ); ?>" title="<?php _e( 'Upload', 'woocommerce' ); ?>" data-choose="<?php _e( 'Choose a file', 'woocommerce' ); ?>" data-update="<?php _e( 'Insert file URL', 'woocommerce' ); ?>" value="<?php _e( 'Choose a file', 'woocommerce' ); ?>" />
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -150,7 +158,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php do_action( 'woocommerce_product_after_variable_attributes', $loop, $variation_data ); ?>
|
<?php do_action( 'woocommerce_product_after_variable_attributes', $loop, $variation_data, $variation ); ?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -165,7 +173,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
<label><input type="checkbox" class="checkbox variable_is_virtual" name="variable_is_virtual[<?php echo $loop; ?>]" <?php checked( isset( $_virtual ) ? $_virtual : '', 'yes' ); ?> /> <?php _e( 'Virtual', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Enable this option if a product is not shipped or there is no shipping cost', 'woocommerce' ); ?>" href="#">[?]</a></label>
|
<label><input type="checkbox" class="checkbox variable_is_virtual" name="variable_is_virtual[<?php echo $loop; ?>]" <?php checked( isset( $_virtual ) ? $_virtual : '', 'yes' ); ?> /> <?php _e( 'Virtual', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Enable this option if a product is not shipped or there is no shipping cost', 'woocommerce' ); ?>" href="#">[?]</a></label>
|
||||||
|
|
||||||
<?php do_action( 'woocommerce_variation_options', $loop, $variation_data ); ?>
|
<?php do_action( 'woocommerce_variation_options', $loop, $variation_data, $variation ); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -42,13 +42,13 @@ function woocommerce_coupon_data_meta_box( $post ) {
|
||||||
woocommerce_wp_select( array( 'id' => 'discount_type', 'label' => __( 'Discount type', 'woocommerce' ), 'options' => $woocommerce->get_coupon_discount_types() ) );
|
woocommerce_wp_select( array( 'id' => 'discount_type', 'label' => __( 'Discount type', 'woocommerce' ), 'options' => $woocommerce->get_coupon_discount_types() ) );
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
woocommerce_wp_text_input( array( 'id' => 'coupon_amount', 'label' => __( 'Coupon amount', 'woocommerce' ), 'placeholder' => '0.00', 'description' => __( 'Enter an amount e.g. 2.99', 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array(
|
woocommerce_wp_text_input( array( 'id' => 'coupon_amount', 'label' => __( 'Coupon amount', 'woocommerce' ), 'placeholder' => '0.00', 'description' => __( 'Value of the coupon.', 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array(
|
||||||
'step' => 'any',
|
'step' => 'any',
|
||||||
'min' => '0'
|
'min' => '0'
|
||||||
) ) );
|
) ) );
|
||||||
|
|
||||||
// Free Shipping
|
// Free Shipping
|
||||||
woocommerce_wp_checkbox( array( 'id' => 'free_shipping', 'label' => __( 'Enable free shipping', 'woocommerce' ), 'description' => sprintf(__( 'Check this box if the coupon grants free shipping. The <a href="%s">free shipping method</a> must be enabled with the "must use coupon" setting checked.', 'woocommerce' ), admin_url('admin.php?page=woocommerce_settings&tab=shipping§ion=WC_Free_Shipping')) ) );
|
woocommerce_wp_checkbox( array( 'id' => 'free_shipping', 'label' => __( 'Enable free shipping', 'woocommerce' ), 'description' => sprintf(__( 'Check this box if the coupon grants free shipping. The <a href="%s">free shipping method</a> must be enabled with the "must use coupon" setting checked.', 'woocommerce' ), admin_url('admin.php?page=woocommerce_settings&tab=shipping§ion=WC_Shipping_Free_Shipping')) ) );
|
||||||
|
|
||||||
// Individual use
|
// Individual use
|
||||||
woocommerce_wp_checkbox( array( 'id' => 'individual_use', 'label' => __( 'Individual use', 'woocommerce' ), 'description' => __( 'Check this box if the coupon cannot be used in conjunction with other coupons.', 'woocommerce' ) ) );
|
woocommerce_wp_checkbox( array( 'id' => 'individual_use', 'label' => __( 'Individual use', 'woocommerce' ), 'description' => __( 'Check this box if the coupon cannot be used in conjunction with other coupons.', 'woocommerce' ) ) );
|
||||||
|
@ -56,6 +56,9 @@ function woocommerce_coupon_data_meta_box( $post ) {
|
||||||
// Apply before tax
|
// Apply before tax
|
||||||
woocommerce_wp_checkbox( array( 'id' => 'apply_before_tax', 'label' => __( 'Apply before tax', 'woocommerce' ), 'description' => __( 'Check this box if the coupon should be applied before calculating cart tax.', 'woocommerce' ) ) );
|
woocommerce_wp_checkbox( array( 'id' => 'apply_before_tax', 'label' => __( 'Apply before tax', 'woocommerce' ), 'description' => __( 'Check this box if the coupon should be applied before calculating cart tax.', 'woocommerce' ) ) );
|
||||||
|
|
||||||
|
// Exclude Sale Products
|
||||||
|
woocommerce_wp_checkbox( array( 'id' => 'exclude_sale_items', 'label' => __( 'Exclude sale items', 'woocommerce' ), 'description' => __( 'Check this box if the coupon should not apply to items on sale. Per-item coupons will only work if the item is not on sale. Per-cart coupons will only work if there are no sale items in the cart.', 'woocommerce' ) ) );
|
||||||
|
|
||||||
echo '</div><div class="options_group">';
|
echo '</div><div class="options_group">';
|
||||||
|
|
||||||
// minimum spend
|
// minimum spend
|
||||||
|
@ -75,16 +78,11 @@ function woocommerce_coupon_data_meta_box( $post ) {
|
||||||
if ( $product_ids ) {
|
if ( $product_ids ) {
|
||||||
$product_ids = array_map( 'absint', explode( ',', $product_ids ) );
|
$product_ids = array_map( 'absint', explode( ',', $product_ids ) );
|
||||||
foreach ( $product_ids as $product_id ) {
|
foreach ( $product_ids as $product_id ) {
|
||||||
$title = get_the_title( $product_id );
|
|
||||||
$sku = get_post_meta( $product_id, '_sku', true );
|
|
||||||
|
|
||||||
if ( ! $title )
|
$product = get_product( $product_id );
|
||||||
continue;
|
$product_name = woocommerce_get_formatted_product_name( $product );
|
||||||
|
|
||||||
if ( ! empty( $sku ) )
|
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . wp_kses_post( $product_name ) . '</option>';
|
||||||
$sku = ' (SKU: ' . $sku . ')';
|
|
||||||
|
|
||||||
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $title . $sku ) . '</option>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -100,16 +98,11 @@ function woocommerce_coupon_data_meta_box( $post ) {
|
||||||
if ( $product_ids ) {
|
if ( $product_ids ) {
|
||||||
$product_ids = array_map( 'absint', explode( ',', $product_ids ) );
|
$product_ids = array_map( 'absint', explode( ',', $product_ids ) );
|
||||||
foreach ( $product_ids as $product_id ) {
|
foreach ( $product_ids as $product_id ) {
|
||||||
$title = get_the_title( $product_id );
|
|
||||||
$sku = get_post_meta( $product_id, '_sku', true );
|
|
||||||
|
|
||||||
if ( ! $title )
|
$product = get_product( $product_id );
|
||||||
continue;
|
$product_name = woocommerce_get_formatted_product_name( $product );
|
||||||
|
|
||||||
if ( ! empty( $sku ) )
|
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product_name ) . '</option>';
|
||||||
$sku = ' (SKU: ' . $sku . ')';
|
|
||||||
|
|
||||||
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $title . $sku ) . '</option>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -209,6 +202,7 @@ function woocommerce_process_shop_coupon_meta( $post_id, $post ) {
|
||||||
$expiry_date = woocommerce_clean( $_POST['expiry_date'] );
|
$expiry_date = woocommerce_clean( $_POST['expiry_date'] );
|
||||||
$apply_before_tax = isset( $_POST['apply_before_tax'] ) ? 'yes' : 'no';
|
$apply_before_tax = isset( $_POST['apply_before_tax'] ) ? 'yes' : 'no';
|
||||||
$free_shipping = isset( $_POST['free_shipping'] ) ? 'yes' : 'no';
|
$free_shipping = isset( $_POST['free_shipping'] ) ? 'yes' : 'no';
|
||||||
|
$exclude_sale_items = isset( $_POST['exclude_sale_items'] ) ? 'yes' : 'no';
|
||||||
$minimum_amount = woocommerce_clean( $_POST['minimum_amount'] );
|
$minimum_amount = woocommerce_clean( $_POST['minimum_amount'] );
|
||||||
$customer_email = array_filter( array_map( 'trim', explode( ',', woocommerce_clean( $_POST['customer_email'] ) ) ) );
|
$customer_email = array_filter( array_map( 'trim', explode( ',', woocommerce_clean( $_POST['customer_email'] ) ) ) );
|
||||||
|
|
||||||
|
@ -237,6 +231,7 @@ function woocommerce_process_shop_coupon_meta( $post_id, $post ) {
|
||||||
update_post_meta( $post_id, 'expiry_date', $expiry_date );
|
update_post_meta( $post_id, 'expiry_date', $expiry_date );
|
||||||
update_post_meta( $post_id, 'apply_before_tax', $apply_before_tax );
|
update_post_meta( $post_id, 'apply_before_tax', $apply_before_tax );
|
||||||
update_post_meta( $post_id, 'free_shipping', $free_shipping );
|
update_post_meta( $post_id, 'free_shipping', $free_shipping );
|
||||||
|
update_post_meta( $post_id, 'exclude_sale_items', $exclude_sale_items );
|
||||||
update_post_meta( $post_id, 'product_categories', $product_categories );
|
update_post_meta( $post_id, 'product_categories', $product_categories );
|
||||||
update_post_meta( $post_id, 'exclude_product_categories', $exclude_product_categories );
|
update_post_meta( $post_id, 'exclude_product_categories', $exclude_product_categories );
|
||||||
update_post_meta( $post_id, 'minimum_amount', $minimum_amount );
|
update_post_meta( $post_id, 'minimum_amount', $minimum_amount );
|
||||||
|
|
|
@ -49,82 +49,95 @@ function woocommerce_order_data_meta_box($post) {
|
||||||
$order_title = $post->post_title;
|
$order_title = $post->post_title;
|
||||||
?>
|
?>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#titlediv, #major-publishing-actions, #minor-publishing-actions, #visibility, #submitdiv { display:none }
|
#post-body-content, #titlediv, #major-publishing-actions, #minor-publishing-actions, #visibility, #submitdiv { display:none }
|
||||||
</style>
|
</style>
|
||||||
<div class="panel-wrap woocommerce">
|
<div class="panel-wrap woocommerce">
|
||||||
<input name="post_title" type="hidden" value="<?php echo esc_attr( $order_title ); ?>" />
|
<input name="post_title" type="hidden" value="<?php echo esc_attr( $order_title ); ?>" />
|
||||||
<input name="post_status" type="hidden" value="publish" />
|
<input name="post_status" type="hidden" value="publish" />
|
||||||
<div id="order_data" class="panel">
|
<div id="order_data" class="panel">
|
||||||
|
|
||||||
<div class="order_data_left">
|
<h2><?php _e( 'Order Details', 'woocommerce' ); ?></h2>
|
||||||
|
<p class="order_number"><?php
|
||||||
|
|
||||||
<h2><?php _e( 'Order Details', 'woocommerce' ); ?> — <?php echo esc_html( $order->get_order_number() ); ?></h2>
|
echo __( 'Order number', 'woocommerce' ) . ' ' . esc_html( $order->get_order_number() ) . '. ';
|
||||||
|
|
||||||
<p class="form-field"><label for="order_status"><?php _e( 'Order status:', 'woocommerce' ) ?></label>
|
$ip_address = get_post_meta( $post->ID, '_customer_ip_address', true );
|
||||||
<select id="order_status" name="order_status" class="chosen_select">
|
|
||||||
<?php
|
|
||||||
$statuses = (array) get_terms( 'shop_order_status', array( 'hide_empty' => 0, 'orderby' => 'id' ) );
|
|
||||||
foreach ( $statuses as $status ) {
|
|
||||||
echo '<option value="' . esc_attr( $status->slug ) . '" ' . selected( $status->slug, $order_status, false ) . '>' . esc_html__( $status->name, 'woocommerce' ) . '</option>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</select></p>
|
|
||||||
|
|
||||||
<p class="form-field last"><label for="order_date"><?php _e( 'Order Date:', 'woocommerce' ) ?></label>
|
if ( $ip_address )
|
||||||
<input type="text" class="date-picker-field" name="order_date" id="order_date" maxlength="10" value="<?php echo date_i18n( 'Y-m-d', strtotime( $post->post_date ) ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" /> @ <input type="text" class="hour" placeholder="<?php _e( 'h', 'woocommerce' ) ?>" name="order_date_hour" id="order_date_hour" maxlength="2" size="2" value="<?php echo date_i18n( 'H', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />:<input type="text" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ) ?>" name="order_date_minute" id="order_date_minute" maxlength="2" size="2" value="<?php echo date_i18n( 'i', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />
|
echo __( 'Customer IP:', 'woocommerce' ) . ' ' . esc_html( $ip_address );
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="form-field form-field-wide">
|
?></p>
|
||||||
<label for="customer_user"><?php _e( 'Customer:', 'woocommerce' ) ?></label>
|
|
||||||
<select id="customer_user" name="customer_user" class="ajax_chosen_select_customer">
|
<div class="order_data_column_container">
|
||||||
<option value=""><?php _e( 'Guest', 'woocommerce' ) ?></option>
|
<div class="order_data_column">
|
||||||
|
|
||||||
|
<h4><?php _e( 'General Details', 'woocommerce' ); ?></h4>
|
||||||
|
|
||||||
|
<p class="form-field"><label for="order_status"><?php _e( 'Order status:', 'woocommerce' ) ?></label>
|
||||||
|
<select id="order_status" name="order_status" class="chosen_select">
|
||||||
<?php
|
<?php
|
||||||
if ( $customer_user ) {
|
$statuses = (array) get_terms( 'shop_order_status', array( 'hide_empty' => 0, 'orderby' => 'id' ) );
|
||||||
$user = get_user_by( 'id', $customer_user );
|
foreach ( $statuses as $status ) {
|
||||||
echo '<option value="' . esc_attr( $user->ID ) . '" ' . selected( 1, 1, false ) . '>' . esc_html( $user->display_name ) . ' (#' . absint( $user->ID ) . ' – ' . esc_html( $user->user_email ) . ')</option>';
|
echo '<option value="' . esc_attr( $status->slug ) . '" ' . selected( $status->slug, $order_status, false ) . '>' . esc_html__( $status->name, 'woocommerce' ) . '</option>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select></p>
|
||||||
<?php
|
|
||||||
|
|
||||||
// Ajax Chosen Customer Selectors JS
|
<p class="form-field last"><label for="order_date"><?php _e( 'Order Date:', 'woocommerce' ) ?></label>
|
||||||
$woocommerce->add_inline_js( "
|
<input type="text" class="date-picker-field" name="order_date" id="order_date" maxlength="10" value="<?php echo date_i18n( 'Y-m-d', strtotime( $post->post_date ) ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" /> @ <input type="text" class="hour" placeholder="<?php _e( 'h', 'woocommerce' ) ?>" name="order_date_hour" id="order_date_hour" maxlength="2" size="2" value="<?php echo date_i18n( 'H', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />:<input type="text" class="minute" placeholder="<?php _e( 'm', 'woocommerce' ) ?>" name="order_date_minute" id="order_date_minute" maxlength="2" size="2" value="<?php echo date_i18n( 'i', strtotime( $post->post_date ) ); ?>" pattern="\-?\d+(\.\d{0,})?" />
|
||||||
jQuery('select.ajax_chosen_select_customer').ajaxChosen({
|
</p>
|
||||||
method: 'GET',
|
|
||||||
url: '" . admin_url('admin-ajax.php') . "',
|
|
||||||
dataType: 'json',
|
|
||||||
afterTypeDelay: 100,
|
|
||||||
minTermLength: 1,
|
|
||||||
data: {
|
|
||||||
action: 'woocommerce_json_search_customers',
|
|
||||||
security: '" . wp_create_nonce("search-customers") . "'
|
|
||||||
}
|
|
||||||
}, function (data) {
|
|
||||||
|
|
||||||
var terms = {};
|
<p class="form-field form-field-wide">
|
||||||
|
<label for="customer_user"><?php _e( 'Customer:', 'woocommerce' ) ?></label>
|
||||||
|
<select id="customer_user" name="customer_user" class="ajax_chosen_select_customer">
|
||||||
|
<option value=""><?php _e( 'Guest', 'woocommerce' ) ?></option>
|
||||||
|
<?php
|
||||||
|
if ( $customer_user ) {
|
||||||
|
$user = get_user_by( 'id', $customer_user );
|
||||||
|
echo '<option value="' . esc_attr( $user->ID ) . '" ' . selected( 1, 1, false ) . '>' . esc_html( $user->display_name ) . ' (#' . absint( $user->ID ) . ' – ' . esc_html( $user->user_email ) . ')</option>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
<?php
|
||||||
|
|
||||||
$.each(data, function (i, val) {
|
// Ajax Chosen Customer Selectors JS
|
||||||
terms[i] = val;
|
$woocommerce->add_inline_js( "
|
||||||
});
|
jQuery('select.ajax_chosen_select_customer').ajaxChosen({
|
||||||
|
method: 'GET',
|
||||||
|
url: '" . admin_url('admin-ajax.php') . "',
|
||||||
|
dataType: 'json',
|
||||||
|
afterTypeDelay: 100,
|
||||||
|
minTermLength: 1,
|
||||||
|
data: {
|
||||||
|
action: 'woocommerce_json_search_customers',
|
||||||
|
security: '" . wp_create_nonce("search-customers") . "'
|
||||||
|
}
|
||||||
|
}, function (data) {
|
||||||
|
|
||||||
return terms;
|
var terms = {};
|
||||||
});
|
|
||||||
" );
|
|
||||||
|
|
||||||
?>
|
$.each(data, function (i, val) {
|
||||||
</p>
|
terms[i] = val;
|
||||||
|
});
|
||||||
|
|
||||||
<?php if( get_option( 'woocommerce_enable_order_comments' ) != 'no' ) : ?>
|
return terms;
|
||||||
<p class="form-field form-field-wide"><label for="excerpt"><?php _e( 'Customer Note:', 'woocommerce' ) ?></label>
|
});
|
||||||
<textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php _e( 'Customer\'s notes about the order', 'woocommerce' ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p>
|
" );
|
||||||
<?php endif; ?>
|
?>
|
||||||
|
</p>
|
||||||
|
|
||||||
<?php do_action( 'woocommerce_admin_order_data_after_order_details', $order ); ?>
|
<?php if ( get_option( 'woocommerce_enable_order_comments' ) != 'no' ) : ?>
|
||||||
|
|
||||||
</div>
|
<p class="form-field form-field-wide"><label for="excerpt"><?php _e( 'Customer Note:', 'woocommerce' ) ?></label>
|
||||||
<div class="order_data_right">
|
<textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt" placeholder="<?php _e( 'Customer\'s notes about the order', 'woocommerce' ); ?>"><?php echo wp_kses_post( $post->post_excerpt ); ?></textarea></p>
|
||||||
<div class="order_data">
|
|
||||||
<h2><?php _e( 'Billing Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h2>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php do_action( 'woocommerce_admin_order_data_after_order_details', $order ); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="order_data_column">
|
||||||
|
<h4><?php _e( 'Billing Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h4>
|
||||||
<?php
|
<?php
|
||||||
$billing_data = apply_filters('woocommerce_admin_billing_fields', array(
|
$billing_data = apply_filters('woocommerce_admin_billing_fields', array(
|
||||||
'first_name' => array(
|
'first_name' => array(
|
||||||
|
@ -182,7 +195,7 @@ function woocommerce_order_data_meta_box($post) {
|
||||||
echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No billing address set.', 'woocommerce' ) . '</p>';
|
echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No billing address set.', 'woocommerce' ) . '</p>';
|
||||||
|
|
||||||
foreach ( $billing_data as $key => $field ) {
|
foreach ( $billing_data as $key => $field ) {
|
||||||
if ( empty( $field['show'] ) )
|
if ( isset( $field['show'] ) && $field['show'] === false )
|
||||||
continue;
|
continue;
|
||||||
$field_name = 'billing_' . $key;
|
$field_name = 'billing_' . $key;
|
||||||
if ( $order->$field_name )
|
if ( $order->$field_name )
|
||||||
|
@ -212,9 +225,9 @@ function woocommerce_order_data_meta_box($post) {
|
||||||
do_action( 'woocommerce_admin_order_data_after_billing_address', $order );
|
do_action( 'woocommerce_admin_order_data_after_billing_address', $order );
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<div class="order_data order_data_alt">
|
<div class="order_data_column">
|
||||||
|
|
||||||
<h2><?php _e( 'Shipping Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h2>
|
<h4><?php _e( 'Shipping Details', 'woocommerce' ); ?> <a class="edit_address" href="#">(<?php _e( 'Edit', 'woocommerce' ) ;?>)</a></h4>
|
||||||
<?php
|
<?php
|
||||||
$shipping_data = apply_filters('woocommerce_admin_shipping_fields', array(
|
$shipping_data = apply_filters('woocommerce_admin_shipping_fields', array(
|
||||||
'first_name' => array(
|
'first_name' => array(
|
||||||
|
@ -266,7 +279,7 @@ function woocommerce_order_data_meta_box($post) {
|
||||||
echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No shipping address set.', 'woocommerce' ) . '</p>';
|
echo '<p class="none_set"><strong>' . __( 'Address', 'woocommerce' ) . ':</strong> ' . __( 'No shipping address set.', 'woocommerce' ) . '</p>';
|
||||||
|
|
||||||
if ( $shipping_data ) foreach ( $shipping_data as $key => $field ) {
|
if ( $shipping_data ) foreach ( $shipping_data as $key => $field ) {
|
||||||
if ( empty( $field['show'] ) )
|
if ( isset( $field['show'] ) && $field['show'] === false )
|
||||||
continue;
|
continue;
|
||||||
$field_name = 'shipping_' . $key;
|
$field_name = 'shipping_' . $key;
|
||||||
if ( $order->$field_name )
|
if ( $order->$field_name )
|
||||||
|
@ -316,7 +329,7 @@ function woocommerce_order_items_meta_box( $post ) {
|
||||||
|
|
||||||
$order = $theorder;
|
$order = $theorder;
|
||||||
|
|
||||||
$data = get_post_custom( $post->ID );
|
$data = get_post_meta( $post->ID );
|
||||||
?>
|
?>
|
||||||
<div class="woocommerce_order_items_wrapper">
|
<div class="woocommerce_order_items_wrapper">
|
||||||
<table cellpadding="0" cellspacing="0" class="woocommerce_order_items">
|
<table cellpadding="0" cellspacing="0" class="woocommerce_order_items">
|
||||||
|
@ -327,13 +340,17 @@ function woocommerce_order_items_meta_box( $post ) {
|
||||||
|
|
||||||
<?php do_action( 'woocommerce_admin_order_item_headers' ); ?>
|
<?php do_action( 'woocommerce_admin_order_item_headers' ); ?>
|
||||||
|
|
||||||
<th class="tax_class"><?php _e( 'Tax Class', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Tax class for the line item', 'woocommerce' ); ?>." href="#">[?]</a></th>
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
<th class="tax_class"><?php _e( 'Tax Class', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Tax class for the line item', 'woocommerce' ); ?>." href="#">[?]</a></th>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<th class="quantity"><?php _e( 'Qty', 'woocommerce' ); ?></th>
|
<th class="quantity"><?php _e( 'Qty', 'woocommerce' ); ?></th>
|
||||||
|
|
||||||
<th class="line_cost"><?php _e( 'Cost', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Line subtotals are before pre-tax discounts, totals are after.', 'woocommerce' ); ?>" href="#">[?]</a></th>
|
<th class="line_cost"><?php _e( 'Cost', 'woocommerce' ); ?> <a class="tips" data-tip="<?php _e( 'Line subtotals are before pre-tax discounts, totals are after.', 'woocommerce' ); ?>" href="#">[?]</a></th>
|
||||||
|
|
||||||
<th class="line_tax"><?php _e( 'Tax', 'woocommerce' ); ?></th>
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
<th class="line_tax"><?php _e( 'Tax', 'woocommerce' ); ?></th>
|
||||||
|
<?php endif; ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="order_items_list">
|
<tbody id="order_items_list">
|
||||||
|
@ -344,14 +361,13 @@ function woocommerce_order_items_meta_box( $post ) {
|
||||||
|
|
||||||
foreach ( $order_items as $item_id => $item ) {
|
foreach ( $order_items as $item_id => $item ) {
|
||||||
|
|
||||||
$class = ( isset( $item['refunded'] ) ) ? 'refunded' : '';
|
|
||||||
|
|
||||||
switch ( $item['type'] ) {
|
switch ( $item['type'] ) {
|
||||||
case 'line_item' :
|
case 'line_item' :
|
||||||
$_product = $order->get_product_from_item( $item );
|
$_product = $order->get_product_from_item( $item );
|
||||||
$item_meta = $order->get_item_meta( $item_id );
|
$item_meta = $order->get_item_meta( $item_id );
|
||||||
|
|
||||||
include( 'order-item-html.php' );
|
if ( $_product )
|
||||||
|
include( 'order-item-html.php' );
|
||||||
break;
|
break;
|
||||||
case 'fee' :
|
case 'fee' :
|
||||||
include( 'order-fee-html.php' );
|
include( 'order-fee-html.php' );
|
||||||
|
@ -371,23 +387,6 @@ function woocommerce_order_items_meta_box( $post ) {
|
||||||
<option value=""><?php _e( 'Actions', 'woocommerce' ); ?></option>
|
<option value=""><?php _e( 'Actions', 'woocommerce' ); ?></option>
|
||||||
<optgroup label="<?php _e( 'Edit', 'woocommerce' ); ?>">
|
<optgroup label="<?php _e( 'Edit', 'woocommerce' ); ?>">
|
||||||
<option value="delete"><?php _e( 'Delete Lines', 'woocommerce' ); ?></option>
|
<option value="delete"><?php _e( 'Delete Lines', 'woocommerce' ); ?></option>
|
||||||
|
|
||||||
<?php
|
|
||||||
$gateways = $woocommerce->payment_gateways->payment_gateways();
|
|
||||||
|
|
||||||
if ( isset( $gateways[ $order->payment_method ] ) ) {
|
|
||||||
$gateway = $gateways[ $order->payment_method ];
|
|
||||||
|
|
||||||
if ( ! in_array( 'refunds', $gateway->supports ) || ! method_exists( $gateway, 'refund' ) ) {
|
|
||||||
$supports_refunds = false;
|
|
||||||
} else {
|
|
||||||
$supports_refunds = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<option value="refund" ' . disabled( $supports_refunds, false ) . '>' . sprintf( __( 'Refund Lines via %s', 'woocommerce' ), $order->payment_method ) . '</option>';
|
|
||||||
}
|
|
||||||
echo '<option value="manual_refund">' . __( 'Mark Lines Refunded', 'woocommerce' ) . '</option>';
|
|
||||||
?>
|
|
||||||
</optgroup>
|
</optgroup>
|
||||||
<optgroup label="<?php _e( 'Stock Actions', 'woocommerce' ); ?>">
|
<optgroup label="<?php _e( 'Stock Actions', 'woocommerce' ); ?>">
|
||||||
<option value="reduce_stock"><?php _e( 'Reduce Line Stock', 'woocommerce' ); ?></option>
|
<option value="reduce_stock"><?php _e( 'Reduce Line Stock', 'woocommerce' ); ?></option>
|
||||||
|
@ -395,7 +394,7 @@ function woocommerce_order_items_meta_box( $post ) {
|
||||||
</optgroup>
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<button type="button" class="button do_bulk_action"><?php _e( 'Apply', 'woocommerce' ); ?></button>
|
<button type="button" class="button do_bulk_action wc-reload" title="<?php _e( 'Apply', 'woocommerce' ); ?>"><span><?php _e( 'Apply', 'woocommerce' ); ?></span></button>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="add_items">
|
<p class="add_items">
|
||||||
|
@ -450,27 +449,12 @@ function woocommerce_order_actions_meta_box( $post ) {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</optgroup>
|
</optgroup>
|
||||||
<optgroup label="<?php _e( 'Refund Order', 'woocommerce' ); ?>">
|
<?php foreach( apply_filters( 'woocommerce_order_actions', array() ) as $action => $title ) { ?>
|
||||||
<?php
|
<option value="<?php echo $action; ?>"><?php echo $title; ?></option>
|
||||||
$gateways = $woocommerce->payment_gateways->payment_gateways();
|
<?php } ?>
|
||||||
|
|
||||||
if ( isset( $gateways[ $order->payment_method ] ) ) {
|
|
||||||
$gateway = $gateways[ $order->payment_method ];
|
|
||||||
|
|
||||||
if ( ! in_array( 'refunds', $gateway->supports ) || ! method_exists( $gateway, 'refund' ) ) {
|
|
||||||
$supports_refunds = false;
|
|
||||||
} else {
|
|
||||||
$supports_refunds = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<option value="refund_order" ' . disabled( $supports_refunds, false ) . '>' . sprintf( __( 'Refund Order via %s', 'woocommerce' ), $order->payment_method ) . '</option>';
|
|
||||||
}
|
|
||||||
echo '<option value="manual_refund_order">' . __( 'Mark Order Refunded', 'woocommerce' ) . '</option>';
|
|
||||||
?>
|
|
||||||
</optgroup>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<button class="button"><?php _e( 'Apply', 'woocommerce' ); ?></button>
|
<button class="button wc-reload" title="<?php _e( 'Apply', 'woocommerce' ); ?>"><span><?php _e( 'Apply', 'woocommerce' ); ?></span></button>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="wide">
|
<li class="wide">
|
||||||
|
@ -506,7 +490,7 @@ function woocommerce_order_totals_meta_box( $post ) {
|
||||||
|
|
||||||
$order = $theorder;
|
$order = $theorder;
|
||||||
|
|
||||||
$data = get_post_custom( $post->ID );
|
$data = get_post_meta( $post->ID );
|
||||||
?>
|
?>
|
||||||
<div class="totals_group">
|
<div class="totals_group">
|
||||||
<h4><span class="discount_total_display inline_total"></span><?php _e( 'Discounts', 'woocommerce' ); ?></h4>
|
<h4><span class="discount_total_display inline_total"></span><?php _e( 'Discounts', 'woocommerce' ); ?></h4>
|
||||||
|
@ -574,10 +558,10 @@ function woocommerce_order_totals_meta_box( $post ) {
|
||||||
<select name="_shipping_method" id="_shipping_method" class="first">
|
<select name="_shipping_method" id="_shipping_method" class="first">
|
||||||
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
||||||
<?php
|
<?php
|
||||||
$chosen_method = $data['_shipping_method'][0];
|
$chosen_method = ! empty( $data['_shipping_method'][0] ) ? $data['_shipping_method'][0] : '';
|
||||||
$found_method = false;
|
$found_method = false;
|
||||||
|
|
||||||
if ( $woocommerce->shipping ) {
|
if ( $woocommerce->shipping() ) {
|
||||||
foreach ( $woocommerce->shipping->load_shipping_methods() as $method ) {
|
foreach ( $woocommerce->shipping->load_shipping_methods() as $method ) {
|
||||||
|
|
||||||
if ( strpos( $chosen_method, $method->id ) === 0 )
|
if ( strpos( $chosen_method, $method->id ) === 0 )
|
||||||
|
@ -604,6 +588,9 @@ function woocommerce_order_totals_meta_box( $post ) {
|
||||||
<?php do_action( 'woocommerce_admin_order_totals_after_shipping', $post->ID ) ?>
|
<?php do_action( 'woocommerce_admin_order_totals_after_shipping', $post->ID ) ?>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
|
||||||
<div class="totals_group tax_rows_group">
|
<div class="totals_group tax_rows_group">
|
||||||
<h4><?php _e( 'Tax Rows', 'woocommerce' ); ?></h4>
|
<h4><?php _e( 'Tax Rows', 'woocommerce' ); ?></h4>
|
||||||
<div id="tax_rows" class="total_rows">
|
<div id="tax_rows" class="total_rows">
|
||||||
|
@ -656,6 +643,9 @@ function woocommerce_order_totals_meta_box( $post ) {
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="totals_group">
|
<div class="totals_group">
|
||||||
<h4><?php _e( 'Order Totals', 'woocommerce' ); ?></h4>
|
<h4><?php _e( 'Order Totals', 'woocommerce' ); ?></h4>
|
||||||
<ul class="totals">
|
<ul class="totals">
|
||||||
|
@ -669,22 +659,14 @@ function woocommerce_order_totals_meta_box( $post ) {
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="right">
|
<li class="right">
|
||||||
<label><?php _e( 'Refund Total:', 'woocommerce' ); ?></label>
|
|
||||||
<input type="number" step="any" min="0" id="_order_refund_total" name="_order_refund_total" placeholder="0.00" value="<?php
|
|
||||||
if ( isset( $data['_refund_total'][0] ) )
|
|
||||||
echo esc_attr( $data['_refund_total'][0] );
|
|
||||||
?>" />
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="wide">
|
|
||||||
<label><?php _e( 'Payment Method:', 'woocommerce' ); ?></label>
|
<label><?php _e( 'Payment Method:', 'woocommerce' ); ?></label>
|
||||||
<select name="_payment_method" id="_payment_method" class="first">
|
<select name="_payment_method" id="_payment_method" class="first">
|
||||||
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
<option value=""><?php _e( 'N/A', 'woocommerce' ); ?></option>
|
||||||
<?php
|
<?php
|
||||||
$chosen_method = $data['_payment_method'][0];
|
$chosen_method = ! empty( $data['_payment_method'][0] ) ? $data['_payment_method'][0] : '';
|
||||||
$found_method = false;
|
$found_method = false;
|
||||||
|
|
||||||
if ( $woocommerce->payment_gateways ) {
|
if ( $woocommerce->payment_gateways() ) {
|
||||||
foreach ( $woocommerce->payment_gateways->payment_gateways() as $gateway ) {
|
foreach ( $woocommerce->payment_gateways->payment_gateways() as $gateway ) {
|
||||||
if ( $gateway->enabled == "yes" ) {
|
if ( $gateway->enabled == "yes" ) {
|
||||||
echo '<option value="' . esc_attr( $gateway->id ) . '" ' . selected( $chosen_method, $gateway->id, false ) . '>' . esc_html( $gateway->get_title() ) . '</option>';
|
echo '<option value="' . esc_attr( $gateway->id ) . '" ' . selected( $chosen_method, $gateway->id, false ) . '>' . esc_html( $gateway->get_title() ) . '</option>';
|
||||||
|
@ -707,7 +689,9 @@ function woocommerce_order_totals_meta_box( $post ) {
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<p class="buttons">
|
<p class="buttons">
|
||||||
<button type="button" class="button calc_line_taxes"><?php _e( 'Calc taxes', 'woocommerce' ); ?></button>
|
<?php if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) : ?>
|
||||||
|
<button type="button" class="button calc_line_taxes"><?php _e( 'Calc taxes', 'woocommerce' ); ?></button>
|
||||||
|
<?php endif; ?>
|
||||||
<button type="button" class="button calc_totals button-primary"><?php _e( 'Calc totals', 'woocommerce' ); ?></button>
|
<button type="button" class="button calc_totals button-primary"><?php _e( 'Calc totals', 'woocommerce' ); ?></button>
|
||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
|
@ -753,10 +737,13 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) {
|
||||||
update_post_meta( $post_id, '_cart_discount', woocommerce_clean( $_POST['_cart_discount'] ) );
|
update_post_meta( $post_id, '_cart_discount', woocommerce_clean( $_POST['_cart_discount'] ) );
|
||||||
update_post_meta( $post_id, '_order_discount', woocommerce_clean( $_POST['_order_discount'] ) );
|
update_post_meta( $post_id, '_order_discount', woocommerce_clean( $_POST['_order_discount'] ) );
|
||||||
update_post_meta( $post_id, '_order_total', woocommerce_clean( $_POST['_order_total'] ) );
|
update_post_meta( $post_id, '_order_total', woocommerce_clean( $_POST['_order_total'] ) );
|
||||||
update_post_meta( $post_id, '_refund_total', woocommerce_clean( $_POST['_order_refund_total'] ) );
|
|
||||||
update_post_meta( $post_id, '_customer_user', absint( $_POST['customer_user'] ) );
|
update_post_meta( $post_id, '_customer_user', absint( $_POST['customer_user'] ) );
|
||||||
update_post_meta( $post_id, '_order_tax', woocommerce_clean( $_POST['_order_tax'] ) );
|
|
||||||
update_post_meta( $post_id, '_order_shipping_tax', woocommerce_clean( $_POST['_order_shipping_tax'] ) );
|
if ( isset( $_POST['_order_tax'] ) )
|
||||||
|
update_post_meta( $post_id, '_order_tax', woocommerce_clean( $_POST['_order_tax'] ) );
|
||||||
|
|
||||||
|
if ( isset( $_POST['_order_shipping_tax'] ) )
|
||||||
|
update_post_meta( $post_id, '_order_shipping_tax', woocommerce_clean( $_POST['_order_shipping_tax'] ) );
|
||||||
|
|
||||||
// Shipping method handling
|
// Shipping method handling
|
||||||
if ( get_post_meta( $post_id, '_shipping_method', true ) !== stripslashes( $_POST['_shipping_method'] ) ) {
|
if ( get_post_meta( $post_id, '_shipping_method', true ) !== stripslashes( $_POST['_shipping_method'] ) ) {
|
||||||
|
@ -895,6 +882,9 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) {
|
||||||
|
|
||||||
if ( isset( $line_tax[ $item_id ] ) )
|
if ( isset( $line_tax[ $item_id ] ) )
|
||||||
woocommerce_update_order_item_meta( $item_id, '_line_tax', woocommerce_clean( $line_tax[ $item_id ] ) );
|
woocommerce_update_order_item_meta( $item_id, '_line_tax', woocommerce_clean( $line_tax[ $item_id ] ) );
|
||||||
|
|
||||||
|
// Clear meta cache
|
||||||
|
wp_cache_delete( $item_id, 'order_item_meta' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -902,12 +892,13 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) {
|
||||||
$meta_keys = isset( $_POST['meta_key'] ) ? $_POST['meta_key'] : array();
|
$meta_keys = isset( $_POST['meta_key'] ) ? $_POST['meta_key'] : array();
|
||||||
$meta_values = isset( $_POST['meta_value'] ) ? $_POST['meta_value'] : array();
|
$meta_values = isset( $_POST['meta_value'] ) ? $_POST['meta_value'] : array();
|
||||||
|
|
||||||
foreach ( $meta_keys as $id => $value ) {
|
foreach ( $meta_keys as $id => $meta_key ) {
|
||||||
|
$meta_value = ( empty( $meta_values[ $id ] ) && ! is_numeric( $meta_values[ $id ] ) ) ? '' : $meta_values[ $id ];
|
||||||
$wpdb->update(
|
$wpdb->update(
|
||||||
$wpdb->prefix . "woocommerce_order_itemmeta",
|
$wpdb->prefix . "woocommerce_order_itemmeta",
|
||||||
array(
|
array(
|
||||||
'meta_key' => $value,
|
'meta_key' => $meta_key,
|
||||||
'meta_value' => empty( $meta_values[ $id ] ) ? '' : $meta_values[ $id ]
|
'meta_value' => $meta_value
|
||||||
),
|
),
|
||||||
array( 'meta_id' => $id ),
|
array( 'meta_id' => $id ),
|
||||||
array( '%s', '%s' ),
|
array( '%s', '%s' ),
|
||||||
|
@ -944,15 +935,7 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action( 'woocommerce_after_resend_order_emails', $order, $resend_emails );
|
do_action( 'woocommerce_after_resend_order_email', $order, $email_to_send );
|
||||||
|
|
||||||
} elseif ( $action == 'refund_order' ) {
|
|
||||||
|
|
||||||
$order->refund_order( true );
|
|
||||||
|
|
||||||
} elseif ( $action == 'manual_refund_order' ) {
|
|
||||||
|
|
||||||
$order->refund_order( false );
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -75,12 +75,10 @@ function woocommerce_order_downloads_meta_box() {
|
||||||
|
|
||||||
if ( $products ) foreach ( $products as $product ) {
|
if ( $products ) foreach ( $products as $product ) {
|
||||||
|
|
||||||
$sku = get_post_meta( $product->ID, '_sku', true );
|
$product_object = get_product( $product->ID );
|
||||||
|
$product_name = woocommerce_get_formatted_product_name( $product_object );
|
||||||
|
|
||||||
if ( $sku )
|
echo '<option value="' . esc_attr( $product->ID ) . '">' . esc_html( $product_name ) . '</option>';
|
||||||
$sku = ' SKU: ' . $sku;
|
|
||||||
|
|
||||||
echo '<option value="' . esc_attr( $product->ID ) . '">' . esc_html( $product->post_title . ' (#' . $product->ID . '' . $sku . ')' ) . '</option>';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -124,7 +122,7 @@ function woocommerce_order_downloads_meta_box() {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
alert('<?php _e( 'Could not grant access - the user may already have permission for this file.', 'woocommerce' ); ?>');
|
alert('<?php _e( 'Could not grant access - the user may already have permission for this file or billing email is not set. Ensure the billing email is set, and the order has been saved.', 'woocommerce' ); ?>');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,9 @@ function woocommerce_order_notes_meta_box() {
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
jQuery('a.add_note').click(function(){
|
jQuery('#woocommerce-order-notes')
|
||||||
|
|
||||||
|
.on( 'click', 'a.add_note', function() {
|
||||||
|
|
||||||
if (!jQuery('textarea#add_order_note').val()) return;
|
if (!jQuery('textarea#add_order_note').val()) return;
|
||||||
|
|
||||||
|
@ -91,9 +93,9 @@ function woocommerce_order_notes_meta_box() {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
});
|
})
|
||||||
|
|
||||||
jQuery('a.delete_note').live('click', function(){
|
.on( 'click', 'a.delete_note', function() {
|
||||||
|
|
||||||
var note = jQuery(this).closest('li.note');
|
var note = jQuery(this).closest('li.note');
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ function variable_product_type_options() {
|
||||||
<div class="squeezer">
|
<div class="squeezer">
|
||||||
<h4><?php _e( 'Before adding variations, add and save some attributes on the <strong>Attributes</strong> tab.', 'woocommerce' ); ?></h4>
|
<h4><?php _e( 'Before adding variations, add and save some attributes on the <strong>Attributes</strong> tab.', 'woocommerce' ); ?></h4>
|
||||||
|
|
||||||
<p class="submit"><a class="button-primary" href="http://www.woothemes.com/woocommerce-docs/user-guide/product-variations/" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
<p class="submit"><a class="button-primary" href="http://docs.woothemes.com/document/product-variations/" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -74,6 +74,10 @@ function variable_product_type_options() {
|
||||||
<a href="#" class="close_all"><?php _e( 'Close all', 'woocommerce' ); ?></a><a href="#" class="expand_all"><?php _e( 'Expand all', 'woocommerce' ); ?></a>
|
<a href="#" class="close_all"><?php _e( 'Close all', 'woocommerce' ); ?></a><a href="#" class="expand_all"><?php _e( 'Expand all', 'woocommerce' ); ?></a>
|
||||||
<strong><?php _e( 'Bulk edit:', 'woocommerce' ); ?></strong>
|
<strong><?php _e( 'Bulk edit:', 'woocommerce' ); ?></strong>
|
||||||
<select id="field_to_edit">
|
<select id="field_to_edit">
|
||||||
|
<option value="toggle_enabled"><?php _e( 'Toggle "Enabled"', 'woocommerce' ); ?></option>
|
||||||
|
<option value="toggle_downloadable"><?php _e( 'Toggle "Downloadable"', 'woocommerce' ); ?></option>
|
||||||
|
<option value="toggle_virtual"><?php _e( 'Toggle "Virtual"', 'woocommerce' ); ?></option>
|
||||||
|
<option value="delete_all"><?php _e( 'Delete all variations', 'woocommerce' ); ?></option>
|
||||||
<option value="variable_regular_price"><?php _e( 'Prices', 'woocommerce' ); ?></option>
|
<option value="variable_regular_price"><?php _e( 'Prices', 'woocommerce' ); ?></option>
|
||||||
<option value="variable_sale_price"><?php _e( 'Sale prices', 'woocommerce' ); ?></option>
|
<option value="variable_sale_price"><?php _e( 'Sale prices', 'woocommerce' ); ?></option>
|
||||||
<option value="variable_stock"><?php _e( 'Stock', 'woocommerce' ); ?></option>
|
<option value="variable_stock"><?php _e( 'Stock', 'woocommerce' ); ?></option>
|
||||||
|
@ -84,9 +88,9 @@ function variable_product_type_options() {
|
||||||
<option value="variable_file_paths" rel="textarea"><?php _e( 'File Path', 'woocommerce' ); ?></option>
|
<option value="variable_file_paths" rel="textarea"><?php _e( 'File Path', 'woocommerce' ); ?></option>
|
||||||
<option value="variable_download_limit"><?php _e( 'Download limit', 'woocommerce' ); ?></option>
|
<option value="variable_download_limit"><?php _e( 'Download limit', 'woocommerce' ); ?></option>
|
||||||
<option value="variable_download_expiry"><?php _e( 'Download Expiry', 'woocommerce' ); ?></option>
|
<option value="variable_download_expiry"><?php _e( 'Download Expiry', 'woocommerce' ); ?></option>
|
||||||
|
<?php do_action( 'woocommerce_variable_product_bulk_edit_actions' ); ?>
|
||||||
</select>
|
</select>
|
||||||
<a class="button bulk_edit plus"><?php _e( 'Edit', 'woocommerce' ); ?></a>
|
<a class="button bulk_edit"><?php _e( 'Go', 'woocommerce' ); ?></a>
|
||||||
<a class="button toggle toggle_downloadable" href="#"><?php _e( 'Downloadable', 'woocommerce' ); ?></a> <a class="button toggle toggle_virtual" href="#"><?php _e( 'Virtual', 'woocommerce' ); ?></a> <a class="button toggle toggle_enabled" href="#"><?php _e( 'Enabled', 'woocommerce' ); ?></a> <a href="#" class="button delete_variations"><?php _e( 'Delete all', 'woocommerce' ); ?></a>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="woocommerce_variations wc-metaboxes">
|
<div class="woocommerce_variations wc-metaboxes">
|
||||||
|
@ -131,7 +135,7 @@ function variable_product_type_options() {
|
||||||
|
|
||||||
$variation_id = absint( $variation->ID );
|
$variation_id = absint( $variation->ID );
|
||||||
$variation_post_status = esc_attr( $variation->post_status );
|
$variation_post_status = esc_attr( $variation->post_status );
|
||||||
$variation_data = get_post_custom( $variation_id );
|
$variation_data = get_post_meta( $variation_id );
|
||||||
$variation_data['variation_post_id'] = $variation_id;
|
$variation_data['variation_post_id'] = $variation_id;
|
||||||
|
|
||||||
// Grab shipping classes
|
// Grab shipping classes
|
||||||
|
@ -207,13 +211,19 @@ function variable_product_type_options() {
|
||||||
|
|
||||||
// Get terms for attribute taxonomy or value if its a custom attribute
|
// Get terms for attribute taxonomy or value if its a custom attribute
|
||||||
if ( $attribute['is_taxonomy'] ) {
|
if ( $attribute['is_taxonomy'] ) {
|
||||||
|
|
||||||
$post_terms = wp_get_post_terms( $post->ID, $attribute['name'] );
|
$post_terms = wp_get_post_terms( $post->ID, $attribute['name'] );
|
||||||
|
|
||||||
foreach ( $post_terms as $term )
|
foreach ( $post_terms as $term )
|
||||||
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . esc_html( $term->name ) . '</option>';
|
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . apply_filters( 'woocommerce_variation_option_name', esc_html( $term->name ) ) . '</option>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$options = explode( '|', $attribute['value'] );
|
|
||||||
|
$options = array_map( 'trim', explode( '|', $attribute['value'] ) );
|
||||||
|
|
||||||
foreach ( $options as $option )
|
foreach ( $options as $option )
|
||||||
echo '<option ' . selected( $variation_selected_value, $option, false ) . ' value="' . esc_attr( $option ) . '">' . ucfirst( esc_html( $option ) ) . '</option>';
|
echo '<option ' . selected( sanitize_title( $variation_selected_value ), sanitize_title( $option ), false ) . ' value="' . esc_attr( sanitize_title( $option ) ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</select>';
|
echo '</select>';
|
||||||
|
@ -231,6 +241,25 @@ function variable_product_type_options() {
|
||||||
?>
|
?>
|
||||||
jQuery(function(){
|
jQuery(function(){
|
||||||
|
|
||||||
|
var variation_sortable_options = {
|
||||||
|
items:'.woocommerce_variation',
|
||||||
|
cursor:'move',
|
||||||
|
axis:'y',
|
||||||
|
handle: 'h3',
|
||||||
|
scrollSensitivity:40,
|
||||||
|
forcePlaceholderSize: true,
|
||||||
|
helper: 'clone',
|
||||||
|
opacity: 0.65,
|
||||||
|
placeholder: 'wc-metabox-sortable-placeholder',
|
||||||
|
start:function(event,ui){
|
||||||
|
ui.item.css('background-color','#f6f6f6');
|
||||||
|
},
|
||||||
|
stop:function(event,ui){
|
||||||
|
ui.item.removeAttr('style');
|
||||||
|
variation_row_indexes();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Add a variation
|
// Add a variation
|
||||||
jQuery('#variable_product_options').on('click', 'button.add_variation', function(){
|
jQuery('#variable_product_options').on('click', 'button.add_variation', function(){
|
||||||
|
|
||||||
|
@ -258,7 +287,7 @@ function variable_product_type_options() {
|
||||||
jQuery('input.variable_is_downloadable, input.variable_is_virtual').change();
|
jQuery('input.variable_is_downloadable, input.variable_is_virtual').change();
|
||||||
|
|
||||||
jQuery('.woocommerce_variations').unblock();
|
jQuery('.woocommerce_variations').unblock();
|
||||||
|
jQuery('#variable_product_options').trigger('woocommerce_variations_added');
|
||||||
});
|
});
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -298,6 +327,7 @@ function variable_product_type_options() {
|
||||||
|
|
||||||
$('#variable_product_options').load( this_page + ' #variable_product_options_inner', function() {
|
$('#variable_product_options').load( this_page + ' #variable_product_options_inner', function() {
|
||||||
$('#variable_product_options').unblock();
|
$('#variable_product_options').unblock();
|
||||||
|
jQuery('#variable_product_options').trigger('woocommerce_variations_added');
|
||||||
} );
|
} );
|
||||||
} else {
|
} else {
|
||||||
$('#variable_product_options').unblock();
|
$('#variable_product_options').unblock();
|
||||||
|
@ -344,71 +374,73 @@ function variable_product_type_options() {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('#variable_product_options').on('click', 'a.delete_variations', function(){
|
jQuery('.wc-metaboxes-wrapper').on('click', 'a.bulk_edit', function(event){
|
||||||
var answer = confirm('<?php _e( 'Are you sure you want to delete all variations? This cannot be undone.', 'woocommerce' ); ?>');
|
var field_to_edit = jQuery('select#field_to_edit').val();
|
||||||
if (answer){
|
|
||||||
|
|
||||||
var answer = confirm('<?php _e( 'Last warning, are you sure?', 'woocommerce' ); ?>');
|
if ( field_to_edit == 'toggle_enabled' ) {
|
||||||
|
var checkbox = jQuery('input[name^="variable_enabled"]');
|
||||||
|
checkbox.attr('checked', !checkbox.attr('checked'));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if ( field_to_edit == 'toggle_downloadable' ) {
|
||||||
|
var checkbox = jQuery('input[name^="variable_is_downloadable"]');
|
||||||
|
checkbox.attr('checked', !checkbox.attr('checked'));
|
||||||
|
jQuery('input.variable_is_downloadable').change();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if ( field_to_edit == 'toggle_virtual' ) {
|
||||||
|
var checkbox = jQuery('input[name^="variable_is_virtual"]');
|
||||||
|
checkbox.attr('checked', !checkbox.attr('checked'));
|
||||||
|
jQuery('input.variable_is_virtual').change();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if ( field_to_edit == 'delete_all' ) {
|
||||||
|
|
||||||
if (answer) {
|
var answer = confirm('<?php _e( 'Are you sure you want to delete all variations? This cannot be undone.', 'woocommerce' ); ?>');
|
||||||
|
if (answer){
|
||||||
|
|
||||||
var variation_ids = [];
|
var answer = confirm('<?php _e( 'Last warning, are you sure?', 'woocommerce' ); ?>');
|
||||||
|
|
||||||
jQuery('.woocommerce_variations .woocommerce_variation').block({ message: null, overlayCSS: { background: '#fff url(<?php echo $woocommerce->plugin_url(); ?>/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6 } });
|
if (answer) {
|
||||||
|
|
||||||
jQuery('.woocommerce_variations .woocommerce_variation .remove_variation').each(function(){
|
var variation_ids = [];
|
||||||
|
|
||||||
var variation = jQuery(this).attr('rel');
|
jQuery('.woocommerce_variations .woocommerce_variation').block({ message: null, overlayCSS: { background: '#fff url(<?php echo $woocommerce->plugin_url(); ?>/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6 } });
|
||||||
if (variation>0) {
|
|
||||||
variation_ids.push(variation);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var data = {
|
jQuery('.woocommerce_variations .woocommerce_variation .remove_variation').each(function(){
|
||||||
action: 'woocommerce_remove_variations',
|
|
||||||
variation_ids: variation_ids,
|
|
||||||
security: '<?php echo wp_create_nonce("delete-variations"); ?>'
|
|
||||||
};
|
|
||||||
|
|
||||||
jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', data, function(response) {
|
var variation = jQuery(this).attr('rel');
|
||||||
jQuery('.woocommerce_variations .woocommerce_variation').fadeOut('300', function(){
|
if (variation>0) {
|
||||||
jQuery('.woocommerce_variations .woocommerce_variation').remove();
|
variation_ids.push(variation);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
var data = {
|
||||||
|
action: 'woocommerce_remove_variations',
|
||||||
|
variation_ids: variation_ids,
|
||||||
|
security: '<?php echo wp_create_nonce("delete-variations"); ?>'
|
||||||
|
};
|
||||||
|
|
||||||
|
jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', data, function(response) {
|
||||||
|
jQuery('.woocommerce_variations .woocommerce_variation').fadeOut('300', function(){
|
||||||
|
jQuery('.woocommerce_variations .woocommerce_variation').remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
var input_tag = jQuery('select#field_to_edit :selected').attr('rel') ? jQuery('select#field_to_edit :selected').attr('rel') : 'input';
|
||||||
|
|
||||||
|
var value = prompt("<?php _e( 'Enter a value', 'woocommerce' ); ?>");
|
||||||
|
jQuery(input_tag + '[name^="' + field_to_edit + '["]').val( value ).change();
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery('a.bulk_edit').click(function() {
|
|
||||||
var field_to_edit = jQuery('select#field_to_edit').val();
|
|
||||||
var input_tag = jQuery('select#field_to_edit :selected').attr('rel') ? jQuery('select#field_to_edit :selected').attr('rel') : 'input';
|
|
||||||
|
|
||||||
var value = prompt("<?php _e( 'Enter a value', 'woocommerce' ); ?>");
|
|
||||||
jQuery(input_tag + '[name^="' + field_to_edit + '"]').val( value );
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery('a.toggle_virtual').click(function(){
|
|
||||||
var checkbox = jQuery('input[name^="variable_is_virtual"]');
|
|
||||||
checkbox.attr('checked', !checkbox.attr('checked'));
|
|
||||||
jQuery('input.variable_is_virtual').change();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery('a.toggle_downloadable').click(function(){
|
|
||||||
var checkbox = jQuery('input[name^="variable_is_downloadable"]');
|
|
||||||
checkbox.attr('checked', !checkbox.attr('checked'));
|
|
||||||
jQuery('input.variable_is_downloadable').change();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
jQuery('a.toggle_enabled').click(function(){
|
|
||||||
var checkbox = jQuery('input[name^="variable_enabled"]');
|
|
||||||
checkbox.attr('checked', !checkbox.attr('checked'));
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('#variable_product_options').on('change', 'input.variable_is_downloadable', function(){
|
jQuery('#variable_product_options').on('change', 'input.variable_is_downloadable', function(){
|
||||||
|
@ -434,24 +466,11 @@ function variable_product_type_options() {
|
||||||
jQuery('input.variable_is_downloadable, input.variable_is_virtual').change();
|
jQuery('input.variable_is_downloadable, input.variable_is_virtual').change();
|
||||||
|
|
||||||
// Ordering
|
// Ordering
|
||||||
$('.woocommerce_variations').sortable({
|
$('#variable_product_options').on( 'woocommerce_variations_added', function() {
|
||||||
items:'.woocommerce_variation',
|
$('.woocommerce_variations').sortable( variation_sortable_options );
|
||||||
cursor:'move',
|
} );
|
||||||
axis:'y',
|
|
||||||
handle: 'h3',
|
$('.woocommerce_variations').sortable( variation_sortable_options );
|
||||||
scrollSensitivity:40,
|
|
||||||
forcePlaceholderSize: true,
|
|
||||||
helper: 'clone',
|
|
||||||
opacity: 0.65,
|
|
||||||
placeholder: 'wc-metabox-sortable-placeholder',
|
|
||||||
start:function(event,ui){
|
|
||||||
ui.item.css('background-color','#f6f6f6');
|
|
||||||
},
|
|
||||||
stop:function(event,ui){
|
|
||||||
ui.item.removeAttr('style');
|
|
||||||
variation_row_indexes();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function variation_row_indexes() {
|
function variation_row_indexes() {
|
||||||
$('.woocommerce_variations .woocommerce_variation').each(function(index, el){
|
$('.woocommerce_variations .woocommerce_variation').each(function(index, el){
|
||||||
|
@ -459,53 +478,69 @@ function variable_product_type_options() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var current_field_wrapper;
|
// Uploader
|
||||||
|
var variable_image_frame;
|
||||||
|
var setting_variation_image_id;
|
||||||
|
var setting_variation_image;
|
||||||
|
var wp_media_post_id = wp.media.model.settings.post.id;
|
||||||
|
|
||||||
window.send_to_editor_default = window.send_to_editor;
|
jQuery('#variable_product_options').on('click', '.upload_image_button', function( event ) {
|
||||||
|
|
||||||
jQuery('#variable_product_options').on('click', '.upload_image_button', function(){
|
var $button = jQuery( this );
|
||||||
|
var post_id = $button.attr('rel');
|
||||||
|
var $parent = $button.closest('.upload_image');
|
||||||
|
setting_variation_image = $parent;
|
||||||
|
setting_variation_image_id = post_id;
|
||||||
|
|
||||||
var post_id = jQuery(this).attr('rel');
|
event.preventDefault();
|
||||||
var parent = jQuery(this).parent();
|
|
||||||
current_field_wrapper = parent;
|
|
||||||
|
|
||||||
if (jQuery(this).is('.remove')) {
|
if ( $button.is('.remove') ) {
|
||||||
|
|
||||||
jQuery('.upload_image_id', current_field_wrapper).val('');
|
setting_variation_image.find( '.upload_image_id' ).val( '' );
|
||||||
jQuery('img', current_field_wrapper).attr('src', '<?php echo woocommerce_placeholder_img_src(); ?>');
|
setting_variation_image.find( 'img' ).attr( 'src', '<?php echo woocommerce_placeholder_img_src(); ?>' );
|
||||||
jQuery(this).removeClass('remove');
|
setting_variation_image.find( '.upload_image_button' ).removeClass( 'remove' );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
window.send_to_editor = window.send_to_cproduct;
|
// If the media frame already exists, reopen it.
|
||||||
formfield = jQuery('.upload_image_id', parent).attr('name');
|
if ( variable_image_frame ) {
|
||||||
tb_show('', 'media-upload.php?post_id=' + post_id + '&type=image&TB_iframe=true');
|
variable_image_frame.uploader.uploader.param( 'post_id', setting_variation_image_id );
|
||||||
|
variable_image_frame.open();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
wp.media.model.settings.post.id = setting_variation_image_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the media frame.
|
||||||
|
variable_image_frame = wp.media.frames.variable_image = wp.media({
|
||||||
|
// Set the title of the modal.
|
||||||
|
title: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',
|
||||||
|
button: {
|
||||||
|
text: '<?php _e( 'Set variation image', 'woocommerce' ); ?>'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// When an image is selected, run a callback.
|
||||||
|
variable_image_frame.on( 'select', function() {
|
||||||
|
|
||||||
|
attachment = variable_image_frame.state().get('selection').first().toJSON();
|
||||||
|
|
||||||
|
setting_variation_image.find( '.upload_image_id' ).val( attachment.id );
|
||||||
|
setting_variation_image.find( '.upload_image_button' ).addClass( 'remove' );
|
||||||
|
setting_variation_image.find( 'img' ).attr( 'src', attachment.url );
|
||||||
|
|
||||||
|
wp.media.model.settings.post.id = wp_media_post_id;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Finally, open the modal.
|
||||||
|
variable_image_frame.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.send_to_cproduct = function(html) {
|
// Restore ID
|
||||||
|
jQuery('a.add_media').on('click', function() {
|
||||||
jQuery('body').append('<div id="temp_image">' + html + '</div>');
|
wp.media.model.settings.post.id = wp_media_post_id;
|
||||||
|
} );
|
||||||
var img = jQuery('#temp_image').find('img');
|
|
||||||
|
|
||||||
imgurl = img.attr('src');
|
|
||||||
imgclass = img.attr('class');
|
|
||||||
imgid = parseInt(imgclass.replace(/\D/g, ''), 10);
|
|
||||||
|
|
||||||
jQuery('.upload_image_id', current_field_wrapper).val(imgid);
|
|
||||||
jQuery('.upload_image_button', current_field_wrapper).addClass('remove');
|
|
||||||
|
|
||||||
jQuery('img', current_field_wrapper).attr('src', imgurl);
|
|
||||||
tb_remove();
|
|
||||||
jQuery('#temp_image').remove();
|
|
||||||
|
|
||||||
window.send_to_editor = window.send_to_editor_default;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
|
@ -661,7 +696,7 @@ function process_product_meta_variable( $post_id ) {
|
||||||
else
|
else
|
||||||
update_post_meta( $variation_id, '_price', $regular_price );
|
update_post_meta( $variation_id, '_price', $regular_price );
|
||||||
|
|
||||||
if ( $date_from && strtotime( $date_from ) < strtotime( 'NOW', current_time( 'timestamp' ) ) )
|
if ( $sale_price != '' && $date_from && strtotime( $date_from ) < strtotime( 'NOW', current_time( 'timestamp' ) ) )
|
||||||
update_post_meta( $variation_id, '_price', $sale_price );
|
update_post_meta( $variation_id, '_price', $sale_price );
|
||||||
|
|
||||||
if ( $date_to && strtotime( $date_to ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ) {
|
if ( $date_to && strtotime( $date_to ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ) {
|
||||||
|
@ -686,7 +721,7 @@ function process_product_meta_variable( $post_id ) {
|
||||||
$file_paths = explode( "\n", $file_paths );
|
$file_paths = explode( "\n", $file_paths );
|
||||||
|
|
||||||
foreach ( $file_paths as $file_path ) {
|
foreach ( $file_paths as $file_path ) {
|
||||||
$file_path = woocommerce_clean( $file_path );
|
$file_path = trim( $file_path );
|
||||||
$_file_paths[ md5( $file_path ) ] = $file_path;
|
$_file_paths[ md5( $file_path ) ] = $file_path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -702,19 +737,22 @@ function process_product_meta_variable( $post_id ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save shipping class
|
// Save shipping class
|
||||||
$variable_shipping_class[ $i ] = ( $variable_shipping_class[ $i ] ) ? (int) $variable_shipping_class[ $i ] : '';
|
$variable_shipping_class[ $i ] = $variable_shipping_class[ $i ] > 0 ? (int) $variable_shipping_class[ $i ] : '';
|
||||||
wp_set_object_terms( $variation_id, $variable_shipping_class[ $i ], 'product_shipping_class');
|
wp_set_object_terms( $variation_id, $variable_shipping_class[ $i ], 'product_shipping_class');
|
||||||
|
|
||||||
// Remove old taxonomies attributes so data is kept up to date
|
// Remove old taxonomies attributes so data is kept up to date
|
||||||
if ( $variation_id )
|
if ( $variation_id ) {
|
||||||
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key LIKE %s AND post_id = %d;", 'attribute_%', $variation_id ) );
|
$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE 'attribute_%%' AND post_id = %d;", $variation_id ) );
|
||||||
|
wp_cache_delete( $variation_id, 'post_meta');
|
||||||
|
}
|
||||||
|
|
||||||
// Update taxonomies
|
// Update taxonomies
|
||||||
foreach ( $attributes as $attribute ) {
|
foreach ( $attributes as $attribute ) {
|
||||||
|
|
||||||
if ( $attribute['is_variation'] ) {
|
if ( $attribute['is_variation'] ) {
|
||||||
|
|
||||||
$value = woocommerce_clean( $_POST[ 'attribute_' . sanitize_title( $attribute['name'] ) ][ $i ] );
|
// Don't use woocommerce_clean as it destroys sanitized characters
|
||||||
|
$value = sanitize_title( trim( stripslashes( $_POST[ 'attribute_' . sanitize_title( $attribute['name'] ) ][ $i ] ) ) );
|
||||||
|
|
||||||
update_post_meta( $variation_id, 'attribute_' . sanitize_title( $attribute['name'] ), $value );
|
update_post_meta( $variation_id, 'attribute_' . sanitize_title( $attribute['name'] ), $value );
|
||||||
}
|
}
|
||||||
|
@ -781,7 +819,10 @@ function process_product_meta_variable( $post_id ) {
|
||||||
|
|
||||||
foreach ( $attributes as $attribute ) {
|
foreach ( $attributes as $attribute ) {
|
||||||
if ( $attribute['is_variation'] ) {
|
if ( $attribute['is_variation'] ) {
|
||||||
$value = woocommerce_clean( $_POST[ 'default_attribute_' . sanitize_title( $attribute['name'] ) ] );
|
|
||||||
|
// Don't use woocommerce_clean as it destroys sanitized characters
|
||||||
|
$value = sanitize_title( trim( stripslashes( $_POST[ 'default_attribute_' . sanitize_title( $attribute['name'] ) ] ) ) );
|
||||||
|
|
||||||
if ( $value )
|
if ( $value )
|
||||||
$default_attributes[ sanitize_title( $attribute['name'] ) ] = $value;
|
$default_attributes[ sanitize_title( $attribute['name'] ) ] = $value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ function woocommerce_product_data_box() {
|
||||||
$thepostid = $post->ID;
|
$thepostid = $post->ID;
|
||||||
|
|
||||||
if ( $terms = wp_get_object_terms( $post->ID, 'product_type' ) )
|
if ( $terms = wp_get_object_terms( $post->ID, 'product_type' ) )
|
||||||
$product_type = current( $terms )->slug;
|
$product_type = sanitize_title( current( $terms )->name );
|
||||||
else
|
else
|
||||||
$product_type = 'simple';
|
$product_type = 'simple';
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ function woocommerce_product_data_box() {
|
||||||
|
|
||||||
echo '<p class="form-field"><label for="_file_paths">' . __( 'File paths (one per line)', 'woocommerce' ) . ':</label>
|
echo '<p class="form-field"><label for="_file_paths">' . __( 'File paths (one per line)', 'woocommerce' ) . ':</label>
|
||||||
<textarea style="float:left;height:5em;" id="_file_paths" class="short file_paths" cols="20" rows="3" placeholder="' . __( 'File paths/URLs, one per line', 'woocommerce' ) . '" name="_file_paths" wrap="off">' . esc_textarea( $file_paths ) . '</textarea>
|
<textarea style="float:left;height:5em;" id="_file_paths" class="short file_paths" cols="20" rows="3" placeholder="' . __( 'File paths/URLs, one per line', 'woocommerce' ) . '" name="_file_paths" wrap="off">' . esc_textarea( $file_paths ) . '</textarea>
|
||||||
<input type="button" class="upload_file_button button" value="' . __( 'Upload a file', 'woocommerce' ) . '" />
|
<input type="button" class="upload_file_button button" data-choose="' . __( 'Choose a file', 'woocommerce' ) . '" data-update="' . __( 'Insert file URL', 'woocommerce' ) . '" value="' . __( 'Choose a file', 'woocommerce' ) . '" />
|
||||||
</p>';
|
</p>';
|
||||||
|
|
||||||
// Download Limit
|
// Download Limit
|
||||||
|
@ -170,27 +170,31 @@ function woocommerce_product_data_box() {
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
echo '<div class="options_group show_if_simple show_if_external show_if_variable">';
|
if ( get_option( 'woocommerce_calc_taxes' ) == 'yes' ) {
|
||||||
|
|
||||||
// Tax
|
echo '<div class="options_group show_if_simple show_if_external show_if_variable">';
|
||||||
woocommerce_wp_select( array( 'id' => '_tax_status', 'label' => __( 'Tax Status', 'woocommerce' ), 'options' => array(
|
|
||||||
'taxable' => __( 'Taxable', 'woocommerce' ),
|
|
||||||
'shipping' => __( 'Shipping only', 'woocommerce' ),
|
|
||||||
'none' => __( 'None', 'woocommerce' )
|
|
||||||
) ) );
|
|
||||||
|
|
||||||
$tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ) );
|
// Tax
|
||||||
$classes_options = array();
|
woocommerce_wp_select( array( 'id' => '_tax_status', 'label' => __( 'Tax Status', 'woocommerce' ), 'options' => array(
|
||||||
$classes_options[''] = __( 'Standard', 'woocommerce' );
|
'taxable' => __( 'Taxable', 'woocommerce' ),
|
||||||
if ( $tax_classes )
|
'shipping' => __( 'Shipping only', 'woocommerce' ),
|
||||||
foreach ( $tax_classes as $class )
|
'none' => __( 'None', 'woocommerce' )
|
||||||
$classes_options[ sanitize_title( $class ) ] = esc_html( $class );
|
) ) );
|
||||||
|
|
||||||
woocommerce_wp_select( array( 'id' => '_tax_class', 'label' => __( 'Tax Class', 'woocommerce' ), 'options' => $classes_options ) );
|
$tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ) );
|
||||||
|
$classes_options = array();
|
||||||
|
$classes_options[''] = __( 'Standard', 'woocommerce' );
|
||||||
|
if ( $tax_classes )
|
||||||
|
foreach ( $tax_classes as $class )
|
||||||
|
$classes_options[ sanitize_title( $class ) ] = esc_html( $class );
|
||||||
|
|
||||||
do_action( 'woocommerce_product_options_tax' );
|
woocommerce_wp_select( array( 'id' => '_tax_class', 'label' => __( 'Tax Class', 'woocommerce' ), 'options' => $classes_options ) );
|
||||||
|
|
||||||
echo '</div>';
|
do_action( 'woocommerce_product_options_tax' );
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
do_action( 'woocommerce_product_options_general_product_data' );
|
do_action( 'woocommerce_product_options_general_product_data' );
|
||||||
?>
|
?>
|
||||||
|
@ -205,7 +209,7 @@ function woocommerce_product_data_box() {
|
||||||
if (get_option('woocommerce_manage_stock')=='yes') {
|
if (get_option('woocommerce_manage_stock')=='yes') {
|
||||||
|
|
||||||
// manage stock
|
// manage stock
|
||||||
woocommerce_wp_checkbox( array( 'id' => '_manage_stock', 'wrapper_class' => 'show_if_simple show_if_variable', 'label' => __('Manage stock?', 'woocommerce' ) ) );
|
woocommerce_wp_checkbox( array( 'id' => '_manage_stock', 'wrapper_class' => 'show_if_simple show_if_variable', 'label' => __('Manage stock?', 'woocommerce' ), 'description' => __( 'Enable stock management at product level', 'woocommerce' ) ) );
|
||||||
|
|
||||||
do_action('woocommerce_product_options_stock');
|
do_action('woocommerce_product_options_stock');
|
||||||
|
|
||||||
|
@ -277,7 +281,7 @@ function woocommerce_product_data_box() {
|
||||||
// Size fields
|
// Size fields
|
||||||
if( get_option( 'woocommerce_enable_dimensions', true ) !== 'no' ) :
|
if( get_option( 'woocommerce_enable_dimensions', true ) !== 'no' ) :
|
||||||
?><p class="form-field dimensions_field">
|
?><p class="form-field dimensions_field">
|
||||||
<label for"product_length"><?php echo __( 'Dimensions', 'woocommerce' ) . ' (' . get_option( 'woocommerce_dimension_unit' ) . ')'; ?></label>
|
<label for="product_length"><?php echo __( 'Dimensions', 'woocommerce' ) . ' (' . get_option( 'woocommerce_dimension_unit' ) . ')'; ?></label>
|
||||||
<span class="wrap">
|
<span class="wrap">
|
||||||
<input id="product_length" placeholder="<?php _e( 'Length', 'woocommerce' ); ?>" class="input-text" size="6" type="number" name="_length" value="<?php echo esc_attr( get_post_meta( $thepostid, '_length', true ) ); ?>" step="any" min="0" />
|
<input id="product_length" placeholder="<?php _e( 'Length', 'woocommerce' ); ?>" class="input-text" size="6" type="number" name="_length" value="<?php echo esc_attr( get_post_meta( $thepostid, '_length', true ) ); ?>" step="any" min="0" />
|
||||||
<input placeholder="<?php _e( 'Width', 'woocommerce' ); ?>" class="input-text" size="6" type="number" name="_width" value="<?php echo esc_attr( get_post_meta( $thepostid, '_width', true ) ); ?>" step="any" min="0" />
|
<input placeholder="<?php _e( 'Width', 'woocommerce' ); ?>" class="input-text" size="6" type="number" name="_width" value="<?php echo esc_attr( get_post_meta( $thepostid, '_width', true ) ); ?>" step="any" min="0" />
|
||||||
|
@ -328,8 +332,11 @@ function woocommerce_product_data_box() {
|
||||||
<div class="woocommerce_attributes wc-metaboxes">
|
<div class="woocommerce_attributes wc-metaboxes">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$attribute_taxonomies = $woocommerce->get_attribute_taxonomies(); // Array of defined attribute taxonomies
|
// Array of defined attribute taxonomies
|
||||||
$attributes = maybe_unserialize( get_post_meta( $thepostid, '_product_attributes', true ) ); // Product attributes - taxonomies and custom, ordered, with visibility and variation attributes set
|
$attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
|
||||||
|
|
||||||
|
// Product attributes - taxonomies and custom, ordered, with visibility and variation attributes set
|
||||||
|
$attributes = maybe_unserialize( get_post_meta( $thepostid, '_product_attributes', true ) );
|
||||||
|
|
||||||
$i = -1;
|
$i = -1;
|
||||||
|
|
||||||
|
@ -380,7 +387,7 @@ function woocommerce_product_data_box() {
|
||||||
$all_terms = get_terms( $attribute_taxonomy_name, 'orderby=name&hide_empty=0' );
|
$all_terms = get_terms( $attribute_taxonomy_name, 'orderby=name&hide_empty=0' );
|
||||||
if ( $all_terms ) {
|
if ( $all_terms ) {
|
||||||
foreach ( $all_terms as $term ) {
|
foreach ( $all_terms as $term ) {
|
||||||
$has_term = has_term( $term->slug, $attribute_taxonomy_name, $thepostid ) ? 1 : 0;
|
$has_term = has_term( $term->term_id, $attribute_taxonomy_name, $thepostid ) ? 1 : 0;
|
||||||
echo '<option value="' . $term->slug . '" ' . selected( $has_term, 1, false ) . '>' . $term->name . '</option>';
|
echo '<option value="' . $term->slug . '" ' . selected( $has_term, 1, false ) . '>' . $term->name . '</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -399,22 +406,37 @@ function woocommerce_product_data_box() {
|
||||||
$values = array();
|
$values = array();
|
||||||
foreach ( $post_terms as $term )
|
foreach ( $post_terms as $term )
|
||||||
$values[] = $term->name;
|
$values[] = $term->name;
|
||||||
echo implode( '|', $values );
|
echo implode( ' | ', $values );
|
||||||
}
|
}
|
||||||
|
|
||||||
?>" placeholder="<?php _e( 'Pipe separate terms', 'woocommerce' ); ?>" />
|
?>" placeholder="<?php _e( 'Pipe (|) separate terms', 'woocommerce' ); ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php do_action( 'woocommerce_product_option_terms', $tax, $i ); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label><input type="checkbox" class="checkbox" <?php if ( ! empty( $attribute['is_visible'] ) ) checked( $attribute['is_visible'], 1 ); ?> name="attribute_visibility[<?php echo $i; ?>]" value="1" /> <?php _e( 'Visible on the product page', 'woocommerce' ); ?></label>
|
<label><input type="checkbox" class="checkbox" <?php
|
||||||
|
|
||||||
|
if ( isset( $attribute['is_visible'] ) )
|
||||||
|
checked( $attribute['is_visible'], 1 );
|
||||||
|
else
|
||||||
|
checked( apply_filters( 'default_attribute_visibility', false, $tax ), true );
|
||||||
|
|
||||||
|
?> name="attribute_visibility[<?php echo $i; ?>]" value="1" /> <?php _e( 'Visible on the product page', 'woocommerce' ); ?></label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div class="enable_variation show_if_variable">
|
<div class="enable_variation show_if_variable">
|
||||||
<label><input type="checkbox" class="checkbox" <?php if ( ! empty( $attribute['is_variation'] ) ) checked( $attribute['is_variation'], 1 ); ?> name="attribute_variation[<?php echo $i; ?>]" value="1" /> <?php _e( 'Used for variations', 'woocommerce' ); ?></label>
|
<label><input type="checkbox" class="checkbox" <?php
|
||||||
|
|
||||||
|
if ( isset( $attribute['is_variation'] ) )
|
||||||
|
checked( $attribute['is_variation'], 1 );
|
||||||
|
else
|
||||||
|
checked( apply_filters( 'default_attribute_variation', false, $tax ), true );
|
||||||
|
|
||||||
|
?> name="attribute_variation[<?php echo $i; ?>]" value="1" /> <?php _e( 'Used for variations', 'woocommerce' ); ?></label>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -427,7 +449,8 @@ function woocommerce_product_data_box() {
|
||||||
|
|
||||||
// Custom Attributes
|
// Custom Attributes
|
||||||
if ( ! empty( $attributes ) ) foreach ( $attributes as $attribute ) {
|
if ( ! empty( $attributes ) ) foreach ( $attributes as $attribute ) {
|
||||||
if ( $attribute['is_taxonomy'] ) continue;
|
if ( $attribute['is_taxonomy'] )
|
||||||
|
continue;
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
@ -498,19 +521,15 @@ function woocommerce_product_data_box() {
|
||||||
<p class="form-field"><label for="upsell_ids"><?php _e( 'Up-Sells', 'woocommerce' ); ?></label>
|
<p class="form-field"><label for="upsell_ids"><?php _e( 'Up-Sells', 'woocommerce' ); ?></label>
|
||||||
<select id="upsell_ids" name="upsell_ids[]" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php _e( 'Search for a product…', 'woocommerce' ); ?>">
|
<select id="upsell_ids" name="upsell_ids[]" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php _e( 'Search for a product…', 'woocommerce' ); ?>">
|
||||||
<?php
|
<?php
|
||||||
$product_ids = array_map( 'absint', get_post_meta( $post->ID, '_upsell_ids', true ) );
|
$upsell_ids = get_post_meta( $post->ID, '_upsell_ids', true );
|
||||||
|
$product_ids = ! empty( $upsell_ids ) ? array_map( 'absint', $upsell_ids ) : null;
|
||||||
if ( $product_ids ) {
|
if ( $product_ids ) {
|
||||||
foreach ( $product_ids as $product_id ) {
|
foreach ( $product_ids as $product_id ) {
|
||||||
$title = get_the_title( $product_id );
|
|
||||||
$sku = get_post_meta( $product_id, '_sku', true );
|
|
||||||
|
|
||||||
if ( ! $title )
|
$product = get_product( $product_id );
|
||||||
continue;
|
$product_name = woocommerce_get_formatted_product_name( $product );
|
||||||
|
|
||||||
if ( ! empty( $sku ) )
|
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product_name ) . '</option>';
|
||||||
$sku = ' (SKU: ' . $sku . ')';
|
|
||||||
|
|
||||||
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $title . $sku ) . '</option>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -519,19 +538,15 @@ function woocommerce_product_data_box() {
|
||||||
<p class="form-field"><label for="crosssell_ids"><?php _e( 'Cross-Sells', 'woocommerce' ); ?></label>
|
<p class="form-field"><label for="crosssell_ids"><?php _e( 'Cross-Sells', 'woocommerce' ); ?></label>
|
||||||
<select id="crosssell_ids" name="crosssell_ids[]" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php _e( 'Search for a product…', 'woocommerce' ); ?>">
|
<select id="crosssell_ids" name="crosssell_ids[]" class="ajax_chosen_select_products" multiple="multiple" data-placeholder="<?php _e( 'Search for a product…', 'woocommerce' ); ?>">
|
||||||
<?php
|
<?php
|
||||||
$product_ids = array_map( 'absint', get_post_meta( $post->ID, '_crosssell_ids', true ) );
|
$crosssell_ids = get_post_meta( $post->ID, '_crosssell_ids', true );
|
||||||
|
$product_ids = ! empty( $crosssell_ids ) ? array_map( 'absint', $crosssell_ids ) : null;
|
||||||
if ( $product_ids ) {
|
if ( $product_ids ) {
|
||||||
foreach ( $product_ids as $product_id ) {
|
foreach ( $product_ids as $product_id ) {
|
||||||
$title = get_the_title( $product_id );
|
|
||||||
$sku = get_post_meta( $product_id, '_sku', true );
|
|
||||||
|
|
||||||
if ( ! $title )
|
$product = get_product( $product_id );
|
||||||
continue;
|
$product_name = woocommerce_get_formatted_product_name( $product );
|
||||||
|
|
||||||
if ( ! empty( $sku ) )
|
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $product_name ) . '</option>';
|
||||||
$sku = ' (SKU: ' . $sku . ')';
|
|
||||||
|
|
||||||
echo '<option value="' . esc_attr( $product_id ) . '" selected="selected">' . esc_html( $title . $sku ) . '</option>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -648,8 +663,9 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
||||||
update_post_meta( $post_id, '_downloadable', $is_downloadable );
|
update_post_meta( $post_id, '_downloadable', $is_downloadable );
|
||||||
update_post_meta( $post_id, '_virtual', $is_virtual );
|
update_post_meta( $post_id, '_virtual', $is_virtual );
|
||||||
|
|
||||||
// Set transient for product type
|
// Gallery Images
|
||||||
set_transient( 'wc_product_type_' . $post_id, $product_type );
|
$attachment_ids = array_filter( explode( ',', woocommerce_clean( $_POST['product_image_gallery'] ) ) );
|
||||||
|
update_post_meta( $post_id, '_product_image_gallery', implode( ',', $attachment_ids ) );
|
||||||
|
|
||||||
// Update post meta
|
// Update post meta
|
||||||
update_post_meta( $post_id, '_regular_price', stripslashes( $_POST['_regular_price'] ) );
|
update_post_meta( $post_id, '_regular_price', stripslashes( $_POST['_regular_price'] ) );
|
||||||
|
@ -735,12 +751,10 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
||||||
|
|
||||||
// Format values
|
// Format values
|
||||||
if ( is_array( $attribute_values[ $i ] ) ) {
|
if ( is_array( $attribute_values[ $i ] ) ) {
|
||||||
$values = array_map('htmlspecialchars', array_map('stripslashes', $attribute_values[ $i ]));
|
$values = array_map( 'woocommerce_clean', $attribute_values[ $i ] );
|
||||||
} else {
|
} else {
|
||||||
// Text based, separate by pipe
|
// Text based, separate by pipe
|
||||||
$values = htmlspecialchars( stripslashes( $attribute_values[ $i ] ) );
|
$values = array_map( 'woocommerce_clean', explode( '|', $attribute_values[ $i ] ) );
|
||||||
$values = explode( '|', $values );
|
|
||||||
$values = array_map( 'trim', $values );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove empty items in the array
|
// Remove empty items in the array
|
||||||
|
@ -757,7 +771,7 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
||||||
if ( $values ) {
|
if ( $values ) {
|
||||||
// Add attribute to array, but don't set values
|
// Add attribute to array, but don't set values
|
||||||
$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
|
$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
|
||||||
'name' => htmlspecialchars( stripslashes( $attribute_names[ $i ] ) ),
|
'name' => woocommerce_clean( $attribute_names[ $i ] ),
|
||||||
'value' => '',
|
'value' => '',
|
||||||
'position' => $attribute_position[ $i ],
|
'position' => $attribute_position[ $i ],
|
||||||
'is_visible' => $is_visible,
|
'is_visible' => $is_visible,
|
||||||
|
@ -766,18 +780,14 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} elseif ( isset( $attribute_values[ $i ] ) ) {
|
||||||
if ( ! $attribute_values[ $i ] ) continue;
|
|
||||||
// Format values
|
|
||||||
$values = esc_html( stripslashes( $attribute_values[ $i ] ) );
|
|
||||||
// Text based, separate by pipe
|
// Text based, separate by pipe
|
||||||
$values = explode( '|', $values );
|
$values = implode( ' | ', array_map( 'woocommerce_clean', explode( '|', $attribute_values[ $i ] ) ) );
|
||||||
$values = array_map( 'trim', $values );
|
|
||||||
$values = implode( '|', $values );
|
|
||||||
|
|
||||||
// Custom attribute - Add attribute to array and set the values
|
// Custom attribute - Add attribute to array and set the values
|
||||||
$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
|
$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
|
||||||
'name' => htmlspecialchars( stripslashes( $attribute_names[ $i ] ) ),
|
'name' => woocommerce_clean( $attribute_names[ $i ] ),
|
||||||
'value' => $values,
|
'value' => $values,
|
||||||
'position' => $attribute_position[ $i ],
|
'position' => $attribute_position[ $i ],
|
||||||
'is_visible' => $is_visible,
|
'is_visible' => $is_visible,
|
||||||
|
@ -1015,29 +1025,6 @@ function woocommerce_process_product_meta( $post_id, $post ) {
|
||||||
add_action('woocommerce_process_product_meta', 'woocommerce_process_product_meta', 1, 2);
|
add_action('woocommerce_process_product_meta', 'woocommerce_process_product_meta', 1, 2);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Change label for insert buttons.
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param mixed $translation
|
|
||||||
* @param mixed $original
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function woocommerce_change_insert_into_post( $translation, $original ) {
|
|
||||||
if ( ! isset( $_REQUEST['from'] ) )
|
|
||||||
return $translation;
|
|
||||||
|
|
||||||
$original = strtolower( $original );
|
|
||||||
|
|
||||||
if ( $_REQUEST['from'] == 'wc01' && ( $original == 'insert into post' || $original == 'use this image' ) )
|
|
||||||
return __( 'Use this file', 'woocommerce' );
|
|
||||||
|
|
||||||
return $translation;
|
|
||||||
}
|
|
||||||
|
|
||||||
add_filter( 'gettext', 'woocommerce_change_insert_into_post', null, 2 );
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output product visibility options.
|
* Output product visibility options.
|
||||||
*
|
*
|
||||||
|
@ -1073,7 +1060,7 @@ function woocommerce_product_data_visibility() {
|
||||||
|
|
||||||
<div id="catalog-visibility-select" class="hide-if-js">
|
<div id="catalog-visibility-select" class="hide-if-js">
|
||||||
|
|
||||||
<input type="hidden" name="current_visibilty" id="current_visibilty" value="<?php echo esc_attr( $current_visibility ); ?>" />
|
<input type="hidden" name="current_visibility" id="current_visibility" value="<?php echo esc_attr( $current_visibility ); ?>" />
|
||||||
<input type="hidden" name="current_featured" id="current_featured" value="<?php echo esc_attr( $current_featured ); ?>" />
|
<input type="hidden" name="current_featured" id="current_featured" value="<?php echo esc_attr( $current_featured ); ?>" />
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -1098,4 +1085,4 @@ function woocommerce_product_data_visibility() {
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'post_submitbox_misc_actions', 'woocommerce_product_data_visibility' );
|
add_action( 'post_submitbox_misc_actions', 'woocommerce_product_data_visibility' );
|
||||||
|
|
|
@ -24,259 +24,138 @@ function woocommerce_product_images_box() {
|
||||||
<div id="product_images_container">
|
<div id="product_images_container">
|
||||||
<ul class="product_images">
|
<ul class="product_images">
|
||||||
<?php
|
<?php
|
||||||
$thumbnail_id = get_post_thumbnail_id( $post->ID );
|
if ( metadata_exists( 'post', $post->ID, '_product_image_gallery' ) ) {
|
||||||
|
$product_image_gallery = get_post_meta( $post->ID, '_product_image_gallery', true );
|
||||||
if ( $thumbnail_id )
|
} else {
|
||||||
echo '<li class="image" data-post_id="' . $thumbnail_id . '">
|
// Backwards compat
|
||||||
' . wp_get_attachment_image( $thumbnail_id, 'full' ) . '
|
$attachment_ids = array_filter( array_diff( get_posts( 'post_parent=' . $post->ID . '&numberposts=-1&post_type=attachment&orderby=menu_order&order=ASC&post_mime_type=image&fields=ids' ), array( get_post_thumbnail_id() ) ) );
|
||||||
<span class="loading"></span>
|
$product_image_gallery = implode( ',', $attachment_ids );
|
||||||
<ul class="actions">
|
|
||||||
<li><a href="#" class="delete">' . __( 'Delete', 'woocommerce' ) . '</a></li>
|
|
||||||
<li><a href="' . admin_url( 'media-upload.php?post_id=' . $post->ID . '&attachment_id=' . $thumbnail_id . '&tab=library&width=640&height=553&TB_iframe=1' ) . '" class="view thickbox" onclick="return false;">' . __( 'View', 'woocommerce' ) . '</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>';
|
|
||||||
|
|
||||||
$attachments =& get_children( 'post_parent=' . $post->ID . '&numberposts=-1&post_type=attachment&orderby=menu_order&order=ASC&post_mime_type=image' );
|
|
||||||
|
|
||||||
foreach ( $attachments as $attachment_id => $attachment ) {
|
|
||||||
if ( $thumbnail_id == $attachment_id )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$exclude_class = get_post_meta( $attachment_id, '_woocommerce_exclude_image', true ) == 1 ? 'excluded' : '';
|
|
||||||
|
|
||||||
echo '<li class="image ' . $exclude_class . '" data-post_id="' . $attachment_id . '">
|
|
||||||
' . wp_get_attachment_image( $attachment_id, 'full' ) . '
|
|
||||||
<span class="loading"></span>
|
|
||||||
<ul class="actions">
|
|
||||||
<li><a href="#" class="delete">' . __( 'Delete', 'woocommerce' ) . '</a></li>
|
|
||||||
<li><a href="' . admin_url( 'media-upload.php?post_id=' . $post->ID . '&attachment_id=' . $attachment_id . '&tab=library&width=640&height=553&TB_iframe=1' ) . '" class="view thickbox" onclick="return false;">' . __( 'View', 'woocommerce' ) . '</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$attachments = array_filter( explode( ',', $product_image_gallery ) );
|
||||||
|
|
||||||
|
if ( $attachments )
|
||||||
|
foreach ( $attachments as $attachment_id ) {
|
||||||
|
echo '<li class="image" data-attachment_id="' . $attachment_id . '">
|
||||||
|
' . wp_get_attachment_image( $attachment_id, 'full' ) . '
|
||||||
|
<ul class="actions">
|
||||||
|
<li><a href="#" class="delete" title="' . __( 'Delete image', 'woocommerce' ) . '">' . __( 'Delete', 'woocommerce' ) . '</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Uploader section -->
|
<input type="hidden" id="product_image_gallery" name="product_image_gallery" value="<?php echo esc_attr( $product_image_gallery ); ?>" />
|
||||||
<div id="plupload-upload-ui" class="hide-if-no-js">
|
|
||||||
<div id="drag-drop-area">
|
|
||||||
<p class="drag-drop-info"><?php _e('Drop files here'); ?></p>
|
|
||||||
<p><?php _ex('or', 'Uploader: Drop files here - or - Select Files'); ?></p>
|
|
||||||
<p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e('Select Files'); ?>" class="button" /></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
// Drag and drop code adapted from Drag & Drop Featured Image by Jonathan Lundström
|
|
||||||
$plupload_init = array(
|
|
||||||
'runtimes' => 'html5,silverlight,flash,html4',
|
|
||||||
'browse_button' => 'plupload-browse-button',
|
|
||||||
'container' => 'plupload-upload-ui',
|
|
||||||
'drop_element' => 'drag-drop-area',
|
|
||||||
'file_data_name' => 'async-upload',
|
|
||||||
'multiple_queues' => true,
|
|
||||||
'max_file_size' => wp_max_upload_size() . 'b',
|
|
||||||
'url' => admin_url('admin-ajax.php'),
|
|
||||||
'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
|
|
||||||
'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
|
|
||||||
'filters' => array( array( 'title' => __( 'Allowed Files' ), 'extensions' => '*') ),
|
|
||||||
'multipart' => true,
|
|
||||||
'urlstream_upload' => true,
|
|
||||||
'multipart_params' => array(
|
|
||||||
'_ajax_nonce' => wp_create_nonce( 'product-images-box-upload' ),
|
|
||||||
'action' => 'woocommerce_product_images_box_upload',
|
|
||||||
'post_id' => $post->ID
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Apply filters to initiate plupload:
|
</div>
|
||||||
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
|
<p class="add_product_images hide-if-no-js">
|
||||||
?>
|
<a href="#"><?php _e( 'Add product gallery images', 'woocommerce' ); ?></a>
|
||||||
|
</p>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function($){
|
jQuery(document).ready(function($){
|
||||||
|
|
||||||
function product_images_container_init() {
|
// Uploading files
|
||||||
// Attribute ordering
|
var product_gallery_frame;
|
||||||
$('#product_images_container ul.product_images').sortable({
|
var $image_gallery_ids = $('#product_image_gallery');
|
||||||
items: 'li.image',
|
var $product_images = $('#product_images_container ul.product_images');
|
||||||
cursor: 'move',
|
|
||||||
scrollSensitivity:40,
|
|
||||||
forcePlaceholderSize: true,
|
|
||||||
forceHelperSize: false,
|
|
||||||
helper: 'clone',
|
|
||||||
opacity: 0.65,
|
|
||||||
placeholder: 'wc-metabox-sortable-placeholder',
|
|
||||||
start:function(event,ui){
|
|
||||||
ui.item.css('background-color','#f6f6f6');
|
|
||||||
},
|
|
||||||
stop:function(event,ui){
|
|
||||||
ui.item.removeAttr('style');
|
|
||||||
},
|
|
||||||
update: function(event, ui) {
|
|
||||||
$('#product_images_container ul li.image').css('cursor','default');
|
|
||||||
$('#product_images_container ul.product_images').sortable('disable');
|
|
||||||
|
|
||||||
var post_id = <?php echo $post->ID; ?>;
|
jQuery('.add_product_images').on( 'click', 'a', function( event ) {
|
||||||
var attachment_id = ui.item.attr( 'data-post_id' );
|
|
||||||
var prev_attachment_id = ui.item.prev().attr( 'data-post_id' );
|
|
||||||
var next_attachment_id = ui.item.next().attr( 'data-post_id' );
|
|
||||||
|
|
||||||
// show spinner
|
var $el = $(this);
|
||||||
ui.item.addClass('loading');
|
var attachment_ids = $image_gallery_ids.val();
|
||||||
|
|
||||||
// go do the sorting stuff via ajax
|
event.preventDefault();
|
||||||
jQuery.post( ajaxurl, {
|
|
||||||
action: 'woocommerce_product_image_ordering',
|
|
||||||
post_id: post_id,
|
|
||||||
attachment_id: attachment_id,
|
|
||||||
prev_attachment_id: prev_attachment_id,
|
|
||||||
next_attachment_id: next_attachment_id,
|
|
||||||
_ajax_nonce: '<?php echo wp_create_nonce( 'product-image-ordering' ); ?>'
|
|
||||||
}, function( response ) {
|
|
||||||
ui.item.removeClass('loading');
|
|
||||||
$('#product_images_container ul li.image').css('cursor','move');
|
|
||||||
$('#product_images_container ul.product_images').sortable('enable');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
product_images_container_init();
|
// If the media frame already exists, reopen it.
|
||||||
|
if ( product_gallery_frame ) {
|
||||||
// Delete images
|
product_gallery_frame.open();
|
||||||
$('#product_images_container').on( 'click', 'a.delete', function() {
|
|
||||||
|
|
||||||
$image = $(this).closest('li.image');
|
|
||||||
|
|
||||||
var attachment_id = $image.attr('data-post_id');
|
|
||||||
|
|
||||||
if ( attachment_id ) {
|
|
||||||
|
|
||||||
$image.addClass('loading');
|
|
||||||
|
|
||||||
var answer = confirm('<?php _e( 'Are you sure you want to remove this attachment?', 'woocommerce' ); ?>');
|
|
||||||
|
|
||||||
if ( answer ) {
|
|
||||||
jQuery.post( ajaxurl, {
|
|
||||||
action: 'woocommerce_product_image_delete',
|
|
||||||
post_id: <?php echo $post->ID; ?>,
|
|
||||||
attachment_id: attachment_id,
|
|
||||||
_ajax_nonce: '<?php echo wp_create_nonce( 'product-image-delete' ); ?>'
|
|
||||||
}, function( response ) {
|
|
||||||
$image.remove();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$image.removeClass('loading');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
} );
|
|
||||||
|
|
||||||
|
|
||||||
// Drag and drop uploading of images
|
|
||||||
var uploader = new plupload.Uploader(<?php echo json_encode( $plupload_init ); ?>);
|
|
||||||
|
|
||||||
// Check for drag'n'drop functionality:
|
|
||||||
uploader.bind('Init', function(up){
|
|
||||||
var uploaddiv = $('#plupload-upload-ui');
|
|
||||||
|
|
||||||
// Add classes and bind actions:
|
|
||||||
if(up.features.dragdrop){
|
|
||||||
uploaddiv.addClass('drag-drop');
|
|
||||||
$('#drag-drop-area')
|
|
||||||
.bind('dragover.wp-uploader', function() { uploaddiv.addClass('drag-over'); })
|
|
||||||
.bind('dragleave.wp-uploader, drop.wp-uploader', function(){ uploaddiv.removeClass('drag-over'); });
|
|
||||||
|
|
||||||
} else{
|
|
||||||
uploaddiv.removeClass('drag-drop');
|
|
||||||
$('#drag-drop-area').unbind('.wp-uploader');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Initiate uploading script:
|
|
||||||
uploader.init();
|
|
||||||
|
|
||||||
// File queue handler
|
|
||||||
uploader.bind('FilesAdded', function(up, files){
|
|
||||||
var hundredmb = 100 * 1024 * 1024, max = parseInt(up.settings.max_file_size, 10);
|
|
||||||
|
|
||||||
// Loop through files:
|
|
||||||
plupload.each(files, function(file){
|
|
||||||
if ( max > hundredmb && file.size > hundredmb && up.runtime != 'html5' ) {
|
|
||||||
alert( "<?php _e( 'The file you selected exceeds the maximum filesize specified in this installation.', 'woocommerce' ); ?>" );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Refresh and start:
|
|
||||||
up.refresh();
|
|
||||||
up.start();
|
|
||||||
|
|
||||||
// Block the UI
|
|
||||||
$('#product_images_container').block({ message: null, overlayCSS: { background: '#fff url(' + woocommerce_writepanel_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6 } });
|
|
||||||
});
|
|
||||||
|
|
||||||
// Handle new uploads
|
|
||||||
uploader.bind( 'FileUploaded', function( up, file, response ) {
|
|
||||||
|
|
||||||
response = $.parseJSON( response.response );
|
|
||||||
|
|
||||||
if ( response.error ) {
|
|
||||||
|
|
||||||
alert( response.error );
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$('#product_images_container ul').append('<li class="image" data-post_id="' + response.post_id + '">\
|
|
||||||
<img src="' + response.src + '" />\
|
|
||||||
<span class="loading"></span>\
|
|
||||||
<ul class="actions">\
|
|
||||||
<li><a href="#" class="delete"><?php _e( 'Delete', 'woocommerce' ) ?></a></li>\
|
|
||||||
<li><a href="' + response.edit_url + '" class="view thickbox" onclick="return false;"><?php _e( 'View', 'woocommerce' ) ?></a></li>\
|
|
||||||
</ul>\
|
|
||||||
</li>');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#product_images_container').unblock();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Refresh images when a thickbox (images) closes
|
|
||||||
var loading_product_images = false;
|
|
||||||
|
|
||||||
jQuery(document).bind( 'tb_unload', function() {
|
|
||||||
if ( loading_product_images )
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
loading_product_images = true;
|
// Create the media frame.
|
||||||
|
product_gallery_frame = wp.media.frames.downloadable_file = wp.media({
|
||||||
|
// Set the title of the modal.
|
||||||
|
title: '<?php _e( 'Add Images to Product Gallery', 'woocommerce' ); ?>',
|
||||||
|
button: {
|
||||||
|
text: '<?php _e( 'Add to gallery', 'woocommerce' ); ?>',
|
||||||
|
},
|
||||||
|
multiple: true
|
||||||
|
});
|
||||||
|
|
||||||
// Block
|
// When an image is selected, run a callback.
|
||||||
$('#product_images_container').block({ message: null, overlayCSS: { background: '#fff url(' + woocommerce_writepanel_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6 } });
|
product_gallery_frame.on( 'select', function() {
|
||||||
|
|
||||||
// Re-load images
|
var selection = product_gallery_frame.state().get('selection');
|
||||||
jQuery.post( ajaxurl, {
|
|
||||||
action: 'woocommerce_product_image_refresh',
|
selection.map( function( attachment ) {
|
||||||
post_id: <?php echo $post->ID; ?>,
|
|
||||||
_ajax_nonce: '<?php echo wp_create_nonce( 'product-image-refresh' ); ?>'
|
attachment = attachment.toJSON();
|
||||||
}, function( response ) {
|
|
||||||
if ( response ) {
|
if ( attachment.id ) {
|
||||||
$("#product_images_container").html(response);
|
attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
|
||||||
|
|
||||||
|
$product_images.append('\
|
||||||
|
<li class="image" data-attachment_id="' + attachment.id + '">\
|
||||||
|
<img src="' + attachment.url + '" />\
|
||||||
|
<ul class="actions">\
|
||||||
|
<li><a href="#" class="delete" title="<?php _e( 'Delete image', 'woocommerce' ); ?>"><?php _e( 'Delete', 'woocommerce' ); ?></a></li>\
|
||||||
|
</ul>\
|
||||||
|
</li>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-init
|
} );
|
||||||
product_images_container_init();
|
|
||||||
|
|
||||||
// Unblock
|
$image_gallery_ids.val( attachment_ids );
|
||||||
$('#product_images_container').unblock();
|
});
|
||||||
|
|
||||||
loading_product_images = false;
|
// Finally, open the modal.
|
||||||
}
|
product_gallery_frame.open();
|
||||||
);
|
});
|
||||||
|
|
||||||
|
// Image ordering
|
||||||
|
$product_images.sortable({
|
||||||
|
items: 'li.image',
|
||||||
|
cursor: 'move',
|
||||||
|
scrollSensitivity:40,
|
||||||
|
forcePlaceholderSize: true,
|
||||||
|
forceHelperSize: false,
|
||||||
|
helper: 'clone',
|
||||||
|
opacity: 0.65,
|
||||||
|
placeholder: 'wc-metabox-sortable-placeholder',
|
||||||
|
start:function(event,ui){
|
||||||
|
ui.item.css('background-color','#f6f6f6');
|
||||||
|
},
|
||||||
|
stop:function(event,ui){
|
||||||
|
ui.item.removeAttr('style');
|
||||||
|
},
|
||||||
|
update: function(event, ui) {
|
||||||
|
var attachment_ids = '';
|
||||||
|
|
||||||
|
$('#product_images_container ul li.image').css('cursor','default').each(function() {
|
||||||
|
var attachment_id = jQuery(this).attr( 'data-attachment_id' );
|
||||||
|
attachment_ids = attachment_ids + attachment_id + ',';
|
||||||
|
});
|
||||||
|
|
||||||
|
$image_gallery_ids.val( attachment_ids );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Remove images
|
||||||
|
$('#product_images_container').on( 'click', 'a.delete', function() {
|
||||||
|
|
||||||
|
$(this).closest('li.image').remove();
|
||||||
|
|
||||||
|
var attachment_ids = '';
|
||||||
|
|
||||||
|
$('#product_images_container ul li.image').css('cursor','default').each(function() {
|
||||||
|
var attachment_id = jQuery(this).attr( 'data-attachment_id' );
|
||||||
|
attachment_ids = attachment_ids + attachment_id + ',';
|
||||||
|
});
|
||||||
|
|
||||||
|
$image_gallery_ids.val( attachment_ids );
|
||||||
|
|
||||||
|
return false;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -44,11 +44,10 @@ function woocommerce_meta_boxes() {
|
||||||
|
|
||||||
// Products
|
// Products
|
||||||
add_meta_box( 'woocommerce-product-data', __( 'Product Data', 'woocommerce' ), 'woocommerce_product_data_box', 'product', 'normal', 'high' );
|
add_meta_box( 'woocommerce-product-data', __( 'Product Data', 'woocommerce' ), 'woocommerce_product_data_box', 'product', 'normal', 'high' );
|
||||||
add_meta_box( 'woocommerce-product-images', __( 'Product Images', 'woocommerce' ), 'woocommerce_product_images_box', 'product', 'side' );
|
add_meta_box( 'woocommerce-product-images', __( 'Product Gallery', 'woocommerce' ), 'woocommerce_product_images_box', 'product', 'side' );
|
||||||
|
|
||||||
remove_meta_box( 'product_shipping_classdiv', 'product', 'side' );
|
remove_meta_box( 'product_shipping_classdiv', 'product', 'side' );
|
||||||
remove_meta_box( 'pageparentdiv', 'product', 'side' );
|
remove_meta_box( 'pageparentdiv', 'product', 'side' );
|
||||||
remove_meta_box( 'postimagediv', 'product', 'side' );
|
|
||||||
|
|
||||||
// Excerpt
|
// Excerpt
|
||||||
if ( function_exists('wp_editor') ) {
|
if ( function_exists('wp_editor') ) {
|
||||||
|
|
|
@ -12,23 +12,31 @@
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
$localisation_setting = ( defined('WPLANG') ) ? array(
|
global $woocommerce;
|
||||||
|
|
||||||
|
$localisation_setting = defined( 'WPLANG' ) && file_exists( $woocommerce->plugin_path() . '/i18n/languages/informal/woocommerce-' . WPLANG . '.mo' ) ? array(
|
||||||
'title' => __( 'Localisation', 'woocommerce' ),
|
'title' => __( 'Localisation', 'woocommerce' ),
|
||||||
'desc' => __( 'Use informal localisation file if it exists', 'woocommerce' ),
|
'desc' => sprintf( __( 'Use informal localisation for %s', 'woocommerce' ), WPLANG ),
|
||||||
'id' => 'woocommerce_informal_localisation_type',
|
'id' => 'woocommerce_informal_localisation_type',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
) : array();
|
) : array();
|
||||||
|
|
||||||
|
$currency_code_options = get_woocommerce_currencies();
|
||||||
|
|
||||||
|
foreach ( $currency_code_options as $code => $name ) {
|
||||||
|
$currency_code_options[ $code ] = $name . ' (' . get_woocommerce_currency_symbol( $code ) . ')';
|
||||||
|
}
|
||||||
|
|
||||||
$woocommerce_settings['general'] = apply_filters('woocommerce_general_settings', array(
|
$woocommerce_settings['general'] = apply_filters('woocommerce_general_settings', array(
|
||||||
|
|
||||||
array( 'title' => __( 'General Options', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
|
array( 'title' => __( 'General Options', 'woocommerce' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Base Country/Region', 'woocommerce' ),
|
'title' => __( 'Base Location', 'woocommerce' ),
|
||||||
'desc' => __( 'This is the base country for your business. Tax rates will be based on this country.', 'woocommerce' ),
|
'desc' => __( 'This is the base location for your business. Tax rates will be based on this country.', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_default_country',
|
'id' => 'woocommerce_default_country',
|
||||||
'css' => 'min-width:300px;',
|
'css' => 'min-width:350px;',
|
||||||
'default' => 'GB',
|
'default' => 'GB',
|
||||||
'type' => 'single_select_country',
|
'type' => 'single_select_country',
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
|
@ -36,43 +44,14 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Currency', 'woocommerce' ),
|
'title' => __( 'Currency', 'woocommerce' ),
|
||||||
'desc' => __("This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.", 'woocommerce' ),
|
'desc' => __( "This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.", 'woocommerce' ),
|
||||||
'id' => 'woocommerce_currency',
|
'id' => 'woocommerce_currency',
|
||||||
'css' => 'min-width:300px;',
|
'css' => 'min-width:350px;',
|
||||||
'default' => 'GBP',
|
'default' => 'GBP',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'class' => 'chosen_select',
|
'class' => 'chosen_select',
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
'options' => array_unique( apply_filters( 'woocommerce_currencies', array(
|
'options' => $currency_code_options
|
||||||
'USD' => __( 'US Dollars ($)', 'woocommerce' ),
|
|
||||||
'EUR' => __( 'Euros (€)', 'woocommerce' ),
|
|
||||||
'GBP' => __( 'Pounds Sterling (£)', 'woocommerce' ),
|
|
||||||
'AUD' => __( 'Australian Dollars ($)', 'woocommerce' ),
|
|
||||||
'BRL' => __( 'Brazilian Real ($)', 'woocommerce' ),
|
|
||||||
'CAD' => __( 'Canadian Dollars ($)', 'woocommerce' ),
|
|
||||||
'CZK' => __( 'Czech Koruna (Kč)', 'woocommerce' ),
|
|
||||||
'DKK' => __( 'Danish Krone', 'woocommerce' ),
|
|
||||||
'HKD' => __( 'Hong Kong Dollar ($)', 'woocommerce' ),
|
|
||||||
'HUF' => __( 'Hungarian Forint', 'woocommerce' ),
|
|
||||||
'ILS' => __( 'Israeli Shekel', 'woocommerce' ),
|
|
||||||
'RMB' => __( 'Chinese Yuan (¥)', 'woocommerce' ),
|
|
||||||
'JPY' => __( 'Japanese Yen (¥)', 'woocommerce' ),
|
|
||||||
'MYR' => __( 'Malaysian Ringgits (RM)', 'woocommerce' ),
|
|
||||||
'MXN' => __( 'Mexican Peso ($)', 'woocommerce' ),
|
|
||||||
'NZD' => __( 'New Zealand Dollar ($)', 'woocommerce' ),
|
|
||||||
'NOK' => __( 'Norwegian Krone', 'woocommerce' ),
|
|
||||||
'PHP' => __( 'Philippine Pesos', 'woocommerce' ),
|
|
||||||
'PLN' => __( 'Polish Zloty', 'woocommerce' ),
|
|
||||||
'SGD' => __( 'Singapore Dollar ($)', 'woocommerce' ),
|
|
||||||
'SEK' => __( 'Swedish Krona', 'woocommerce' ),
|
|
||||||
'CHF' => __( 'Swiss Franc', 'woocommerce' ),
|
|
||||||
'TWD' => __( 'Taiwan New Dollars', 'woocommerce' ),
|
|
||||||
'THB' => __( 'Thai Baht', 'woocommerce' ),
|
|
||||||
'TRY' => __( 'Turkish Lira (TL)', 'woocommerce' ),
|
|
||||||
'ZAR' => __( 'South African rand (R)', 'woocommerce' ),
|
|
||||||
'RON' => __( 'Romanian Leu (RON)', 'woocommerce' ),
|
|
||||||
) )
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
@ -82,7 +61,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'default' => 'all',
|
'default' => 'all',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'class' => 'chosen_select',
|
'class' => 'chosen_select',
|
||||||
'css' => 'min-width:300px;',
|
'css' => 'min-width:350px;',
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'all' => __( 'All Countries', 'woocommerce' ),
|
'all' => __( 'All Countries', 'woocommerce' ),
|
||||||
|
@ -101,9 +80,35 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
|
|
||||||
$localisation_setting,
|
$localisation_setting,
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Store Notice', 'woocommerce' ),
|
||||||
|
'desc' => __( 'Enable site-wide store notice text', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_demo_store',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox'
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Store Notice Text', 'woocommerce' ),
|
||||||
|
'desc' => '',
|
||||||
|
'id' => 'woocommerce_demo_store_notice',
|
||||||
|
'default' => __( 'This is a demo store for testing purposes — no orders shall be fulfilled.', 'woocommerce' ),
|
||||||
|
'type' => 'text',
|
||||||
|
'css' => 'min-width:300px;',
|
||||||
|
),
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'general_options'),
|
array( 'type' => 'sectionend', 'id' => 'general_options'),
|
||||||
|
|
||||||
array( 'title' => __( 'Checkout and Accounts', 'woocommerce' ), 'type' => 'title','desc' => __( 'The following options control the behaviour of the checkout process and customer accounts.', 'woocommerce' ), 'id' => 'checkout_account_options' ),
|
array( 'title' => __( 'Cart, Checkout and Accounts', 'woocommerce' ), 'type' => 'title', 'id' => 'checkout_account_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Coupons', 'woocommerce' ),
|
||||||
|
'desc' => __( 'Enable the use of coupons', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_enable_coupons',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'woocommerce' ),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Checkout', 'woocommerce' ),
|
'title' => __( 'Checkout', 'woocommerce' ),
|
||||||
|
@ -115,22 +120,21 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Show order comments section', 'woocommerce' ),
|
'desc' => __( 'Enable customer note field on checkout', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_order_comments',
|
'id' => 'woocommerce_enable_order_comments',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end'
|
'checkboxgroup' => ''
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Security', 'woocommerce' ),
|
|
||||||
'desc' => __( 'Force secure checkout', 'woocommerce' ),
|
'desc' => __( 'Force secure checkout', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_force_ssl_checkout',
|
'id' => 'woocommerce_force_ssl_checkout',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => '',
|
||||||
'show_if_checked' => 'option',
|
'show_if_checked' => 'option',
|
||||||
'desc_tip' => __( 'Force SSL (HTTPS) on the checkout pages (an SSL Certificate is required)', 'woocommerce' ),
|
'desc_tip' => __( 'Force SSL (HTTPS) on the checkout pages (an SSL Certificate is required).', 'woocommerce' ),
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
@ -142,34 +146,6 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'show_if_checked' => 'yes',
|
'show_if_checked' => 'yes',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Coupons', 'woocommerce' ),
|
|
||||||
'desc' => __( 'Enable coupons', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_enable_coupons',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'start',
|
|
||||||
'show_if_checked' => 'option'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Enable coupon form on cart', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_enable_coupon_form_on_cart',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => '',
|
|
||||||
'show_if_checked' => 'yes'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Enable coupon form on checkout', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_enable_coupon_form_on_checkout',
|
|
||||||
'default' => 'no',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'end',
|
|
||||||
'show_if_checked' => 'yes'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Registration', 'woocommerce' ),
|
'title' => __( 'Registration', 'woocommerce' ),
|
||||||
'desc' => __( 'Allow registration on the checkout page', 'woocommerce' ),
|
'desc' => __( 'Allow registration on the checkout page', 'woocommerce' ),
|
||||||
|
@ -213,7 +189,7 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Allow customers to repurchase past orders', 'woocommerce' ),
|
'desc' => __( 'Allow customers to repurchase orders from their account page', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_allow_customers_to_reorder',
|
'id' => 'woocommerce_allow_customers_to_reorder',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -222,11 +198,11 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'checkout_account_options'),
|
array( 'type' => 'sectionend', 'id' => 'checkout_account_options'),
|
||||||
|
|
||||||
array( 'title' => __( 'Styles and Scripts', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'The following options affect the styling of your store, as well as how certain features behave.', 'woocommerce' ), 'id' => 'script_styling_options' ),
|
array( 'title' => __( 'Styles and Scripts', 'woocommerce' ), 'type' => 'title', 'id' => 'script_styling_options' ),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Styling', 'woocommerce' ),
|
'title' => __( 'Styling', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable WooCommerce CSS styles', 'woocommerce' ),
|
'desc' => __( 'Enable WooCommerce CSS', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_frontend_css',
|
'id' => 'woocommerce_frontend_css',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox'
|
'type' => 'checkbox'
|
||||||
|
@ -236,38 +212,14 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'type' => 'frontend_styles'
|
'type' => 'frontend_styles'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Store Notice', 'woocommerce' ),
|
|
||||||
'desc' => __( 'Enable the "Demo Store" notice on your site', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_demo_store',
|
|
||||||
'default' => 'no',
|
|
||||||
'type' => 'checkbox'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Store Notice Text', 'woocommerce' ),
|
|
||||||
'desc' => '',
|
|
||||||
'id' => 'woocommerce_demo_store_notice',
|
|
||||||
'default' => __( 'This is a demo store for testing purposes — no orders shall be fulfilled.', 'woocommerce' ),
|
|
||||||
'type' => 'text',
|
|
||||||
'css' => 'min-width:300px;',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Scripts', 'woocommerce' ),
|
'title' => __( 'Scripts', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable AJAX add to cart buttons on product archives', 'woocommerce' ),
|
'desc' => __( 'Enable Lightbox', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_ajax_add_to_cart',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'start'
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Enable WooCommerce lightbox on the product page', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_enable_lightbox',
|
'id' => 'woocommerce_enable_lightbox',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
|
'desc_tip' => __( 'Include WooCommerce\'s lightbox. Product gallery images and the add review form will open in a lightbox.', 'woocommerce' ),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => ''
|
'checkboxgroup' => 'start'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
@ -275,12 +227,13 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'id' => 'woocommerce_enable_chosen',
|
'id' => 'woocommerce_enable_chosen',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end'
|
'checkboxgroup' => 'end',
|
||||||
|
'desc_tip' => __( 'This will enable a script allowing the country fields to be searchable.', 'woocommerce' ),
|
||||||
),
|
),
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'script_styling_options'),
|
array( 'type' => 'sectionend', 'id' => 'script_styling_options'),
|
||||||
|
|
||||||
array( 'title' => __( 'Digital Downloads', 'woocommerce' ), 'type' => 'title','desc' => __( 'The following options are specific to downloadable products.', 'woocommerce' ), 'id' => 'digital_download_options' ),
|
array( 'title' => __( 'Downloadable Products', 'woocommerce' ), 'type' => 'title', 'id' => 'digital_download_options' ),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'File Download Method', 'woocommerce' ),
|
'title' => __( 'File Download Method', 'woocommerce' ),
|
||||||
|
@ -299,12 +252,12 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Access Restrictions', 'woocommerce' ),
|
'title' => __( 'Access Restriction', 'woocommerce' ),
|
||||||
'desc' => __( 'Must be logged in to download files', 'woocommerce' ),
|
'desc' => __( 'Downloads require login', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_downloads_require_login',
|
'id' => 'woocommerce_downloads_require_login',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'desc_tip' => __( 'This setting does not apply to guest downloads.', 'woocommerce' ),
|
'desc_tip' => __( 'This setting does not apply to guest purchases.', 'woocommerce' ),
|
||||||
'checkboxgroup' => 'start'
|
'checkboxgroup' => 'start'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -313,18 +266,10 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
|
||||||
'id' => 'woocommerce_downloads_grant_access_after_payment',
|
'id' => 'woocommerce_downloads_grant_access_after_payment',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'desc_tip' => __( 'Turn this option off to only grant access when an order is "complete", rather than "processing"', 'woocommerce' ),
|
'desc_tip' => __( 'Enable this option to grant access to downloads when orders are "processing", rather than "completed".', 'woocommerce' ),
|
||||||
'checkboxgroup' => 'end'
|
'checkboxgroup' => 'end'
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Limit Quantity', 'woocommerce' ),
|
|
||||||
'desc' => __( 'Limit the purchasable quantity of downloadable-virtual items to 1', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_limit_downloadable_product_qty',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox'
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'digital_download_options' ),
|
array( 'type' => 'sectionend', 'id' => 'digital_download_options' ),
|
||||||
|
|
||||||
)); // End general settings
|
)); // End general settings
|
||||||
|
@ -359,16 +304,6 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra
|
||||||
'desc_tip' => true
|
'desc_tip' => true
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Base Page Title', 'woocommerce' ),
|
|
||||||
'desc' => __( 'This title to show on the shop base page. Leave blank to use the page title.', 'woocommerce' ),
|
|
||||||
'id' => 'woocommerce_shop_page_title',
|
|
||||||
'type' => 'text',
|
|
||||||
'css' => 'min-width:300px;',
|
|
||||||
'default' => 'All Products', // Default value for the page title - changed in settings
|
|
||||||
'desc_tip' => true,
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Terms Page ID', 'woocommerce' ),
|
'title' => __( 'Terms Page ID', 'woocommerce' ),
|
||||||
'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woocommerce' ),
|
'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woocommerce' ),
|
||||||
|
@ -380,14 +315,6 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Logout link', 'woocommerce' ),
|
|
||||||
'desc' => sprintf(__( 'Append a logout link to menus containing "My Account"', 'woocommerce' ), $base_slug),
|
|
||||||
'id' => 'woocommerce_menu_logout_link',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
),
|
|
||||||
|
|
||||||
array( 'type' => 'sectionend', 'id' => 'page_options' ),
|
array( 'type' => 'sectionend', 'id' => 'page_options' ),
|
||||||
|
|
||||||
array( 'title' => __( 'Shop Pages', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'The following pages need selecting so that WooCommerce knows where they are. These pages should have been created upon installation of the plugin, if not you will need to create them.', 'woocommerce' ) ),
|
array( 'title' => __( 'Shop Pages', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'The following pages need selecting so that WooCommerce knows where they are. These pages should have been created upon installation of the plugin, if not you will need to create them.', 'woocommerce' ) ),
|
||||||
|
@ -480,6 +407,17 @@ $woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', arra
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Logout Page', 'woocommerce' ),
|
||||||
|
'desc' => __( 'Parent: "My Account"', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_logout_page_id',
|
||||||
|
'type' => 'single_select_page',
|
||||||
|
'default' => '',
|
||||||
|
'class' => 'chosen_select_nostd',
|
||||||
|
'css' => 'min-width:300px;',
|
||||||
|
'desc_tip' => true,
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Lost Password Page', 'woocommerce' ),
|
'title' => __( 'Lost Password Page', 'woocommerce' ),
|
||||||
'desc' => __( 'Page contents: [woocommerce_lost_password] Parent: "My Account"', 'woocommerce' ),
|
'desc' => __( 'Page contents: [woocommerce_lost_password] Parent: "My Account"', 'woocommerce' ),
|
||||||
|
@ -508,10 +446,12 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
'default' => 'title',
|
'default' => 'title',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'options' => apply_filters('woocommerce_default_catalog_orderby_options', array(
|
'options' => apply_filters('woocommerce_default_catalog_orderby_options', array(
|
||||||
'menu_order' => __( 'Default sorting', 'woocommerce' ),
|
'menu_order' => __( 'Default sorting (custom ordering + name)', 'woocommerce' ),
|
||||||
'title' => __( 'Sort alphabetically', 'woocommerce' ),
|
'popularity' => __( 'Popularity (sales)', 'woocommerce' ),
|
||||||
'date' => __( 'Sort by most recent', 'woocommerce' ),
|
'rating' => __( 'Average Rating', 'woocommerce' ),
|
||||||
'price' => __( 'Sort by price', 'woocommerce' ),
|
'date' => __( 'Sort by most recent', 'woocommerce' ),
|
||||||
|
'price' => __( 'Sort by price (asc)', 'woocommerce' ),
|
||||||
|
'price-desc' => __( 'Sort by price (desc)', 'woocommerce' ),
|
||||||
)),
|
)),
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
),
|
),
|
||||||
|
@ -547,8 +487,8 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Redirects', 'woocommerce' ),
|
'title' => __( 'Add to cart', 'woocommerce' ),
|
||||||
'desc' => __( 'Redirect to cart after adding a product to the cart (on single product pages)', 'woocommerce' ),
|
'desc' => __( 'Redirect to the cart page after successful addition', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_cart_redirect_after_add',
|
'id' => 'woocommerce_cart_redirect_after_add',
|
||||||
'default' => 'no',
|
'default' => 'no',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -556,9 +496,9 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Redirect to the product page on a single matching search result', 'woocommerce' ),
|
'desc' => __( 'Enable AJAX add to cart buttons on archives', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_redirect_on_single_search_result',
|
'id' => 'woocommerce_enable_ajax_add_to_cart',
|
||||||
'default' => 'no',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end'
|
'checkboxgroup' => 'end'
|
||||||
),
|
),
|
||||||
|
@ -569,7 +509,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Product Fields', 'woocommerce' ),
|
'title' => __( 'Product Fields', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable the SKU field for products', 'woocommerce' ),
|
'desc' => __( 'Enable the <strong>SKU</strong> field for products', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_sku',
|
'id' => 'woocommerce_enable_sku',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -577,7 +517,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Enable the weight field for products', 'woocommerce' ),
|
'desc' => __( 'Enable the <strong>weight</strong> field for products (some shipping methods may require this)', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_weight',
|
'id' => 'woocommerce_enable_weight',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -585,7 +525,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Enable the dimension fields for products', 'woocommerce' ),
|
'desc' => __( 'Enable the <strong>dimension</strong> fields for products (some shipping methods may require this)', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_dimensions',
|
'id' => 'woocommerce_enable_dimensions',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -593,7 +533,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Show weight and dimension fields in product attributes tab', 'woocommerce' ),
|
'desc' => __( 'Show <strong>weight and dimension</strong> values on the <strong>Additional Information</strong> tab', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_dimension_product_attributes',
|
'id' => 'woocommerce_enable_dimension_product_attributes',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -635,7 +575,7 @@ $woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings',
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Product Ratings', 'woocommerce' ),
|
'title' => __( 'Product Ratings', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable the rating field on the review form', 'woocommerce' ),
|
'desc' => __( 'Enable ratings on reviews', 'woocommerce' ),
|
||||||
'id' => 'woocommerce_enable_review_rating',
|
'id' => 'woocommerce_enable_review_rating',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
@ -786,6 +726,19 @@ $woocommerce_settings['inventory'] = apply_filters('woocommerce_inventory_settin
|
||||||
'type' => 'checkbox'
|
'type' => 'checkbox'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Hold Stock (minutes)', 'woocommerce' ),
|
||||||
|
'desc' => __( 'Hold stock (for unpaid orders) for x minutes. When this limit is reached, the pending order will be cancelled. Leave blank to disable.', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_hold_stock_minutes',
|
||||||
|
'type' => 'number',
|
||||||
|
'custom_attributes' => array(
|
||||||
|
'min' => 0,
|
||||||
|
'step' => 1
|
||||||
|
),
|
||||||
|
'css' => 'width:50px;',
|
||||||
|
'default' => '60'
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Notifications', 'woocommerce' ),
|
'title' => __( 'Notifications', 'woocommerce' ),
|
||||||
'desc' => __( 'Enable low stock notifications', 'woocommerce' ),
|
'desc' => __( 'Enable low stock notifications', 'woocommerce' ),
|
||||||
|
@ -803,6 +756,14 @@ $woocommerce_settings['inventory'] = apply_filters('woocommerce_inventory_settin
|
||||||
'checkboxgroup' => 'end'
|
'checkboxgroup' => 'end'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Notification Recipient', 'woocommerce' ),
|
||||||
|
'desc' => '',
|
||||||
|
'id' => 'woocommerce_stock_email_recipient',
|
||||||
|
'type' => 'email',
|
||||||
|
'default' => get_option( 'admin_email' )
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Low Stock Threshold', 'woocommerce' ),
|
'title' => __( 'Low Stock Threshold', 'woocommerce' ),
|
||||||
'desc' => '',
|
'desc' => '',
|
||||||
|
@ -983,12 +944,24 @@ $woocommerce_settings['tax'] = apply_filters('woocommerce_tax_settings', array(
|
||||||
'default' => 'shipping',
|
'default' => 'shipping',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'shipping' => __( 'Shipping address', 'woocommerce' ),
|
'shipping' => __( 'Customer shipping address', 'woocommerce' ),
|
||||||
'billing' => __( 'Billing address', 'woocommerce' ),
|
'billing' => __( 'Customer billing address', 'woocommerce' ),
|
||||||
'base' => __( 'Shop base address', 'woocommerce' )
|
'base' => __( 'Shop base address', 'woocommerce' )
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Default Customer Address:', 'woocommerce' ),
|
||||||
|
'id' => 'woocommerce_default_customer_address',
|
||||||
|
'desc_tip' => __( 'This option determines the customers default address (before they input their own).', 'woocommerce' ),
|
||||||
|
'default' => 'base',
|
||||||
|
'type' => 'select',
|
||||||
|
'options' => array(
|
||||||
|
'' => __( 'No address', 'woocommerce' ),
|
||||||
|
'base' => __( 'Shop base address', 'woocommerce' ),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Shipping Tax Class:', 'woocommerce' ),
|
'title' => __( 'Shipping Tax Class:', 'woocommerce' ),
|
||||||
'desc' => __( 'Optionally control which tax class shipping gets, or leave it so shipping tax is based on the cart items themselves.', 'woocommerce' ),
|
'desc' => __( 'Optionally control which tax class shipping gets, or leave it so shipping tax is based on the cart items themselves.', 'woocommerce' ),
|
||||||
|
@ -996,7 +969,7 @@ $woocommerce_settings['tax'] = apply_filters('woocommerce_tax_settings', array(
|
||||||
'css' => 'min-width:150px;',
|
'css' => 'min-width:150px;',
|
||||||
'default' => 'title',
|
'default' => 'title',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'options' => array( '' => 'Shipping tax class based on cart items', 'standard' => __( 'Standard', 'woocommerce' ) ) + $classes_options,
|
'options' => array( '' => __( 'Shipping tax class based on cart items', 'woocommerce' ), 'standard' => __( 'Standard', 'woocommerce' ) ) + $classes_options,
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,9 @@ function woocommerce_payment_gateways_setting() {
|
||||||
<td>';
|
<td>';
|
||||||
|
|
||||||
if ( $gateway->enabled == 'yes' )
|
if ( $gateway->enabled == 'yes' )
|
||||||
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success.png" width="16" height="14" alt="yes" />';
|
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success@2x.png" width="16" height="14" alt="yes" />';
|
||||||
else
|
else
|
||||||
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off.png" width="16" height="14" alt="no" />';
|
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off@2x.png" width="16" height="14" alt="no" />';
|
||||||
|
|
||||||
echo '</td>
|
echo '</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
|
@ -66,6 +66,7 @@ function woocommerce_update_options( $options ) {
|
||||||
case 'number':
|
case 'number':
|
||||||
case "select" :
|
case "select" :
|
||||||
case "color" :
|
case "color" :
|
||||||
|
case 'password' :
|
||||||
case "single_select_page" :
|
case "single_select_page" :
|
||||||
case "single_select_country" :
|
case "single_select_country" :
|
||||||
case 'radio' :
|
case 'radio' :
|
||||||
|
@ -76,7 +77,7 @@ function woocommerce_update_options( $options ) {
|
||||||
if ( isset( $_POST[ $value['id'] ] ) ) {
|
if ( isset( $_POST[ $value['id'] ] ) ) {
|
||||||
$option_value = esc_attr( $_POST[ $value['id'] ] );
|
$option_value = esc_attr( $_POST[ $value['id'] ] );
|
||||||
} else {
|
} else {
|
||||||
$option_value = '';
|
$option_value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ( $value['id'] == 'woocommerce_price_num_decimals' ) {
|
} elseif ( $value['id'] == 'woocommerce_price_num_decimals' ) {
|
||||||
|
@ -88,6 +89,19 @@ function woocommerce_update_options( $options ) {
|
||||||
$option_value = 2;
|
$option_value = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} elseif ( $value['id'] == 'woocommerce_hold_stock_minutes' ) {
|
||||||
|
|
||||||
|
if ( isset( $_POST[ $value['id'] ] ) ) {
|
||||||
|
$option_value = esc_attr( $_POST[ $value['id'] ] );
|
||||||
|
} else {
|
||||||
|
$option_value = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
wp_clear_scheduled_hook( 'woocommerce_cancel_unpaid_orders' );
|
||||||
|
|
||||||
|
if ( $option_value != '' )
|
||||||
|
wp_schedule_single_event( time() + ( absint( $option_value ) * 60 ), 'woocommerce_cancel_unpaid_orders' );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ( isset( $_POST[$value['id']] ) ) {
|
if ( isset( $_POST[$value['id']] ) ) {
|
||||||
|
@ -101,6 +115,7 @@ function woocommerce_update_options( $options ) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Special types
|
// Special types
|
||||||
|
case "multiselect" :
|
||||||
case "multi_select_countries" :
|
case "multi_select_countries" :
|
||||||
|
|
||||||
// Get countries array
|
// Get countries array
|
||||||
|
@ -175,7 +190,7 @@ function woocommerce_update_options( $options ) {
|
||||||
|
|
||||||
// Now save the options
|
// Now save the options
|
||||||
foreach( $update_options as $name => $value )
|
foreach( $update_options as $name => $value )
|
||||||
update_option( $name, $value, true );
|
update_option( $name, $value );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
|
@ -48,9 +48,9 @@ function woocommerce_shipping_methods_setting() {
|
||||||
<td>';
|
<td>';
|
||||||
|
|
||||||
if ($method->enabled == 'yes')
|
if ($method->enabled == 'yes')
|
||||||
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success.png" width="16 height="14" alt="yes" />';
|
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success@2x.png" width="16 height="14" alt="yes" />';
|
||||||
else
|
else
|
||||||
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off.png" width="16" height="14" alt="no" />';
|
echo '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off@2x.png" width="16" height="14" alt="no" />';
|
||||||
|
|
||||||
echo '</td>
|
echo '</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
|
@ -27,7 +27,7 @@ function woocommerce_tax_rates_setting() {
|
||||||
$current_class = $class;
|
$current_class = $class;
|
||||||
?>
|
?>
|
||||||
<h3><?php printf( __( 'Tax Rates for the "%s" Class', 'woocommerce' ), $current_class ? esc_html( $current_class ) : __( 'Standard', 'woocommerce' ) ); ?></h3>
|
<h3><?php printf( __( 'Tax Rates for the "%s" Class', 'woocommerce' ), $current_class ? esc_html( $current_class ) : __( 'Standard', 'woocommerce' ) ); ?></h3>
|
||||||
<p><?php printf( __( 'Define tax rates for countries and states below. <a href="%s">See here</a> for available country/state codes.', 'woocommerce' ), 'http://wcdocs.woothemes.com/?p=2163' ); ?></p>
|
<p><?php printf( __( 'Define tax rates for countries and states below. <a href="%s">See here</a> for available alpha-2 country codes.', 'woocommerce' ), 'http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes' ); ?></p>
|
||||||
<table class="wc_tax_rates widefat">
|
<table class="wc_tax_rates widefat">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -70,7 +70,7 @@ function woocommerce_tax_rates_setting() {
|
||||||
"SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates
|
"SELECT * FROM {$wpdb->prefix}woocommerce_tax_rates
|
||||||
WHERE tax_rate_class = %s
|
WHERE tax_rate_class = %s
|
||||||
ORDER BY tax_rate_order
|
ORDER BY tax_rate_order
|
||||||
" , $current_class ) );
|
" , sanitize_title( $current_class ) ) );
|
||||||
|
|
||||||
foreach ( $rates as $rate ) {
|
foreach ( $rates as $rate ) {
|
||||||
?>
|
?>
|
||||||
|
@ -165,16 +165,51 @@ function woocommerce_tax_rates_setting() {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var controlled = false;
|
||||||
var shifted = false;
|
var shifted = false;
|
||||||
|
var hasFocus = false;
|
||||||
|
|
||||||
jQuery(document).bind('keyup keydown', function(e){shifted = e.shiftKey} );
|
jQuery(document).bind('keyup keydown', function(e){ shifted = e.shiftKey; controlled = e.ctrlKey || e.metaKey } );
|
||||||
|
|
||||||
|
jQuery('#rates').on( 'focus click', 'input', function( e ) {
|
||||||
|
|
||||||
|
$this_row = jQuery(this).closest('tr');
|
||||||
|
|
||||||
|
if ( ( e.type == 'focus' && hasFocus != $this_row.index() ) || ( e.type == 'click' && jQuery(this).is(':focus') ) ) {
|
||||||
|
|
||||||
|
hasFocus = $this_row.index();
|
||||||
|
|
||||||
|
if ( ! shifted && ! controlled ) {
|
||||||
|
jQuery('#rates tr').removeClass('current').removeClass('last_selected');
|
||||||
|
$this_row.addClass('current').addClass('last_selected');
|
||||||
|
} else if ( shifted ) {
|
||||||
|
jQuery('#rates tr').removeClass('current');
|
||||||
|
$this_row.addClass('selected_now').addClass('current');
|
||||||
|
|
||||||
|
if ( jQuery('#rates tr.last_selected').size() > 0 ) {
|
||||||
|
if ( $this_row.index() > jQuery('#rates tr.last_selected').index() ) {
|
||||||
|
jQuery('#rates tr').slice( jQuery('#rates tr.last_selected').index(), $this_row.index() ).addClass('current');
|
||||||
|
} else {
|
||||||
|
jQuery('#rates tr').slice( $this_row.index(), jQuery('#rates tr.last_selected').index() + 1 ).addClass('current');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery('#rates tr').removeClass('last_selected');
|
||||||
|
$this_row.addClass('last_selected');
|
||||||
|
} else {
|
||||||
|
jQuery('#rates tr').removeClass('last_selected');
|
||||||
|
if ( controlled && jQuery(this).closest('tr').is('.current') ) {
|
||||||
|
$this_row.removeClass('current');
|
||||||
|
} else {
|
||||||
|
$this_row.addClass('current').addClass('last_selected');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery('#rates tr').removeClass('selected_now');
|
||||||
|
|
||||||
jQuery('.wc_tax_rates input').live( 'click focus', function( e ) {
|
|
||||||
if ( ! shifted ) {
|
|
||||||
jQuery('.wc_tax_rates tr').removeClass('current');
|
|
||||||
}
|
}
|
||||||
|
}).on( 'blur', 'input', function( e ) {
|
||||||
jQuery(this).closest('tr').addClass('current');
|
hasFocus = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('.wc_tax_rates .export').click(function() {
|
jQuery('.wc_tax_rates .export').click(function() {
|
||||||
|
@ -368,7 +403,7 @@ function woocommerce_tax_rates_setting_save() {
|
||||||
'tax_rate_compound' => $compound,
|
'tax_rate_compound' => $compound,
|
||||||
'tax_rate_shipping' => $shipping,
|
'tax_rate_shipping' => $shipping,
|
||||||
'tax_rate_order' => $i,
|
'tax_rate_order' => $i,
|
||||||
'tax_rate_class' => $current_class
|
'tax_rate_class' => sanitize_title( $current_class )
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -377,16 +412,25 @@ function woocommerce_tax_rates_setting_save() {
|
||||||
if ( ! empty( $postcode ) ) {
|
if ( ! empty( $postcode ) ) {
|
||||||
$postcodes = explode( ';', $postcode );
|
$postcodes = explode( ';', $postcode );
|
||||||
$postcodes = array_map( 'strtoupper', array_map( 'woocommerce_clean', $postcodes ) );
|
$postcodes = array_map( 'strtoupper', array_map( 'woocommerce_clean', $postcodes ) );
|
||||||
foreach( $postcodes as $postcode ) {
|
|
||||||
$wpdb->insert(
|
$postcode_query = array();
|
||||||
$wpdb->prefix . "woocommerce_tax_rate_locations",
|
|
||||||
array(
|
foreach( $postcodes as $postcode )
|
||||||
'location_code' => $postcode,
|
if ( strstr( $postcode, '-' ) ) {
|
||||||
'tax_rate_id' => $tax_rate_id,
|
$postcode_parts = explode( '-', $postcode );
|
||||||
'location_type' => 'postcode',
|
|
||||||
)
|
if ( is_numeric( $postcode_parts[0] ) && is_numeric( $postcode_parts[1] ) && $postcode_parts[1] > $postcode_parts[0] ) {
|
||||||
);
|
for ( $i = $postcode_parts[0]; $i <= $postcode_parts[1]; $i ++ ) {
|
||||||
}
|
if ( $i )
|
||||||
|
$postcode_query[] = "( '$i', $tax_rate_id, 'postcode' )";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ( $postcode )
|
||||||
|
$postcode_query[] = "( '$postcode', $tax_rate_id, 'postcode' )";
|
||||||
|
}
|
||||||
|
|
||||||
|
$wpdb->query( "INSERT INTO {$wpdb->prefix}woocommerce_tax_rate_locations ( location_code, tax_rate_id, location_type ) VALUES " . implode( ',', $postcode_query ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $city ) ) {
|
if ( ! empty( $city ) ) {
|
||||||
|
@ -447,7 +491,7 @@ function woocommerce_tax_rates_setting_save() {
|
||||||
'tax_rate_compound' => $compound,
|
'tax_rate_compound' => $compound,
|
||||||
'tax_rate_shipping' => $shipping,
|
'tax_rate_shipping' => $shipping,
|
||||||
'tax_rate_order' => $i,
|
'tax_rate_order' => $i,
|
||||||
'tax_rate_class' => $current_class
|
'tax_rate_class' => sanitize_title( $current_class )
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'tax_rate_id' => $tax_rate_id
|
'tax_rate_id' => $tax_rate_id
|
||||||
|
@ -471,11 +515,13 @@ function woocommerce_tax_rates_setting_save() {
|
||||||
|
|
||||||
if ( is_numeric( $postcode_parts[0] ) && is_numeric( $postcode_parts[1] ) && $postcode_parts[1] > $postcode_parts[0] ) {
|
if ( is_numeric( $postcode_parts[0] ) && is_numeric( $postcode_parts[1] ) && $postcode_parts[1] > $postcode_parts[0] ) {
|
||||||
for ( $i = $postcode_parts[0]; $i <= $postcode_parts[1]; $i ++ ) {
|
for ( $i = $postcode_parts[0]; $i <= $postcode_parts[1]; $i ++ ) {
|
||||||
$postcode_query[] = "( '$i', $tax_rate_id, 'postcode' )";
|
if ( $i )
|
||||||
|
$postcode_query[] = "( '$i', $tax_rate_id, 'postcode' )";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$postcode_query[] = "( '$postcode', $tax_rate_id, 'postcode' )";
|
if ( $postcode )
|
||||||
|
$postcode_query[] = "( '$postcode', $tax_rate_id, 'postcode' )";
|
||||||
}
|
}
|
||||||
|
|
||||||
$wpdb->query( "INSERT INTO {$wpdb->prefix}woocommerce_tax_rate_locations ( location_code, tax_rate_id, location_type ) VALUES " . implode( ',', $postcode_query ) );
|
$wpdb->query( "INSERT INTO {$wpdb->prefix}woocommerce_tax_rate_locations ( location_code, tax_rate_id, location_type ) VALUES " . implode( ',', $postcode_query ) );
|
||||||
|
@ -491,14 +537,16 @@ function woocommerce_tax_rates_setting_save() {
|
||||||
$cities = explode( ';', $city );
|
$cities = explode( ';', $city );
|
||||||
$cities = array_map( 'strtoupper', array_map( 'woocommerce_clean', $cities ) );
|
$cities = array_map( 'strtoupper', array_map( 'woocommerce_clean', $cities ) );
|
||||||
foreach( $cities as $city ) {
|
foreach( $cities as $city ) {
|
||||||
$wpdb->insert(
|
if ( $city ) {
|
||||||
$wpdb->prefix . "woocommerce_tax_rate_locations",
|
$wpdb->insert(
|
||||||
array(
|
$wpdb->prefix . "woocommerce_tax_rate_locations",
|
||||||
'location_code' => $city,
|
array(
|
||||||
'tax_rate_id' => $tax_rate_id,
|
'location_code' => $city,
|
||||||
'location_type' => 'city',
|
'tax_rate_id' => $tax_rate_id,
|
||||||
)
|
'location_type' => 'city',
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
/**
|
/**
|
||||||
* Attributes admin panel
|
* Attributes admin panel
|
||||||
*
|
*
|
||||||
* Shows the created attributes and lets you add new ones.
|
* Shows the created attributes and lets you add new ones or edit existing ones.
|
||||||
* The added attributes are stored in the database and can be used for layered navigation.
|
* The added attributes are stored in the database and can be used for layered navigation.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
|
@ -24,159 +24,180 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
function woocommerce_attributes() {
|
function woocommerce_attributes() {
|
||||||
global $wpdb, $woocommerce;
|
global $wpdb, $woocommerce;
|
||||||
|
|
||||||
|
// Action to perform: add, edit, delete or none
|
||||||
|
$action = '';
|
||||||
if ( ! empty( $_POST['add_new_attribute'] ) ) {
|
if ( ! empty( $_POST['add_new_attribute'] ) ) {
|
||||||
|
$action = 'add';
|
||||||
check_admin_referer( 'woocommerce-add-new_attribute' );
|
|
||||||
|
|
||||||
$attribute_name = woocommerce_sanitize_taxonomy_name( stripslashes( $_POST['attribute_name'] ) );
|
|
||||||
$attribute_type = esc_attr( $_POST['attribute_type'] );
|
|
||||||
$attribute_label = esc_attr( $_POST['attribute_label'] );
|
|
||||||
$attribute_orderby = esc_attr( $_POST['attribute_orderby'] );
|
|
||||||
|
|
||||||
if ( ! $attribute_label )
|
|
||||||
$attribute_label = ucwords( $attribute_name );
|
|
||||||
|
|
||||||
if ( ! $attribute_name )
|
|
||||||
$attribute_name = sanitize_title( $attribute_label );
|
|
||||||
|
|
||||||
if ( strlen( $attribute_name ) >= 30 )
|
|
||||||
echo '<div id="woocommerce_errors" class="error fade"><p>' . sprintf( __( 'Slug %s is too long', 'woocommerce' ), sanitize_title( $attribute_name ) ) . '</p></div>';
|
|
||||||
|
|
||||||
if ( $attribute_name && strlen( $attribute_name ) < 30 && $attribute_type && ! taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attribute_name ) ) ) {
|
|
||||||
|
|
||||||
$wpdb->insert(
|
|
||||||
$wpdb->prefix . "woocommerce_attribute_taxonomies",
|
|
||||||
array(
|
|
||||||
'attribute_name' => $attribute_name,
|
|
||||||
'attribute_label' => $attribute_label,
|
|
||||||
'attribute_type' => $attribute_type,
|
|
||||||
'attribute_orderby' => $attribute_orderby
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
wp_safe_redirect( get_admin_url() . 'edit.php?post_type=product&page=woocommerce_attributes' );
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
} elseif ( ! empty( $_POST['save_attribute'] ) && ! empty( $_GET['edit'] ) ) {
|
} elseif ( ! empty( $_POST['save_attribute'] ) && ! empty( $_GET['edit'] ) ) {
|
||||||
|
$action = 'edit';
|
||||||
$edit = absint( $_GET['edit'] );
|
|
||||||
check_admin_referer( 'woocommerce-save-attribute_' . $edit );
|
|
||||||
|
|
||||||
$attribute_name = woocommerce_sanitize_taxonomy_name( stripslashes( $_POST['attribute_name'] ) );
|
|
||||||
$attribute_type = esc_attr( $_POST['attribute_type'] );
|
|
||||||
$attribute_label = esc_attr( $_POST['attribute_label'] );
|
|
||||||
$attribute_orderby = esc_attr( $_POST['attribute_orderby'] );
|
|
||||||
|
|
||||||
if ( ! $attribute_label )
|
|
||||||
$attribute_label = ucwords( $attribute_name );
|
|
||||||
|
|
||||||
if ( ! $attribute_name )
|
|
||||||
$attribute_name = sanitize_title( $attribute_label );
|
|
||||||
|
|
||||||
$old_attribute_name = woocommerce_sanitize_taxonomy_name( $wpdb->get_var( "SELECT attribute_name FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = $edit" ) );
|
|
||||||
|
|
||||||
if ( $old_attribute_name != $attribute_name && taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attribute_name ) ) ) {
|
|
||||||
|
|
||||||
echo '<div id="woocommerce_errors" class="error fade"><p>' . __( 'Taxonomy exists - please change the slug', 'woocommerce' ) . '</p></div>';
|
|
||||||
|
|
||||||
} elseif ( $attribute_name && strlen( $attribute_name ) < 30 && $attribute_type ) {
|
|
||||||
|
|
||||||
$wpdb->update(
|
|
||||||
$wpdb->prefix . "woocommerce_attribute_taxonomies",
|
|
||||||
array(
|
|
||||||
'attribute_name' => $attribute_name,
|
|
||||||
'attribute_label' => $attribute_label,
|
|
||||||
'attribute_type' => $attribute_type,
|
|
||||||
'attribute_orderby' => $attribute_orderby
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'attribute_id' => $edit
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( $old_attribute_name != $attribute_name && ! empty( $old_attribute_name ) ) {
|
|
||||||
|
|
||||||
// Update taxonomies in the wp term taxonomy table
|
|
||||||
$wpdb->update(
|
|
||||||
$wpdb->term_taxonomy,
|
|
||||||
array(
|
|
||||||
'taxonomy' => $woocommerce->attribute_taxonomy_name( $attribute_name )
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'taxonomy' => $woocommerce->attribute_taxonomy_name( $old_attribute_name )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Update taxonomy ordering term meta
|
|
||||||
$wpdb->update(
|
|
||||||
$wpdb->prefix . "woocommerce_termmeta",
|
|
||||||
array(
|
|
||||||
'meta_key' => 'order_pa_' . sanitize_title( $attribute_name )
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'meta_key' => 'order_pa_' . sanitize_title( $old_attribute_name )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Update product attributes which use this taxonomy
|
|
||||||
$old_attribute_name_length = strlen($old_attribute_name) + 3;
|
|
||||||
$attribute_name_length = strlen($attribute_name) + 3;
|
|
||||||
|
|
||||||
$wpdb->query( "
|
|
||||||
UPDATE {$wpdb->postmeta}
|
|
||||||
SET meta_value = replace( meta_value, 's:{$old_attribute_name_length}:\"pa_{$old_attribute_name}\"', 's:{$attribute_name_length}:\"pa_{$attribute_name}\"' )
|
|
||||||
WHERE meta_key = '_product_attributes'"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Update variations which use this taxonomy
|
|
||||||
$wpdb->update(
|
|
||||||
$wpdb->postmeta,
|
|
||||||
array(
|
|
||||||
'meta_key' => 'attribute_pa_' . sanitize_title( $attribute_name )
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'meta_key' => 'attribute_pa_' . sanitize_title( $old_attribute_name )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
wp_safe_redirect( get_admin_url() . 'edit.php?post_type=product&page=woocommerce_attributes' );
|
|
||||||
exit;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} elseif ( ! empty( $_GET['delete'] ) ) {
|
} elseif ( ! empty( $_GET['delete'] ) ) {
|
||||||
|
$action = 'delete';
|
||||||
$delete = absint( $_GET['delete'] );
|
|
||||||
check_admin_referer( 'woocommerce-delete-attribute_' . $delete );
|
|
||||||
|
|
||||||
$att_name = $wpdb->get_var( "SELECT attribute_name FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = $delete" );
|
|
||||||
|
|
||||||
if ( $att_name && $wpdb->query( "DELETE FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_id = $delete" ) ) {
|
|
||||||
|
|
||||||
$taxonomy = $woocommerce->attribute_taxonomy_name( $att_name );
|
|
||||||
|
|
||||||
if ( taxonomy_exists( $taxonomy ) ) {
|
|
||||||
|
|
||||||
$terms = get_terms( $taxonomy, 'orderby=name&hide_empty=0');
|
|
||||||
foreach ( $terms as $term )
|
|
||||||
wp_delete_term( $term->term_id, $taxonomy );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
wp_safe_redirect( get_admin_url() . 'edit.php?post_type=product&page=woocommerce_attributes' );
|
|
||||||
exit;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! empty( $_GET['edit'] ) && $_GET['edit'] > 0 )
|
// Add or edit an attribute
|
||||||
|
if ( 'add' === $action || 'edit' === $action ) {
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ( 'add' === $action ) {
|
||||||
|
check_admin_referer( 'woocommerce-add-new_attribute' );
|
||||||
|
}
|
||||||
|
if ( 'edit' === $action ) {
|
||||||
|
$attribute_id = absint( $_GET['edit'] );
|
||||||
|
check_admin_referer( 'woocommerce-save-attribute_' . $attribute_id );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grab the submitted data
|
||||||
|
$attribute_label = ( isset( $_POST['attribute_label'] ) ) ? (string) $_POST['attribute_label'] : '';
|
||||||
|
$attribute_name = ( isset( $_POST['attribute_name'] ) ) ? woocommerce_sanitize_taxonomy_name( stripslashes( (string) $_POST['attribute_name'] ) ) : '';
|
||||||
|
$attribute_type = ( isset( $_POST['attribute_type'] ) ) ? (string) $_POST['attribute_type'] : '';
|
||||||
|
$attribute_orderby = ( isset( $_POST['attribute_orderby'] ) ) ? (string) $_POST['attribute_orderby'] : '';
|
||||||
|
|
||||||
|
// Auto-generate the label or slug if only one of both was provided
|
||||||
|
if ( ! $attribute_label ) {
|
||||||
|
$attribute_label = ucwords( $attribute_name );
|
||||||
|
} elseif ( ! $attribute_name ) {
|
||||||
|
$attribute_name = woocommerce_sanitize_taxonomy_name( stripslashes( $attribute_label ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forbidden attribute names
|
||||||
|
// http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms
|
||||||
|
$reserved_terms = array(
|
||||||
|
'attachment', 'attachment_id', 'author', 'author_name', 'calendar', 'cat', 'category', 'category__and',
|
||||||
|
'category__in', 'category__not_in', 'category_name', 'comments_per_page', 'comments_popup', 'cpage', 'day',
|
||||||
|
'debug', 'error', 'exact', 'feed', 'hour', 'link_category', 'm', 'minute', 'monthnum', 'more', 'name',
|
||||||
|
'nav_menu', 'nopaging', 'offset', 'order', 'orderby', 'p', 'page', 'page_id', 'paged', 'pagename', 'pb', 'perm',
|
||||||
|
'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', 'post_tag', 'post_type',
|
||||||
|
'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search', 'second', 'sentence',
|
||||||
|
'showposts', 'static', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', 'tag_id',
|
||||||
|
'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'type', 'w', 'withcomments', 'withoutcomments', 'year',
|
||||||
|
);
|
||||||
|
|
||||||
|
// Error checking
|
||||||
|
if ( ! $attribute_name || ! $attribute_name || ! $attribute_type ) {
|
||||||
|
$error = __( 'Please, provide an attribute name, slug and type.', 'woocommerce' );
|
||||||
|
} elseif ( strlen( $attribute_name ) >= 28 ) {
|
||||||
|
$error = sprintf( __( 'Slug “%s” is too long (28 characters max). Shorten it, please.', 'woocommerce' ), sanitize_title( $attribute_name ) );
|
||||||
|
} elseif ( in_array( $attribute_name, $reserved_terms ) ) {
|
||||||
|
$error = sprintf( __( 'Slug “%s” is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), sanitize_title( $attribute_name ) );
|
||||||
|
} else {
|
||||||
|
$taxonomy_exists = taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attribute_name ) );
|
||||||
|
if ( 'add' === $action && $taxonomy_exists ) {
|
||||||
|
$error = sprintf( __( 'Slug “%s” is already in use. Change it, please.', 'woocommerce' ), sanitize_title( $attribute_name ) );
|
||||||
|
}
|
||||||
|
if ( 'edit' === $action ) {
|
||||||
|
$old_attribute_name = woocommerce_sanitize_taxonomy_name( $wpdb->get_var( "SELECT attribute_name FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_id = $attribute_id" ) );
|
||||||
|
if ( $old_attribute_name != $attribute_name && $taxonomy_exists ) {
|
||||||
|
$error = sprintf( __( 'Slug “%s” is already in use. Change it, please.', 'woocommerce' ), sanitize_title( $attribute_name ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the error message if any
|
||||||
|
if ( ! empty( $error ) ) {
|
||||||
|
echo '<div id="woocommerce_errors" class="error fade"><p>' . $error . '</p></div>';
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Add new attribute
|
||||||
|
if ( 'add' === $action ) {
|
||||||
|
$wpdb->insert(
|
||||||
|
$wpdb->prefix . 'woocommerce_attribute_taxonomies',
|
||||||
|
array(
|
||||||
|
'attribute_label' => $attribute_label,
|
||||||
|
'attribute_name' => $attribute_name,
|
||||||
|
'attribute_type' => $attribute_type,
|
||||||
|
'attribute_orderby' => $attribute_orderby,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$action_completed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit existing attribute
|
||||||
|
if ( 'edit' === $action ) {
|
||||||
|
$wpdb->update(
|
||||||
|
$wpdb->prefix . 'woocommerce_attribute_taxonomies',
|
||||||
|
array(
|
||||||
|
'attribute_label' => $attribute_label,
|
||||||
|
'attribute_name' => $attribute_name,
|
||||||
|
'attribute_type' => $attribute_type,
|
||||||
|
'attribute_orderby' => $attribute_orderby,
|
||||||
|
),
|
||||||
|
array( 'attribute_id' => $attribute_id )
|
||||||
|
);
|
||||||
|
|
||||||
|
if ( $old_attribute_name != $attribute_name && ! empty( $old_attribute_name ) ) {
|
||||||
|
// Update taxonomies in the wp term taxonomy table
|
||||||
|
$wpdb->update(
|
||||||
|
$wpdb->term_taxonomy,
|
||||||
|
array( 'taxonomy' => $woocommerce->attribute_taxonomy_name( $attribute_name ) ),
|
||||||
|
array( 'taxonomy' => $woocommerce->attribute_taxonomy_name( $old_attribute_name ) )
|
||||||
|
);
|
||||||
|
|
||||||
|
// Update taxonomy ordering term meta
|
||||||
|
$wpdb->update(
|
||||||
|
$wpdb->prefix . 'woocommerce_termmeta',
|
||||||
|
array( 'meta_key' => 'order_pa_' . sanitize_title( $attribute_name ) ),
|
||||||
|
array( 'meta_key' => 'order_pa_' . sanitize_title( $old_attribute_name ) )
|
||||||
|
);
|
||||||
|
|
||||||
|
// Update product attributes which use this taxonomy
|
||||||
|
$old_attribute_name_length = strlen( $old_attribute_name ) + 3;
|
||||||
|
$attribute_name_length = strlen( $attribute_name ) + 3;
|
||||||
|
|
||||||
|
$wpdb->query( "
|
||||||
|
UPDATE {$wpdb->postmeta}
|
||||||
|
SET meta_value = REPLACE( meta_value, 's:{$old_attribute_name_length}:\"pa_{$old_attribute_name}\"', 's:{$attribute_name_length}:\"pa_{$attribute_name}\"' )
|
||||||
|
WHERE meta_key = '_product_attributes'"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Update variations which use this taxonomy
|
||||||
|
$wpdb->update(
|
||||||
|
$wpdb->postmeta,
|
||||||
|
array( 'meta_key' => 'attribute_pa_' . sanitize_title( $attribute_name ) ),
|
||||||
|
array( 'meta_key' => 'attribute_pa_' . sanitize_title( $old_attribute_name ) )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$action_completed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete an attribute
|
||||||
|
if ( 'delete' === $action ) {
|
||||||
|
// Security check
|
||||||
|
$attribute_id = absint( $_GET['delete'] );
|
||||||
|
check_admin_referer( 'woocommerce-delete-attribute_' . $attribute_id );
|
||||||
|
|
||||||
|
$attribute_name = $wpdb->get_var( "SELECT attribute_name FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_id = $attribute_id" );
|
||||||
|
|
||||||
|
if ( $attribute_name && $wpdb->query( "DELETE FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_id = $attribute_id" ) ) {
|
||||||
|
|
||||||
|
$taxonomy = $woocommerce->attribute_taxonomy_name( $attribute_name );
|
||||||
|
|
||||||
|
if ( taxonomy_exists( $taxonomy ) ) {
|
||||||
|
$terms = get_terms( $taxonomy, 'orderby=name&hide_empty=0' );
|
||||||
|
foreach ( $terms as $term ) {
|
||||||
|
wp_delete_term( $term->term_id, $taxonomy );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$action_completed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If an attribute was added, edited or deleted: clear cache and redirect
|
||||||
|
if ( ! empty( $action_completed ) ) {
|
||||||
|
delete_transient( 'wc_attribute_taxonomies' );
|
||||||
|
wp_safe_redirect( get_admin_url() . 'edit.php?post_type=product&page=woocommerce_attributes' );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show admin interface
|
||||||
|
if ( ! empty( $_GET['edit'] ) )
|
||||||
woocommerce_edit_attribute();
|
woocommerce_edit_attribute();
|
||||||
else
|
else
|
||||||
woocommerce_add_attribute();
|
woocommerce_add_attribute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -232,6 +253,7 @@ function woocommerce_edit_attribute() {
|
||||||
<select name="attribute_type" id="attribute_type">
|
<select name="attribute_type" id="attribute_type">
|
||||||
<option value="select" <?php selected( $att_type, 'select' ); ?>><?php _e( 'Select', 'woocommerce' ) ?></option>
|
<option value="select" <?php selected( $att_type, 'select' ); ?>><?php _e( 'Select', 'woocommerce' ) ?></option>
|
||||||
<option value="text" <?php selected( $att_type, 'text' ); ?>><?php _e( 'Text', 'woocommerce' ) ?></option>
|
<option value="text" <?php selected( $att_type, 'text' ); ?>><?php _e( 'Text', 'woocommerce' ) ?></option>
|
||||||
|
<?php do_action('woocommerce_admin_attribute_types'); ?>
|
||||||
</select>
|
</select>
|
||||||
<p class="description"><?php _e( 'Determines how you select attributes for products. <strong>Text</strong> allows manual entry via the product page, whereas <strong>select</strong> attribute terms can be defined from this section. If you plan on using an attribute for variations use <strong>select</strong>.', 'woocommerce' ); ?></p>
|
<p class="description"><?php _e( 'Determines how you select attributes for products. <strong>Text</strong> allows manual entry via the product page, whereas <strong>select</strong> attribute terms can be defined from this section. If you plan on using an attribute for variations use <strong>select</strong>.', 'woocommerce' ); ?></p>
|
||||||
</td>
|
</td>
|
||||||
|
@ -364,6 +386,7 @@ function woocommerce_add_attribute() {
|
||||||
<select name="attribute_type" id="attribute_type">
|
<select name="attribute_type" id="attribute_type">
|
||||||
<option value="select"><?php _e( 'Select', 'woocommerce' ) ?></option>
|
<option value="select"><?php _e( 'Select', 'woocommerce' ) ?></option>
|
||||||
<option value="text"><?php _e( 'Text', 'woocommerce' ) ?></option>
|
<option value="text"><?php _e( 'Text', 'woocommerce' ) ?></option>
|
||||||
|
<?php do_action('woocommerce_admin_attribute_types'); ?>
|
||||||
</select>
|
</select>
|
||||||
<p class="description"><?php _e( 'Determines how you select attributes for products. <strong>Text</strong> allows manual entry via the product page, whereas <strong>select</strong> attribute terms can be defined from this section. If you plan on using an attribute for variations use <strong>select</strong>.', 'woocommerce' ); ?></p>
|
<p class="description"><?php _e( 'Determines how you select attributes for products. <strong>Text</strong> allows manual entry via the product page, whereas <strong>select</strong> attribute terms can be defined from this section. If you plan on using an attribute for variations use <strong>select</strong>.', 'woocommerce' ); ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -26,7 +26,7 @@ function woocommerce_admin_help_tab_content() {
|
||||||
'title' => __( 'Overview', 'woocommerce' ),
|
'title' => __( 'Overview', 'woocommerce' ),
|
||||||
'content' =>
|
'content' =>
|
||||||
|
|
||||||
'<p>' . sprintf(__( 'Thank you for using WooCommerce :) Should you need help using or extending WooCommerce please <a href="%s">read the documentation</a>. For further assistance you can use the <a href="%s">community forum</a> or if you have access, <a href="%s">the members forum</a>.', 'woocommerce' ), 'http://www.woothemes.com/woocommerce-docs/', 'http://www.woothemes.com/support-forum/?viewforum=150', 'http://www.woothemes.com/support-forum/') . '</p>' .
|
'<p>' . sprintf(__( 'Thank you for using WooCommerce :) Should you need help using or extending WooCommerce please <a href="%s">read the documentation</a>. For further assistance you can use the <a href="%s">community forum</a> or if you have access, <a href="%s">our support desk</a>.', 'woocommerce' ), 'http://docs.woothemes.com/', 'http://wordpress.org/support/plugin/woocommerce', 'http://support.woothemes.com') . '</p>' .
|
||||||
|
|
||||||
'<p>' . __( 'If you are having problems, or to assist us with support, please check the status page to identify any problems with your configuration:', 'woocommerce' ) . '</p>' .
|
'<p>' . __( 'If you are having problems, or to assist us with support, please check the status page to identify any problems with your configuration:', 'woocommerce' ) . '</p>' .
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ function woocommerce_admin_help_tab_content() {
|
||||||
'content' =>
|
'content' =>
|
||||||
'<p>' . __( 'The reports section can be accessed from the left-hand navigation menu. Here you can generate reports for sales and customers.', 'woocommerce' ) . '</p>' .
|
'<p>' . __( 'The reports section can be accessed from the left-hand navigation menu. Here you can generate reports for sales and customers.', 'woocommerce' ) . '</p>' .
|
||||||
'<p><strong>' . __( 'Sales', 'woocommerce' ) . '</strong> - ' . __( 'Reports for sales based on date, top sellers and top earners.', 'woocommerce' ) . '</p>' .
|
'<p><strong>' . __( 'Sales', 'woocommerce' ) . '</strong> - ' . __( 'Reports for sales based on date, top sellers and top earners.', 'woocommerce' ) . '</p>' .
|
||||||
|
'<p><strong>' . __( 'Coupons', 'woocommerce' ) . '</strong> - ' . __( 'Coupon usage reports.', 'woocommerce' ) . '</p>' .
|
||||||
'<p><strong>' . __( 'Customers', 'woocommerce' ) . '</strong> - ' . __( 'Customer reports, such as signups per day.', 'woocommerce' ) . '</p>' .
|
'<p><strong>' . __( 'Customers', 'woocommerce' ) . '</strong> - ' . __( 'Customer reports, such as signups per day.', 'woocommerce' ) . '</p>' .
|
||||||
'<p><strong>' . __( 'Stock', 'woocommerce' ) . '</strong> - ' . __( 'Stock reports for low stock and out of stock items.', 'woocommerce' ) . '</p>'
|
'<p><strong>' . __( 'Stock', 'woocommerce' ) . '</strong> - ' . __( 'Stock reports for low stock and out of stock items.', 'woocommerce' ) . '</p>'
|
||||||
) );
|
) );
|
||||||
|
@ -79,11 +80,11 @@ function woocommerce_admin_help_tab_content() {
|
||||||
|
|
||||||
$screen->set_help_sidebar(
|
$screen->set_help_sidebar(
|
||||||
'<p><strong>' . __( 'For more information:', 'woocommerce' ) . '</strong></p>' .
|
'<p><strong>' . __( 'For more information:', 'woocommerce' ) . '</strong></p>' .
|
||||||
'<p>' . __( '<a href="http://www.woothemes.com/woocommerce/" target="_blank">WooCommerce</a>', 'woocommerce' ) . '</p>' .
|
'<p><a href="http://www.woothemes.com/woocommerce/" target="_blank">' . __( 'WooCommerce', 'woocommerce' ) . '</a></p>' .
|
||||||
'<p>' . __( '<a href="http://wordpress.org/extend/plugins/woocommerce/" target="_blank">Project on WordPress.org</a>', 'woocommerce' ) . '</p>' .
|
'<p><a href="http://wordpress.org/extend/plugins/woocommerce/" target="_blank">' . __( 'Project on WordPress.org', 'woocommerce' ) . '</a></p>' .
|
||||||
'<p>' . __( '<a href="https://github.com/woothemes/woocommerce" target="_blank">Project on Github</a>', 'woocommerce' ) . '</p>' .
|
'<p><a href="https://github.com/woothemes/woocommerce" target="_blank">' . __( 'Project on Github', 'woocommerce' ) . '</a></p>' .
|
||||||
'<p>' . __( '<a href="http://www.woothemes.com/woocommerce-docs/" target="_blank">WooCommerce Docs</a>', 'woocommerce' ) . '</p>' .
|
'<p><a href="http://docs.woothemes.com/" target="_blank">' . __( 'WooCommerce Docs', 'woocommerce' ) . '</a></p>' .
|
||||||
'<p>' . __( '<a href="http://www.woothemes.com/extensions/woocommerce-extensions/" target="_blank">Official Extensions</a>', 'woocommerce' ) . '</p>' .
|
'<p><a href="http://www.woothemes.com/product-category/woocommerce-extensions/" target="_blank">' . __( 'Official Extensions', 'woocommerce' ) . '</a></p>' .
|
||||||
'<p>' . __( '<a href="http://www.woothemes.com/themes/woocommerce-themes/" target="_blank">Official Themes</a>', 'woocommerce' ) . '</p>'
|
'<p><a href="http://www.woothemes.com/product-category/themes/woocommerce/" target="_blank">' . __( 'Official Themes', 'woocommerce' ) . '</a></p>'
|
||||||
);
|
);
|
||||||
}
|
}
|
|
@ -276,7 +276,7 @@ function woocommerce_dashboard_recent_reviews() {
|
||||||
$rating = get_comment_meta( $comment->comment_ID, 'rating', true );
|
$rating = get_comment_meta( $comment->comment_ID, 'rating', true );
|
||||||
|
|
||||||
echo '<div class="star-rating" title="' . $rating . '">
|
echo '<div class="star-rating" title="' . $rating . '">
|
||||||
<span style="width:'. ( $rating * 10 ) . 'px">' . $rating . ' ' . __( 'out of 5', 'woocommerce' ) . '</span></div>';
|
<span style="width:'. ( $rating * 20 ) . '%">' . $rating . ' ' . __( 'out of 5', 'woocommerce' ) . '</span></div>';
|
||||||
|
|
||||||
echo '<h4 class="meta"><a href="' . get_permalink( $comment->ID ) . '#comment-' . absint( $comment->comment_ID ) .'">' . esc_html__( $comment->post_title ) . '</a> reviewed by ' . esc_html( $comment->comment_author ) .'</h4>';
|
echo '<h4 class="meta"><a href="' . get_permalink( $comment->ID ) . '#comment-' . absint( $comment->comment_ID ) .'">' . esc_html__( $comment->post_title ) . '</a> reviewed by ' . esc_html( $comment->comment_author ) .'</h4>';
|
||||||
echo '<blockquote>' . wp_kses_data( $comment->comment_excerpt ) . ' [...]</blockquote></li>';
|
echo '<blockquote>' . wp_kses_data( $comment->comment_excerpt ) . ' [...]</blockquote></li>';
|
||||||
|
@ -447,13 +447,11 @@ function woocommerce_dashboard_sales_js() {
|
||||||
// Queue scripts
|
// Queue scripts
|
||||||
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
||||||
|
|
||||||
wp_register_script( 'woocommerce_dashboard_sales', $woocommerce->plugin_url() . '/assets/js/admin/dashboard_sales'.$suffix.'.js', 'jquery', '1.0' );
|
wp_register_script( 'woocommerce_dashboard_sales', $woocommerce->plugin_url() . '/assets/js/admin/dashboard_sales' . $suffix . '.js', array( 'jquery', 'flot', 'flot-resize' ), '1.0' );
|
||||||
wp_register_script( 'flot', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot'.$suffix.'.js', 'jquery', '1.0' );
|
wp_register_script( 'flot', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot'.$suffix.'.js', 'jquery', '1.0' );
|
||||||
wp_register_script( 'flot-resize', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot.resize'.$suffix.'.js', 'jquery', '1.0' );
|
wp_register_script( 'flot-resize', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot.resize'.$suffix.'.js', 'jquery', '1.0' );
|
||||||
|
|
||||||
wp_localize_script( 'woocommerce_dashboard_sales', 'params', $params );
|
wp_localize_script( 'woocommerce_dashboard_sales', 'params', $params );
|
||||||
|
|
||||||
wp_print_scripts('flot');
|
|
||||||
wp_print_scripts('flot-resize');
|
|
||||||
wp_print_scripts('woocommerce_dashboard_sales');
|
wp_print_scripts('woocommerce_dashboard_sales');
|
||||||
}
|
}
|
|
@ -20,33 +20,29 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocomerce_check_download_folder_protection() {
|
function woocommerce_check_download_folder_protection() {
|
||||||
$upload_dir = wp_upload_dir();
|
$upload_dir = wp_upload_dir();
|
||||||
$downloads_url = $upload_dir['basedir'] . '/woocommerce_uploads';
|
$downloads_url = $upload_dir['basedir'] . '/woocommerce_uploads';
|
||||||
$download_method = get_option('woocommerce_file_download_method');
|
$download_method = get_option('woocommerce_file_download_method');
|
||||||
|
|
||||||
if ($download_method=='redirect') :
|
if ( $download_method == 'redirect' ) {
|
||||||
|
|
||||||
// Redirect method - don't protect
|
// Redirect method - don't protect
|
||||||
if (file_exists($downloads_url.'/.htaccess')) :
|
if ( file_exists( $downloads_url . '/.htaccess' ) )
|
||||||
unlink( $downloads_url . '/.htaccess' );
|
unlink( $downloads_url . '/.htaccess' );
|
||||||
endif;
|
|
||||||
|
|
||||||
flush_rewrite_rules( true );
|
} else {
|
||||||
|
|
||||||
else :
|
|
||||||
|
|
||||||
// Force method - protect, add rules to the htaccess file
|
// Force method - protect, add rules to the htaccess file
|
||||||
if (!file_exists($downloads_url.'/.htaccess')) :
|
if ( ! file_exists( $downloads_url . '/.htaccess' ) ) {
|
||||||
if ($file_handle = @fopen( $downloads_url . '/.htaccess', 'w' )) :
|
if ( $file_handle = @fopen( $downloads_url . '/.htaccess', 'w' ) ) {
|
||||||
fwrite($file_handle, 'deny from all');
|
fwrite( $file_handle, 'deny from all' );
|
||||||
fclose($file_handle);
|
fclose( $file_handle );
|
||||||
endif;
|
}
|
||||||
endif;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flush_rewrite_rules( true );
|
flush_rewrite_rules();
|
||||||
|
|
||||||
endif;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,7 +81,8 @@ function woocommerce_ms_protect_download_rewite_rules( $rewrite ) {
|
||||||
function woocommerce_delete_post( $id ) {
|
function woocommerce_delete_post( $id ) {
|
||||||
global $woocommerce, $wpdb;
|
global $woocommerce, $wpdb;
|
||||||
|
|
||||||
if ( ! current_user_can( 'delete_posts' ) ) return;
|
if ( ! current_user_can( 'delete_posts' ) )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( $id > 0 ) {
|
if ( $id > 0 ) {
|
||||||
|
|
||||||
|
@ -94,11 +91,20 @@ function woocommerce_delete_post( $id ) {
|
||||||
switch( $post_type ) {
|
switch( $post_type ) {
|
||||||
case 'product' :
|
case 'product' :
|
||||||
|
|
||||||
if ( $children_products =& get_children( 'post_parent=' . $id . '&post_type=product_variation' ) )
|
if ( $child_product_variations =& get_children( 'post_parent=' . $id . '&post_type=product_variation' ) )
|
||||||
if ( $children_products )
|
if ( $child_product_variations )
|
||||||
foreach ( $children_products as $child )
|
foreach ( $child_product_variations as $child )
|
||||||
wp_delete_post( $child->ID, true );
|
wp_delete_post( $child->ID, true );
|
||||||
|
|
||||||
|
if ( $child_products =& get_children( 'post_parent=' . $id . '&post_type=product' ) )
|
||||||
|
if ( $child_products )
|
||||||
|
foreach ( $child_products as $child ) {
|
||||||
|
$child_post = array();
|
||||||
|
$child_post['ID'] = $child->ID;
|
||||||
|
$child_post['post_parent'] = 0;
|
||||||
|
wp_update_post( $child_post );
|
||||||
|
}
|
||||||
|
|
||||||
$woocommerce->clear_product_transients();
|
$woocommerce->clear_product_transients();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -254,20 +260,6 @@ function woocommerce_prevent_admin_access() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fix 'insert into post' buttons for images
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param mixed $vars
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function woocommerce_allow_img_insertion( $vars ) {
|
|
||||||
$vars['send'] = true; // 'send' as in "Send to Editor"
|
|
||||||
return($vars);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the directory for uploads.
|
* Filter the directory for uploads.
|
||||||
*
|
*
|
||||||
|
@ -277,16 +269,15 @@ function woocommerce_allow_img_insertion( $vars ) {
|
||||||
*/
|
*/
|
||||||
function woocommerce_downloads_upload_dir( $pathdata ) {
|
function woocommerce_downloads_upload_dir( $pathdata ) {
|
||||||
|
|
||||||
if (isset($_POST['type']) && $_POST['type'] == 'downloadable_product') :
|
// Change upload dir
|
||||||
|
if ( isset( $_POST['type'] ) && $_POST['type'] == 'downloadable_product' ) {
|
||||||
// Uploading a downloadable file
|
// Uploading a downloadable file
|
||||||
$subdir = '/woocommerce_uploads'.$pathdata['subdir'];
|
$subdir = '/woocommerce_uploads'.$pathdata['subdir'];
|
||||||
$pathdata['path'] = str_replace($pathdata['subdir'], $subdir, $pathdata['path']);
|
$pathdata['path'] = str_replace($pathdata['subdir'], $subdir, $pathdata['path']);
|
||||||
$pathdata['url'] = str_replace($pathdata['subdir'], $subdir, $pathdata['url']);
|
$pathdata['url'] = str_replace($pathdata['subdir'], $subdir, $pathdata['url']);
|
||||||
$pathdata['subdir'] = str_replace($pathdata['subdir'], $subdir, $pathdata['subdir']);
|
$pathdata['subdir'] = str_replace($pathdata['subdir'], $subdir, $pathdata['subdir']);
|
||||||
return $pathdata;
|
return $pathdata;
|
||||||
|
}
|
||||||
endif;
|
|
||||||
|
|
||||||
return $pathdata;
|
return $pathdata;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
* @see woocommerce_untrash_post()
|
* @see woocommerce_untrash_post()
|
||||||
* @see woocommerce_preview_emails()
|
* @see woocommerce_preview_emails()
|
||||||
* @see woocommerce_prevent_admin_access()
|
* @see woocommerce_prevent_admin_access()
|
||||||
* @see woocomerce_check_download_folder_protection()
|
* @see woocommerce_check_download_folder_protection()
|
||||||
* @see woocommerce_ms_protect_download_rewite_rules()
|
* @see woocommerce_ms_protect_download_rewite_rules()
|
||||||
*/
|
*/
|
||||||
add_action('delete_post', 'woocommerce_delete_post');
|
add_action('delete_post', 'woocommerce_delete_post');
|
||||||
|
@ -28,16 +28,9 @@ add_action('wp_trash_post', 'woocommerce_trash_post');
|
||||||
add_action('untrash_post', 'woocommerce_untrash_post');
|
add_action('untrash_post', 'woocommerce_untrash_post');
|
||||||
add_action('admin_init', 'woocommerce_preview_emails');
|
add_action('admin_init', 'woocommerce_preview_emails');
|
||||||
add_action('admin_init', 'woocommerce_prevent_admin_access');
|
add_action('admin_init', 'woocommerce_prevent_admin_access');
|
||||||
add_action('woocommerce_settings_saved', 'woocomerce_check_download_folder_protection');
|
add_action('woocommerce_settings_saved', 'woocommerce_check_download_folder_protection');
|
||||||
add_filter('mod_rewrite_rules', 'woocommerce_ms_protect_download_rewite_rules');
|
add_filter('mod_rewrite_rules', 'woocommerce_ms_protect_download_rewite_rules');
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters
|
|
||||||
*
|
|
||||||
* @see woocommerce_allow_img_insertion()
|
|
||||||
*/
|
|
||||||
add_filter('get_media_item_args', 'woocommerce_allow_img_insertion');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File uploads
|
* File uploads
|
||||||
*
|
*
|
||||||
|
@ -74,4 +67,10 @@ add_action( "delete_term", 'woocommerce_delete_term', 5 );
|
||||||
*/
|
*/
|
||||||
add_action( 'admin_footer', 'woocommerce_bulk_admin_footer', 10 );
|
add_action( 'admin_footer', 'woocommerce_bulk_admin_footer', 10 );
|
||||||
add_action( 'load-edit.php', 'woocommerce_order_bulk_action' );
|
add_action( 'load-edit.php', 'woocommerce_order_bulk_action' );
|
||||||
add_action( 'admin_notices', 'woocommerce_order_bulk_admin_notices' );
|
add_action( 'admin_notices', 'woocommerce_order_bulk_admin_notices' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mijireh Gateway
|
||||||
|
*/
|
||||||
|
add_action( 'add_meta_boxes', array( 'WC_Gateway_Mijireh', 'add_page_slurp_meta' ) );
|
||||||
|
add_action( 'wp_ajax_page_slurp', array( 'WC_Gateway_Mijireh', 'page_slurp' ) );
|
|
@ -62,13 +62,13 @@ function woocommerce_import_start() {
|
||||||
|
|
||||||
// Register the taxonomy now so that the import works!
|
// Register the taxonomy now so that the import works!
|
||||||
register_taxonomy( $domain,
|
register_taxonomy( $domain,
|
||||||
array('product'),
|
apply_filters( 'woocommerce_taxonomy_objects_' . $domain, array('product') ),
|
||||||
array(
|
apply_filters( 'woocommerce_taxonomy_args_' . $domain, array(
|
||||||
'hierarchical' => true,
|
'hierarchical' => true,
|
||||||
'show_ui' => false,
|
'show_ui' => false,
|
||||||
'query_var' => true,
|
'query_var' => true,
|
||||||
'rewrite' => false,
|
'rewrite' => false,
|
||||||
)
|
) )
|
||||||
);
|
);
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
|
@ -42,6 +42,11 @@ include_once( 'woocommerce-admin-functions.php' );
|
||||||
*/
|
*/
|
||||||
include_once( 'woocommerce-admin-taxonomies.php' );
|
include_once( 'woocommerce-admin-taxonomies.php' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Welcome Page
|
||||||
|
*/
|
||||||
|
include_once( 'includes/welcome.php' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup the Admin menu in WordPress
|
* Setup the Admin menu in WordPress
|
||||||
*
|
*
|
||||||
|
@ -54,14 +59,14 @@ function woocommerce_admin_menu() {
|
||||||
if ( current_user_can( 'manage_woocommerce' ) )
|
if ( current_user_can( 'manage_woocommerce' ) )
|
||||||
$menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator woocommerce' );
|
$menu[] = array( '', 'read', 'separator-woocommerce', '', 'wp-menu-separator woocommerce' );
|
||||||
|
|
||||||
$main_page = add_menu_page(__( 'WooCommerce', 'woocommerce' ), __( 'WooCommerce', 'woocommerce' ), 'manage_woocommerce', 'woocommerce' , 'woocommerce_settings_page', null, '55.5' );
|
$main_page = add_menu_page( __( 'WooCommerce', 'woocommerce' ), __( 'WooCommerce', 'woocommerce' ), 'manage_woocommerce', 'woocommerce' , 'woocommerce_settings_page', null, '55.5' );
|
||||||
|
|
||||||
$reports_page = add_submenu_page('woocommerce', __( 'Reports', 'woocommerce' ), __( 'Reports', 'woocommerce' ) , 'view_woocommerce_reports', 'woocommerce_reports', 'woocommerce_reports_page');
|
$reports_page = add_submenu_page( 'woocommerce', __( 'Reports', 'woocommerce' ), __( 'Reports', 'woocommerce' ) , 'view_woocommerce_reports', 'woocommerce_reports', 'woocommerce_reports_page' );
|
||||||
|
|
||||||
add_submenu_page('edit.php?post_type=product', __( 'Attributes', 'woocommerce' ), __( 'Attributes', 'woocommerce' ), 'manage_product_terms', 'woocommerce_attributes', 'woocommerce_attributes_page');
|
add_submenu_page( 'edit.php?post_type=product', __( 'Attributes', 'woocommerce' ), __( 'Attributes', 'woocommerce' ), 'manage_product_terms', 'woocommerce_attributes', 'woocommerce_attributes_page');
|
||||||
|
|
||||||
add_action('load-' . $main_page, 'woocommerce_admin_help_tab');
|
add_action( 'load-' . $main_page, 'woocommerce_admin_help_tab' );
|
||||||
add_action('load-' . $reports_page, 'woocommerce_admin_help_tab');
|
add_action( 'load-' . $reports_page, 'woocommerce_admin_help_tab' );
|
||||||
|
|
||||||
$print_css_on = apply_filters( 'woocommerce_screen_ids', array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_settings', 'woocommerce_page_woocommerce_reports', 'woocommerce_page_woocommerce_status', 'product_page_woocommerce_attributes', 'edit-tags.php', 'edit.php', 'index.php', 'post-new.php', 'post.php' ) );
|
$print_css_on = apply_filters( 'woocommerce_screen_ids', array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_settings', 'woocommerce_page_woocommerce_reports', 'woocommerce_page_woocommerce_status', 'product_page_woocommerce_attributes', 'edit-tags.php', 'edit.php', 'index.php', 'post-new.php', 'post.php' ) );
|
||||||
|
|
||||||
|
@ -78,12 +83,24 @@ add_action('admin_menu', 'woocommerce_admin_menu', 9);
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocommerce_admin_menu_after() {
|
function woocommerce_admin_menu_after() {
|
||||||
add_submenu_page( 'woocommerce', __( 'WooCommerce Settings', 'woocommerce' ), __( 'Settings', 'woocommerce' ) , 'manage_woocommerce', 'woocommerce_settings', 'woocommerce_settings_page');
|
$settings_page = add_submenu_page( 'woocommerce', __( 'WooCommerce Settings', 'woocommerce' ), __( 'Settings', 'woocommerce' ) , 'manage_woocommerce', 'woocommerce_settings', 'woocommerce_settings_page');
|
||||||
add_submenu_page( 'woocommerce', __( 'WooCommerce Status', 'woocommerce' ), __( 'System Status', 'woocommerce' ) , 'manage_woocommerce', 'woocommerce_status', 'woocommerce_status_page');
|
$status_page = add_submenu_page( 'woocommerce', __( 'WooCommerce Status', 'woocommerce' ), __( 'System Status', 'woocommerce' ) , 'manage_woocommerce', 'woocommerce_status', 'woocommerce_status_page');
|
||||||
|
|
||||||
|
add_action( 'load-' . $settings_page, 'woocommerce_settings_page_init' );
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action('admin_menu', 'woocommerce_admin_menu_after', 50);
|
add_action('admin_menu', 'woocommerce_admin_menu_after', 50);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads gateways and shipping methods into memory for use within settings.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function woocommerce_settings_page_init() {
|
||||||
|
$GLOBALS['woocommerce']->payment_gateways();
|
||||||
|
$GLOBALS['woocommerce']->shipping();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Highlights the correct top level admin menu item for post type add screens.
|
* Highlights the correct top level admin menu item for post type add screens.
|
||||||
|
@ -147,16 +164,43 @@ add_action( 'admin_head', 'woocommerce_admin_menu_highlight' );
|
||||||
*/
|
*/
|
||||||
function woocommerce_admin_notices_styles() {
|
function woocommerce_admin_notices_styles() {
|
||||||
|
|
||||||
if ( get_option( 'woocommerce_updated' ) == 1 || get_option( 'woocommerce_needs_update' ) == 1 || get_option( 'woocommerce_installed' ) == 1 ) {
|
if ( get_option( '_wc_needs_update' ) == 1 || get_option( '_wc_needs_pages' ) == 1 ) {
|
||||||
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/activation.css', dirname( __FILE__ ) ) );
|
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/activation.css', dirname( __FILE__ ) ) );
|
||||||
add_action( 'admin_notices', 'woocommerce_admin_install_notices' );
|
add_action( 'admin_notices', 'woocommerce_admin_install_notices' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$template = get_option( 'template' );
|
||||||
|
|
||||||
|
if ( ! current_theme_supports( 'woocommerce' ) && ! in_array( $template, array( 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ) {
|
||||||
|
|
||||||
|
if ( ! empty( $_GET['hide_woocommerce_theme_support_check'] ) ) {
|
||||||
|
update_option( 'woocommerce_theme_support_check', $template );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( get_option( 'woocommerce_theme_support_check' ) !== $template ) {
|
||||||
|
wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/activation.css', dirname( __FILE__ ) ) );
|
||||||
|
add_action( 'admin_notices', 'woocommerce_theme_check_notice' );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'admin_print_styles', 'woocommerce_admin_notices_styles' );
|
add_action( 'admin_print_styles', 'woocommerce_admin_notices_styles' );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* woocommerce_theme_check_notice function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function woocommerce_theme_check_notice() {
|
||||||
|
include( 'includes/notice-theme-support.php' );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* woocommerce_admin_install_notices function.
|
* woocommerce_admin_install_notices function.
|
||||||
*
|
*
|
||||||
|
@ -166,31 +210,14 @@ add_action( 'admin_print_styles', 'woocommerce_admin_notices_styles' );
|
||||||
function woocommerce_admin_install_notices() {
|
function woocommerce_admin_install_notices() {
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
|
|
||||||
if ( get_option( 'woocommerce_needs_update' ) == 1 ) {
|
// If we need to update, include a message with the update button
|
||||||
|
if ( get_option( '_wc_needs_update' ) == 1 ) {
|
||||||
include( 'includes/notice-update.php' );
|
include( 'includes/notice-update.php' );
|
||||||
|
}
|
||||||
|
|
||||||
} elseif ( get_option( 'woocommerce_updated' ) == 1 ) {
|
// If we have just installed, show a message with the install pages button
|
||||||
|
elseif ( get_option( '_wc_needs_pages' ) == 1 ) {
|
||||||
include( 'includes/notice-updated.php' );
|
include( 'includes/notice-install.php' );
|
||||||
|
|
||||||
update_option( 'woocommerce_updated', 0 );
|
|
||||||
update_option( 'woocommerce_installed', 0 );
|
|
||||||
|
|
||||||
} elseif ( get_option( 'woocommerce_installed' ) == 1 ) {
|
|
||||||
|
|
||||||
if ( get_option( 'skip_install_woocommerce_pages' ) != 1 && woocommerce_get_page_id( 'shop' ) < 1 && ! isset( $_GET['install_woocommerce_pages'] ) && !isset( $_GET['skip_install_woocommerce_pages'] ) ) {
|
|
||||||
|
|
||||||
include( 'includes/notice-install.php' );
|
|
||||||
|
|
||||||
} elseif ( ! isset( $_GET['page'] ) || $_GET['page'] != 'woocommerce_settings' ) {
|
|
||||||
|
|
||||||
include( 'includes/notice-installed.php' );
|
|
||||||
|
|
||||||
update_option( 'woocommerce_installed', 0 );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +232,52 @@ function woocommerce_admin_init() {
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
if ( $typenow=='post' && isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) {
|
// Install - Add pages button
|
||||||
|
if ( ! empty( $_GET['install_woocommerce_pages'] ) ) {
|
||||||
|
|
||||||
|
require_once( 'woocommerce-admin-install.php' );
|
||||||
|
woocommerce_create_pages();
|
||||||
|
|
||||||
|
// We no longer need to install pages
|
||||||
|
delete_option( '_wc_needs_pages' );
|
||||||
|
delete_transient( '_wc_activation_redirect' );
|
||||||
|
|
||||||
|
// What's new redirect
|
||||||
|
wp_safe_redirect( admin_url( 'index.php?page=wc-about&wc-installed=true' ) );
|
||||||
|
exit;
|
||||||
|
|
||||||
|
// Skip button
|
||||||
|
} elseif ( ! empty( $_GET['skip_install_woocommerce_pages'] ) ) {
|
||||||
|
|
||||||
|
// We no longer need to install pages
|
||||||
|
delete_option( '_wc_needs_pages' );
|
||||||
|
delete_transient( '_wc_activation_redirect' );
|
||||||
|
|
||||||
|
// Flush rules after install
|
||||||
|
flush_rewrite_rules();
|
||||||
|
|
||||||
|
// What's new redirect
|
||||||
|
wp_safe_redirect( admin_url( 'index.php?page=wc-about' ) );
|
||||||
|
exit;
|
||||||
|
|
||||||
|
// Update button
|
||||||
|
} elseif ( ! empty( $_GET['do_update_woocommerce'] ) ) {
|
||||||
|
|
||||||
|
include_once( 'woocommerce-admin-update.php' );
|
||||||
|
do_update_woocommerce();
|
||||||
|
|
||||||
|
// Update complete
|
||||||
|
delete_option( '_wc_needs_pages' );
|
||||||
|
delete_option( '_wc_needs_update' );
|
||||||
|
delete_transient( '_wc_activation_redirect' );
|
||||||
|
|
||||||
|
// What's new redirect
|
||||||
|
wp_safe_redirect( admin_url( 'index.php?page=wc-about&wc-updated=true' ) );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Includes
|
||||||
|
if ( $typenow == 'post' && isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) {
|
||||||
$typenow = $post->post_type;
|
$typenow = $post->post_type;
|
||||||
} elseif ( empty( $typenow ) && ! empty( $_GET['post'] ) ) {
|
} elseif ( empty( $typenow ) && ! empty( $_GET['post'] ) ) {
|
||||||
$post = get_post( $_GET['post'] );
|
$post = get_post( $_GET['post'] );
|
||||||
|
@ -287,24 +359,6 @@ function woocommerce_status_page() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* update_woocommerce function.
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function update_woocommerce() {
|
|
||||||
if ( ! empty( $_GET['do_update_woocommerce'] ) ) {
|
|
||||||
include_once( 'woocommerce-admin-update.php' );
|
|
||||||
do_update_woocommerce();
|
|
||||||
update_option( 'woocommerce_updated', 1 );
|
|
||||||
update_option( 'woocommerce_needs_update', 0 );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
add_action( 'admin_init', 'update_woocommerce' );
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Include and add help tabs to WordPress admin.
|
* Include and add help tabs to WordPress admin.
|
||||||
*
|
*
|
||||||
|
@ -337,9 +391,7 @@ function woocommerce_admin_scripts() {
|
||||||
|
|
||||||
wp_register_script( 'jquery-tiptip', $woocommerce->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
|
wp_register_script( 'jquery-tiptip', $woocommerce->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
|
||||||
|
|
||||||
wp_register_script( 'jquery-ui-datepicker', $woocommerce->plugin_url() . '/assets/js/admin/ui-datepicker.js', array('jquery','jquery-ui-core'), $woocommerce->version );
|
wp_register_script( 'woocommerce_writepanel', $woocommerce->plugin_url() . '/assets/js/admin/write-panels'.$suffix.'.js', array('jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable'), $woocommerce->version );
|
||||||
|
|
||||||
wp_register_script( 'woocommerce_writepanel', $woocommerce->plugin_url() . '/assets/js/admin/write-panels'.$suffix.'.js', array('jquery', 'jquery-ui-datepicker'), $woocommerce->version );
|
|
||||||
|
|
||||||
wp_register_script( 'ajax-chosen', $woocommerce->plugin_url() . '/assets/js/chosen/ajax-chosen.jquery'.$suffix.'.js', array('jquery', 'chosen'), $woocommerce->version );
|
wp_register_script( 'ajax-chosen', $woocommerce->plugin_url() . '/assets/js/chosen/ajax-chosen.jquery'.$suffix.'.js', array('jquery', 'chosen'), $woocommerce->version );
|
||||||
|
|
||||||
|
@ -349,7 +401,7 @@ function woocommerce_admin_scripts() {
|
||||||
$screen = get_current_screen();
|
$screen = get_current_screen();
|
||||||
|
|
||||||
// WooCommerce admin pages
|
// WooCommerce admin pages
|
||||||
if (in_array( $screen->id, apply_filters( 'woocommerce_screen_ids', array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_settings', 'woocommerce_page_woocommerce_reports', 'edit-shop_order', 'edit-shop_coupon', 'shop_coupon', 'shop_order', 'edit-product', 'product' ) ) ) ) :
|
if ( in_array( $screen->id, apply_filters( 'woocommerce_screen_ids', array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_settings', 'woocommerce_page_woocommerce_reports', 'edit-shop_order', 'edit-shop_coupon', 'shop_coupon', 'shop_order', 'edit-product', 'product' ) ) ) ) {
|
||||||
|
|
||||||
wp_enqueue_script( 'woocommerce_admin' );
|
wp_enqueue_script( 'woocommerce_admin' );
|
||||||
wp_enqueue_script( 'farbtastic' );
|
wp_enqueue_script( 'farbtastic' );
|
||||||
|
@ -358,32 +410,27 @@ function woocommerce_admin_scripts() {
|
||||||
wp_enqueue_script( 'jquery-ui-sortable' );
|
wp_enqueue_script( 'jquery-ui-sortable' );
|
||||||
wp_enqueue_script( 'jquery-ui-autocomplete' );
|
wp_enqueue_script( 'jquery-ui-autocomplete' );
|
||||||
|
|
||||||
endif;
|
}
|
||||||
|
|
||||||
// Edit product category pages
|
// Edit product category pages
|
||||||
if (in_array( $screen->id, array('edit-product_cat') )) :
|
if ( in_array( $screen->id, array('edit-product_cat') ) )
|
||||||
|
wp_enqueue_media();
|
||||||
wp_enqueue_script( 'media-upload' );
|
|
||||||
wp_enqueue_script( 'thickbox' );
|
|
||||||
|
|
||||||
endif;
|
|
||||||
|
|
||||||
// Product/Coupon/Orders
|
// Product/Coupon/Orders
|
||||||
if (in_array( $screen->id, array( 'shop_coupon', 'shop_order', 'product' ))) :
|
if ( in_array( $screen->id, array( 'shop_coupon', 'shop_order', 'product' ) ) ) {
|
||||||
|
|
||||||
wp_enqueue_script( 'woocommerce_writepanel' );
|
wp_enqueue_script( 'woocommerce_writepanel' );
|
||||||
wp_enqueue_script( 'jquery-ui-datepicker' );
|
wp_enqueue_script( 'jquery-ui-datepicker' );
|
||||||
wp_enqueue_script( 'media-upload' );
|
wp_enqueue_media();
|
||||||
wp_enqueue_script( 'thickbox' );
|
|
||||||
wp_enqueue_script( 'ajax-chosen' );
|
wp_enqueue_script( 'ajax-chosen' );
|
||||||
wp_enqueue_script( 'chosen' );
|
wp_enqueue_script( 'chosen' );
|
||||||
wp_enqueue_script( 'plupload-all' );
|
wp_enqueue_script( 'plupload-all' );
|
||||||
|
|
||||||
$woocommerce_witepanel_params = array(
|
$woocommerce_witepanel_params = array(
|
||||||
'remove_item_notice' => __( 'Are you sure you want to remove the selected items? If you have previously reduced this item\'s stock, or this order was submitted by a customer, you will need to manually restore the item\'s stock.', 'woocommerce' ),
|
'remove_item_notice' => __( 'Are you sure you want to remove the selected items? If you have previously reduced this item\'s stock, or this order was submitted by a customer, you will need to manually restore the item\'s stock.', 'woocommerce' ),
|
||||||
|
'i18n_select_items' => __( 'Please select some items.', 'woocommerce' ),
|
||||||
'remove_item_meta' => __( 'Remove this item meta?', 'woocommerce' ),
|
'remove_item_meta' => __( 'Remove this item meta?', 'woocommerce' ),
|
||||||
'remove_attribute' => __( 'Remove this attribute?', 'woocommerce' ),
|
'remove_attribute' => __( 'Remove this attribute?', 'woocommerce' ),
|
||||||
'refund_item_notice' => __( 'Are you sure you want to refund the selected items? The item\'s stock will not be affected.', 'woocommerce' ),
|
|
||||||
'name_label' => __( 'Name', 'woocommerce' ),
|
'name_label' => __( 'Name', 'woocommerce' ),
|
||||||
'remove_label' => __( 'Remove', 'woocommerce' ),
|
'remove_label' => __( 'Remove', 'woocommerce' ),
|
||||||
'click_to_toggle' => __( 'Click to toggle', 'woocommerce' ),
|
'click_to_toggle' => __( 'Click to toggle', 'woocommerce' ),
|
||||||
|
@ -415,15 +462,17 @@ function woocommerce_admin_scripts() {
|
||||||
'currency_format_symbol' => get_woocommerce_currency_symbol(),
|
'currency_format_symbol' => get_woocommerce_currency_symbol(),
|
||||||
'currency_format_decimal_sep' => esc_attr( stripslashes( get_option( 'woocommerce_price_decimal_sep' ) ) ),
|
'currency_format_decimal_sep' => esc_attr( stripslashes( get_option( 'woocommerce_price_decimal_sep' ) ) ),
|
||||||
'currency_format_thousand_sep' => esc_attr( stripslashes( get_option( 'woocommerce_price_thousand_sep' ) ) ),
|
'currency_format_thousand_sep' => esc_attr( stripslashes( get_option( 'woocommerce_price_thousand_sep' ) ) ),
|
||||||
'currency_format' => esc_attr( str_replace( array( '%1$s', '%2$s' ), array( '%s', '%v' ), get_woocommerce_price_format() ) ) // For accounting JS
|
'currency_format' => esc_attr( str_replace( array( '%1$s', '%2$s' ), array( '%s', '%v' ), get_woocommerce_price_format() ) ), // For accounting JS
|
||||||
|
'product_types' => array_map( 'sanitize_title', get_terms( 'product_type', array( 'hide_empty' => false, 'fields' => 'names' ) ) ),
|
||||||
|
'default_attribute_visibility' => apply_filters( 'default_attribute_visibility', false ),
|
||||||
|
'default_attribute_variation' => apply_filters( 'default_attribute_variation', false )
|
||||||
);
|
);
|
||||||
|
|
||||||
wp_localize_script( 'woocommerce_writepanel', 'woocommerce_writepanel_params', $woocommerce_witepanel_params );
|
wp_localize_script( 'woocommerce_writepanel', 'woocommerce_writepanel_params', $woocommerce_witepanel_params );
|
||||||
|
}
|
||||||
endif;
|
|
||||||
|
|
||||||
// Term ordering - only when sorting by term_order
|
// Term ordering - only when sorting by term_order
|
||||||
if ( ( strstr( $screen->id, 'edit-pa_' ) || ( ! empty( $_GET['taxonomy'] ) && in_array( $_GET['taxonomy'], apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ) ) ) ) && ! isset( $_GET['orderby'] ) ) :
|
if ( ( strstr( $screen->id, 'edit-pa_' ) || ( ! empty( $_GET['taxonomy'] ) && in_array( $_GET['taxonomy'], apply_filters( 'woocommerce_sortable_taxonomies', array( 'product_cat' ) ) ) ) ) && ! isset( $_GET['orderby'] ) ) {
|
||||||
|
|
||||||
wp_register_script( 'woocommerce_term_ordering', $woocommerce->plugin_url() . '/assets/js/admin/term-ordering.js', array('jquery-ui-sortable'), $woocommerce->version );
|
wp_register_script( 'woocommerce_term_ordering', $woocommerce->plugin_url() . '/assets/js/admin/term-ordering.js', array('jquery-ui-sortable'), $woocommerce->version );
|
||||||
wp_enqueue_script( 'woocommerce_term_ordering' );
|
wp_enqueue_script( 'woocommerce_term_ordering' );
|
||||||
|
@ -436,7 +485,7 @@ function woocommerce_admin_scripts() {
|
||||||
|
|
||||||
wp_localize_script( 'woocommerce_term_ordering', 'woocommerce_term_ordering_params', $woocommerce_term_order_params );
|
wp_localize_script( 'woocommerce_term_ordering', 'woocommerce_term_ordering_params', $woocommerce_term_order_params );
|
||||||
|
|
||||||
endif;
|
}
|
||||||
|
|
||||||
// Product sorting - only when sorting by menu order on the products page
|
// Product sorting - only when sorting by menu order on the products page
|
||||||
if ( current_user_can('edit_others_pages') && $screen->id == 'edit-product' && isset( $wp_query->query['orderby'] ) && $wp_query->query['orderby'] == 'menu_order title' ) {
|
if ( current_user_can('edit_others_pages') && $screen->id == 'edit-product' && isset( $wp_query->query['orderby'] ) && $wp_query->query['orderby'] == 'menu_order title' ) {
|
||||||
|
@ -465,20 +514,22 @@ add_action( 'admin_enqueue_scripts', 'woocommerce_admin_scripts' );
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocommerce_admin_css() {
|
function woocommerce_admin_css() {
|
||||||
global $woocommerce, $typenow, $post;
|
global $woocommerce, $typenow, $post, $wp_scripts;
|
||||||
|
|
||||||
if ($typenow=='post' && isset($_GET['post']) && !empty($_GET['post'])) :
|
if ( $typenow == 'post' && ! empty( $_GET['post'] ) ) {
|
||||||
$typenow = $post->post_type;
|
$typenow = $post->post_type;
|
||||||
elseif (empty($typenow) && !empty($_GET['post'])) :
|
} elseif ( empty( $typenow ) && ! empty( $_GET['post'] ) ) {
|
||||||
$post = get_post($_GET['post']);
|
$post = get_post( $_GET['post'] );
|
||||||
$typenow = $post->post_type;
|
$typenow = $post->post_type;
|
||||||
endif;
|
}
|
||||||
|
|
||||||
if ( $typenow == '' || $typenow=="product" || $typenow=="shop_order" || $typenow=="shop_coupon" ) :
|
if ( $typenow == '' || $typenow == "product" || $typenow == "shop_order" || $typenow == "shop_coupon" ) {
|
||||||
wp_enqueue_style( 'thickbox' );
|
|
||||||
wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css' );
|
wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css' );
|
||||||
wp_enqueue_style( 'jquery-ui-style', (is_ssl()) ? 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' : 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
|
||||||
endif;
|
$jquery_version = isset( $wp_scripts->registered['jquery-ui-core']->ver ) ? $wp_scripts->registered['jquery-ui-core']->ver : '1.9.2';
|
||||||
|
|
||||||
|
wp_enqueue_style( 'jquery-ui-style', '//ajax.googleapis.com/ajax/libs/jqueryui/' . $jquery_version . '/themes/smoothness/jquery-ui.css' );
|
||||||
|
}
|
||||||
|
|
||||||
wp_enqueue_style('farbtastic');
|
wp_enqueue_style('farbtastic');
|
||||||
|
|
||||||
|
@ -581,79 +632,6 @@ function woocommerce_admin_head() {
|
||||||
add_action('admin_head', 'woocommerce_admin_head');
|
add_action('admin_head', 'woocommerce_admin_head');
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add functionality to the image uploader on product pages to exclude an image
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param mixed $fields
|
|
||||||
* @param mixed $object
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function woocommerce_exclude_image_from_product_page_field( $fields, $object ) {
|
|
||||||
|
|
||||||
if (!$object->post_parent) return $fields;
|
|
||||||
|
|
||||||
$parent = get_post( $object->post_parent );
|
|
||||||
|
|
||||||
if ( $parent->post_type !== 'product' )
|
|
||||||
return $fields;
|
|
||||||
|
|
||||||
$exclude_image = get_post_meta( absint( $object->ID ), '_woocommerce_exclude_image', true );
|
|
||||||
|
|
||||||
$label = __( 'Exclude image', 'woocommerce' );
|
|
||||||
|
|
||||||
$html = '<input type="checkbox" '.checked($exclude_image, 1, false).' name="attachments['.$object->ID.'][woocommerce_exclude_image]" id="attachments['.$object->ID.'][woocommerce_exclude_image" />';
|
|
||||||
|
|
||||||
$fields['woocommerce_exclude_image'] = array(
|
|
||||||
'label' => $label,
|
|
||||||
'input' => 'html',
|
|
||||||
'html' => $html,
|
|
||||||
'value' => '',
|
|
||||||
'helps' => __( 'Enabling this option will hide it from the product page image gallery.', 'woocommerce' )
|
|
||||||
);
|
|
||||||
|
|
||||||
return $fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
add_filter('attachment_fields_to_edit', 'woocommerce_exclude_image_from_product_page_field', 1, 2);
|
|
||||||
add_filter('attachment_fields_to_save', 'woocommerce_exclude_image_from_product_page_field_save', 1, 2);
|
|
||||||
add_action('add_attachment', 'woocommerce_exclude_image_from_product_page_field_add');
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save the meta for exlcuding images from galleries.
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param mixed $post
|
|
||||||
* @param mixed $attachment
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function woocommerce_exclude_image_from_product_page_field_save( $post, $attachment ) {
|
|
||||||
|
|
||||||
if (isset($_REQUEST['attachments'][$post['ID']]['woocommerce_exclude_image'])) :
|
|
||||||
delete_post_meta( (int) $post['ID'], '_woocommerce_exclude_image' );
|
|
||||||
update_post_meta( (int) $post['ID'], '_woocommerce_exclude_image', 1);
|
|
||||||
else :
|
|
||||||
delete_post_meta( (int) $post['ID'], '_woocommerce_exclude_image' );
|
|
||||||
update_post_meta( (int) $post['ID'], '_woocommerce_exclude_image', 0);
|
|
||||||
endif;
|
|
||||||
|
|
||||||
return $post;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add the meta for exlcuding images from galleries.
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param mixed $post_id
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function woocommerce_exclude_image_from_product_page_field_add( $post_id ) {
|
|
||||||
add_post_meta( $post_id, '_woocommerce_exclude_image', 0, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Duplicate a product action
|
* Duplicate a product action
|
||||||
*
|
*
|
||||||
|
|
|
@ -34,7 +34,22 @@ function do_install_woocommerce() {
|
||||||
|
|
||||||
// Cron jobs
|
// Cron jobs
|
||||||
wp_clear_scheduled_hook( 'woocommerce_scheduled_sales' );
|
wp_clear_scheduled_hook( 'woocommerce_scheduled_sales' );
|
||||||
wp_schedule_event( strtotime( 'tomorrow' ), 'daily', 'woocommerce_scheduled_sales');
|
wp_clear_scheduled_hook( 'woocommerce_cancel_unpaid_orders' );
|
||||||
|
wp_clear_scheduled_hook( 'woocommerce_cleanup_sessions' );
|
||||||
|
|
||||||
|
$ve = get_option('gmt_offset') > 0 ? '+' : '-';
|
||||||
|
|
||||||
|
wp_schedule_event( strtotime( 'tomorrow ' . $ve . get_option('gmt_offset') . ' HOURS' ), 'daily', 'woocommerce_scheduled_sales');
|
||||||
|
|
||||||
|
$held_duration = get_option( 'woocommerce_hold_stock_minutes', null );
|
||||||
|
|
||||||
|
if ( is_null( $held_duration ) )
|
||||||
|
$held_duration = '60';
|
||||||
|
|
||||||
|
if ( $held_duration != '' )
|
||||||
|
wp_schedule_single_event( time() + ( absint( $held_duration ) * 60 ), 'woocommerce_cancel_unpaid_orders' );
|
||||||
|
|
||||||
|
wp_schedule_event( time(), 'twicedaily', 'woocommerce_cleanup_sessions' );
|
||||||
|
|
||||||
// Install files and folders for uploading files and prevent hotlinking
|
// Install files and folders for uploading files and prevent hotlinking
|
||||||
$upload_dir = wp_upload_dir();
|
$upload_dir = wp_upload_dir();
|
||||||
|
@ -88,14 +103,17 @@ function do_install_woocommerce() {
|
||||||
$current_version = get_option( 'woocommerce_version', null );
|
$current_version = get_option( 'woocommerce_version', null );
|
||||||
$current_db_version = get_option( 'woocommerce_db_version', null );
|
$current_db_version = get_option( 'woocommerce_db_version', null );
|
||||||
|
|
||||||
if ( version_compare( $current_db_version, '2.0', '<' ) && null !== $current_version ) {
|
if ( version_compare( $current_db_version, '2.0', '<' ) && null !== $current_db_version ) {
|
||||||
update_option( 'woocommerce_needs_update', 1 );
|
update_option( '_wc_needs_update', 1 );
|
||||||
} else {
|
} else {
|
||||||
update_option( 'woocommerce_db_version', $woocommerce->version );
|
update_option( 'woocommerce_db_version', $woocommerce->version );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update version
|
// Update version
|
||||||
update_option( 'woocommerce_version', $woocommerce->version );
|
update_option( 'woocommerce_version', $woocommerce->version );
|
||||||
|
|
||||||
|
// Flush rewrite rules
|
||||||
|
flush_rewrite_rules();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -182,9 +200,6 @@ function woocommerce_create_pages() {
|
||||||
// Checkout page
|
// Checkout page
|
||||||
woocommerce_create_page( esc_sql( _x( 'checkout', 'page_slug', 'woocommerce' ) ), 'woocommerce_checkout_page_id', __( 'Checkout', 'woocommerce' ), '[woocommerce_checkout]' );
|
woocommerce_create_page( esc_sql( _x( 'checkout', 'page_slug', 'woocommerce' ) ), 'woocommerce_checkout_page_id', __( 'Checkout', 'woocommerce' ), '[woocommerce_checkout]' );
|
||||||
|
|
||||||
// Order tracking page
|
|
||||||
woocommerce_create_page( esc_sql( _x( 'order-tracking', 'page_slug', 'woocommerce' ) ), 'woocommerce_order_tracking_page_id', __( 'Track your order', 'woocommerce' ), '[woocommerce_order_tracking]' );
|
|
||||||
|
|
||||||
// My Account page
|
// My Account page
|
||||||
woocommerce_create_page( esc_sql( _x( 'my-account', 'page_slug', 'woocommerce' ) ), 'woocommerce_myaccount_page_id', __( 'My Account', 'woocommerce' ), '[woocommerce_my_account]' );
|
woocommerce_create_page( esc_sql( _x( 'my-account', 'page_slug', 'woocommerce' ) ), 'woocommerce_myaccount_page_id', __( 'My Account', 'woocommerce' ), '[woocommerce_my_account]' );
|
||||||
|
|
||||||
|
@ -200,6 +215,9 @@ function woocommerce_create_pages() {
|
||||||
// Change password page
|
// Change password page
|
||||||
woocommerce_create_page( esc_sql( _x( 'change-password', 'page_slug', 'woocommerce' ) ), 'woocommerce_change_password_page_id', __( 'Change Password', 'woocommerce' ), '[woocommerce_change_password]', woocommerce_get_page_id( 'myaccount' ) );
|
woocommerce_create_page( esc_sql( _x( 'change-password', 'page_slug', 'woocommerce' ) ), 'woocommerce_change_password_page_id', __( 'Change Password', 'woocommerce' ), '[woocommerce_change_password]', woocommerce_get_page_id( 'myaccount' ) );
|
||||||
|
|
||||||
|
// Logout page
|
||||||
|
woocommerce_create_page( esc_sql( _x( 'logout', 'page_slug', 'woocommerce' ) ), 'woocommerce_logout_page_id', __( 'Logout', 'woocommerce' ), '', woocommerce_get_page_id( 'myaccount' ) );
|
||||||
|
|
||||||
// Pay page
|
// Pay page
|
||||||
woocommerce_create_page( esc_sql( _x( 'pay', 'page_slug', 'woocommerce' ) ), 'woocommerce_pay_page_id', __( 'Checkout → Pay', 'woocommerce' ), '[woocommerce_pay]', woocommerce_get_page_id( 'checkout' ) );
|
woocommerce_create_page( esc_sql( _x( 'pay', 'page_slug', 'woocommerce' ) ), 'woocommerce_pay_page_id', __( 'Checkout → Pay', 'woocommerce' ), '[woocommerce_pay]', woocommerce_get_page_id( 'checkout' ) );
|
||||||
|
|
||||||
|
@ -211,6 +229,16 @@ function woocommerce_create_pages() {
|
||||||
/**
|
/**
|
||||||
* Set up the database tables which the plugin needs to function.
|
* Set up the database tables which the plugin needs to function.
|
||||||
*
|
*
|
||||||
|
* Tables:
|
||||||
|
* woocommerce_attribute_taxonomies - Table for storing attribute taxonomies - these are user defined
|
||||||
|
* woocommerce_termmeta - Term meta table - sadly WordPress does not have termmeta so we need our own
|
||||||
|
* woocommerce_downloadable_product_permissions - Table for storing user and guest download permissions.
|
||||||
|
* KEY(order_id, product_id, download_id) used for organizing downloads on the My Account page
|
||||||
|
* woocommerce_order_items - Order line items are stored in a table to make them easily queryable for reports
|
||||||
|
* woocommerce_order_itemmeta - Order line item meta is stored in a table for storing extra data.
|
||||||
|
* woocommerce_tax_rates - Tax Rates are stored inside 2 tables making tax queries simple and efficient.
|
||||||
|
* woocommerce_tax_rate_locations - Each rate can be applied to more than one postcode/city hence the second table.
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -220,6 +248,7 @@ function woocommerce_tables_install() {
|
||||||
$wpdb->hide_errors();
|
$wpdb->hide_errors();
|
||||||
|
|
||||||
$collate = '';
|
$collate = '';
|
||||||
|
|
||||||
if ( $wpdb->has_cap( 'collation' ) ) {
|
if ( $wpdb->has_cap( 'collation' ) ) {
|
||||||
if( ! empty($wpdb->charset ) )
|
if( ! empty($wpdb->charset ) )
|
||||||
$collate .= "DEFAULT CHARACTER SET $wpdb->charset";
|
$collate .= "DEFAULT CHARACTER SET $wpdb->charset";
|
||||||
|
@ -229,35 +258,27 @@ function woocommerce_tables_install() {
|
||||||
|
|
||||||
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
||||||
|
|
||||||
// Table for storing attribute taxonomies - these are user defined
|
// WooCommerce Tables
|
||||||
$sql = "
|
$woocommerce_tables = "
|
||||||
CREATE TABLE ". $wpdb->prefix . "woocommerce_attribute_taxonomies (
|
CREATE TABLE {$wpdb->prefix}woocommerce_attribute_taxonomies (
|
||||||
attribute_id bigint(20) NOT NULL auto_increment,
|
attribute_id bigint(20) NOT NULL auto_increment,
|
||||||
attribute_name varchar(200) NOT NULL,
|
attribute_name varchar(200) NOT NULL,
|
||||||
attribute_label longtext NULL,
|
attribute_label longtext NULL,
|
||||||
attribute_type varchar(200) NOT NULL,
|
attribute_type varchar(200) NOT NULL,
|
||||||
attribute_orderby varchar(200) NOT NULL,
|
attribute_orderby varchar(200) NOT NULL,
|
||||||
PRIMARY KEY (attribute_id)
|
PRIMARY KEY (attribute_id),
|
||||||
|
KEY attribute_name (attribute_name)
|
||||||
) $collate;
|
) $collate;
|
||||||
";
|
CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
|
||||||
dbDelta( $sql );
|
|
||||||
|
|
||||||
// Term meta table - sadly WordPress does not have termmeta so we need our own
|
|
||||||
$sql = "
|
|
||||||
CREATE TABLE ". $wpdb->prefix . "woocommerce_termmeta (
|
|
||||||
meta_id bigint(20) NOT NULL AUTO_INCREMENT,
|
meta_id bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
woocommerce_term_id bigint(20) NOT NULL,
|
woocommerce_term_id bigint(20) NOT NULL,
|
||||||
meta_key varchar(255) NULL,
|
meta_key varchar(255) NULL,
|
||||||
meta_value longtext NULL,
|
meta_value longtext NULL,
|
||||||
PRIMARY KEY (meta_id)
|
PRIMARY KEY (meta_id),
|
||||||
|
KEY woocommerce_term_id (woocommerce_term_id),
|
||||||
|
KEY meta_key (meta_key)
|
||||||
) $collate;
|
) $collate;
|
||||||
";
|
CREATE TABLE {$wpdb->prefix}woocommerce_downloadable_product_permissions (
|
||||||
dbDelta( $sql );
|
|
||||||
|
|
||||||
// Table for storing user and guest download permissions
|
|
||||||
// KEY(order_id, product_id, download_id) used for organizing downloads on the My Account page
|
|
||||||
$sql = "
|
|
||||||
CREATE TABLE ". $wpdb->prefix . "woocommerce_downloadable_product_permissions (
|
|
||||||
download_id varchar(32) NOT NULL,
|
download_id varchar(32) NOT NULL,
|
||||||
product_id bigint(20) NOT NULL,
|
product_id bigint(20) NOT NULL,
|
||||||
order_id bigint(20) NOT NULL DEFAULT 0,
|
order_id bigint(20) NOT NULL DEFAULT 0,
|
||||||
|
@ -269,38 +290,26 @@ CREATE TABLE ". $wpdb->prefix . "woocommerce_downloadable_product_permissions (
|
||||||
access_expires datetime NULL default null,
|
access_expires datetime NULL default null,
|
||||||
download_count bigint(20) NOT NULL DEFAULT 0,
|
download_count bigint(20) NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (product_id,order_id,order_key,download_id),
|
PRIMARY KEY (product_id,order_id,order_key,download_id),
|
||||||
KEY (order_id,product_id,download_id)
|
KEY download_order_product (download_id,order_id,product_id)
|
||||||
) $collate;
|
) $collate;
|
||||||
";
|
CREATE TABLE {$wpdb->prefix}woocommerce_order_items (
|
||||||
dbDelta( $sql );
|
|
||||||
|
|
||||||
// Order line items are stored in a table to make them easily queryable for reports
|
|
||||||
$sql = "
|
|
||||||
CREATE TABLE ". $wpdb->prefix . "woocommerce_order_items (
|
|
||||||
order_item_id bigint(20) NOT NULL auto_increment,
|
order_item_id bigint(20) NOT NULL auto_increment,
|
||||||
order_item_name longtext NOT NULL DEFAULT '',
|
order_item_name longtext NOT NULL,
|
||||||
order_item_type varchar(200) NOT NULL DEFAULT '',
|
order_item_type varchar(200) NOT NULL DEFAULT '',
|
||||||
order_id bigint(20) NOT NULL,
|
order_id bigint(20) NOT NULL,
|
||||||
PRIMARY KEY (order_item_id)
|
PRIMARY KEY (order_item_id),
|
||||||
|
KEY order_id (order_id)
|
||||||
) $collate;
|
) $collate;
|
||||||
";
|
CREATE TABLE {$wpdb->prefix}woocommerce_order_itemmeta (
|
||||||
dbDelta( $sql );
|
|
||||||
|
|
||||||
// Order line item meta is stored in a table for storing extra data.
|
|
||||||
$sql = "
|
|
||||||
CREATE TABLE ". $wpdb->prefix . "woocommerce_order_itemmeta (
|
|
||||||
meta_id bigint(20) NOT NULL auto_increment,
|
meta_id bigint(20) NOT NULL auto_increment,
|
||||||
order_item_id bigint(20) NOT NULL,
|
order_item_id bigint(20) NOT NULL,
|
||||||
meta_key varchar(255) NULL,
|
meta_key varchar(255) NULL,
|
||||||
meta_value longtext NULL,
|
meta_value longtext NULL,
|
||||||
PRIMARY KEY (meta_id)
|
PRIMARY KEY (meta_id),
|
||||||
|
KEY order_item_id (order_item_id),
|
||||||
|
KEY meta_key (meta_key)
|
||||||
) $collate;
|
) $collate;
|
||||||
";
|
CREATE TABLE {$wpdb->prefix}woocommerce_tax_rates (
|
||||||
dbDelta( $sql );
|
|
||||||
|
|
||||||
// Tax Rates are stored inside 2 tables making tax queries simple and efficient.
|
|
||||||
$sql = "
|
|
||||||
CREATE TABLE ". $wpdb->prefix . "woocommerce_tax_rates (
|
|
||||||
tax_rate_id bigint(20) NOT NULL auto_increment,
|
tax_rate_id bigint(20) NOT NULL auto_increment,
|
||||||
tax_rate_country varchar(200) NOT NULL DEFAULT '',
|
tax_rate_country varchar(200) NOT NULL DEFAULT '',
|
||||||
tax_rate_state varchar(200) NOT NULL DEFAULT '',
|
tax_rate_state varchar(200) NOT NULL DEFAULT '',
|
||||||
|
@ -311,22 +320,23 @@ CREATE TABLE ". $wpdb->prefix . "woocommerce_tax_rates (
|
||||||
tax_rate_shipping int(1) NOT NULL DEFAULT 1,
|
tax_rate_shipping int(1) NOT NULL DEFAULT 1,
|
||||||
tax_rate_order bigint(20) NOT NULL,
|
tax_rate_order bigint(20) NOT NULL,
|
||||||
tax_rate_class varchar(200) NOT NULL DEFAULT '',
|
tax_rate_class varchar(200) NOT NULL DEFAULT '',
|
||||||
PRIMARY KEY (tax_rate_id)
|
PRIMARY KEY (tax_rate_id),
|
||||||
|
KEY tax_rate_country (tax_rate_country),
|
||||||
|
KEY tax_rate_state (tax_rate_state),
|
||||||
|
KEY tax_rate_class (tax_rate_class),
|
||||||
|
KEY tax_rate_priority (tax_rate_priority)
|
||||||
) $collate;
|
) $collate;
|
||||||
";
|
CREATE TABLE {$wpdb->prefix}woocommerce_tax_rate_locations (
|
||||||
dbDelta( $sql );
|
|
||||||
|
|
||||||
// Each rate can be applied to more than one postcode/city hence the second table.
|
|
||||||
$sql = "
|
|
||||||
CREATE TABLE ". $wpdb->prefix . "woocommerce_tax_rate_locations (
|
|
||||||
location_id bigint(20) NOT NULL auto_increment,
|
location_id bigint(20) NOT NULL auto_increment,
|
||||||
location_code varchar(255) NOT NULL,
|
location_code varchar(255) NOT NULL,
|
||||||
tax_rate_id bigint(20) NOT NULL,
|
tax_rate_id bigint(20) NOT NULL,
|
||||||
location_type varchar(40) NOT NULL,
|
location_type varchar(40) NOT NULL,
|
||||||
PRIMARY KEY (location_id)
|
PRIMARY KEY (location_id),
|
||||||
|
KEY location_type (location_type),
|
||||||
|
KEY location_type_code (location_type,location_code)
|
||||||
) $collate;
|
) $collate;
|
||||||
";
|
";
|
||||||
dbDelta( $sql );
|
dbDelta( $woocommerce_tables );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,7 @@ function woocommerce_sales_overview() {
|
||||||
<div class="postbox">
|
<div class="postbox">
|
||||||
<h3><span><?php _e( 'Total sales', 'woocommerce' ); ?></span></h3>
|
<h3><span><?php _e( 'Total sales', 'woocommerce' ); ?></span></h3>
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<p class="stat"><?php if ($total_sales>0) echo woocommerce_price($total_sales); else _e( 'n/a', 'woocommerce' ); ?></p>
|
<p class="stat"><?php if ( $total_sales > 0 ) echo woocommerce_price($total_sales); else _e( 'n/a', 'woocommerce' ); ?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="postbox">
|
<div class="postbox">
|
||||||
|
@ -407,6 +407,7 @@ function woocommerce_sales_overview() {
|
||||||
<h3><span><?php _e( 'This month\'s sales', 'woocommerce' ); ?></span></h3>
|
<h3><span><?php _e( 'This month\'s sales', 'woocommerce' ); ?></span></h3>
|
||||||
<div class="inside chart">
|
<div class="inside chart">
|
||||||
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
||||||
|
<div id="cart_legend"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -494,6 +495,10 @@ function woocommerce_sales_overview() {
|
||||||
var placeholder = jQuery("#placeholder");
|
var placeholder = jQuery("#placeholder");
|
||||||
|
|
||||||
var plot = jQuery.plot(placeholder, [ { label: "<?php echo esc_js( __( 'Number of sales', 'woocommerce' ) ) ?>", data: d }, { label: "<?php echo esc_js( __( 'Sales amount', 'woocommerce' ) ) ?>", data: d2, yaxis: 2 } ], {
|
var plot = jQuery.plot(placeholder, [ { label: "<?php echo esc_js( __( 'Number of sales', 'woocommerce' ) ) ?>", data: d }, { label: "<?php echo esc_js( __( 'Sales amount', 'woocommerce' ) ) ?>", data: d2, yaxis: 2 } ], {
|
||||||
|
legend: {
|
||||||
|
container: jQuery('#cart_legend'),
|
||||||
|
noColumns: 2
|
||||||
|
},
|
||||||
series: {
|
series: {
|
||||||
lines: { show: true, fill: true },
|
lines: { show: true, fill: true },
|
||||||
points: { show: true }
|
points: { show: true }
|
||||||
|
@ -663,6 +668,7 @@ function woocommerce_daily_sales() {
|
||||||
<h3><span><?php _e( 'Sales in range', 'woocommerce' ); ?></span></h3>
|
<h3><span><?php _e( 'Sales in range', 'woocommerce' ); ?></span></h3>
|
||||||
<div class="inside chart">
|
<div class="inside chart">
|
||||||
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
||||||
|
<div id="cart_legend"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -694,6 +700,10 @@ function woocommerce_daily_sales() {
|
||||||
var placeholder = jQuery("#placeholder");
|
var placeholder = jQuery("#placeholder");
|
||||||
|
|
||||||
var plot = jQuery.plot(placeholder, [ { label: "<?php echo esc_js( __( 'Number of sales', 'woocommerce' ) ) ?>", data: d }, { label: "<?php echo esc_js( __( 'Sales amount', 'woocommerce' ) ) ?>", data: d2, yaxis: 2 } ], {
|
var plot = jQuery.plot(placeholder, [ { label: "<?php echo esc_js( __( 'Number of sales', 'woocommerce' ) ) ?>", data: d }, { label: "<?php echo esc_js( __( 'Sales amount', 'woocommerce' ) ) ?>", data: d2, yaxis: 2 } ], {
|
||||||
|
legend: {
|
||||||
|
container: jQuery('#cart_legend'),
|
||||||
|
noColumns: 2
|
||||||
|
},
|
||||||
series: {
|
series: {
|
||||||
lines: { show: true, fill: true },
|
lines: { show: true, fill: true },
|
||||||
points: { show: true }
|
points: { show: true }
|
||||||
|
@ -842,6 +852,7 @@ function woocommerce_monthly_sales() {
|
||||||
<h3><span><?php _e( 'Monthly sales for year', 'woocommerce' ); ?></span></h3>
|
<h3><span><?php _e( 'Monthly sales for year', 'woocommerce' ); ?></span></h3>
|
||||||
<div class="inside chart">
|
<div class="inside chart">
|
||||||
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
||||||
|
<div id="cart_legend"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -870,6 +881,10 @@ function woocommerce_monthly_sales() {
|
||||||
var placeholder = jQuery("#placeholder");
|
var placeholder = jQuery("#placeholder");
|
||||||
|
|
||||||
var plot = jQuery.plot(placeholder, [ { label: "<?php echo esc_js( __( 'Number of sales', 'woocommerce' ) ) ?>", data: d }, { label: "<?php echo esc_js( __( 'Sales amount', 'woocommerce' ) ) ?>", data: d2, yaxis: 2 } ], {
|
var plot = jQuery.plot(placeholder, [ { label: "<?php echo esc_js( __( 'Number of sales', 'woocommerce' ) ) ?>", data: d }, { label: "<?php echo esc_js( __( 'Sales amount', 'woocommerce' ) ) ?>", data: d2, yaxis: 2 } ], {
|
||||||
|
legend: {
|
||||||
|
container: jQuery('#cart_legend'),
|
||||||
|
noColumns: 2
|
||||||
|
},
|
||||||
series: {
|
series: {
|
||||||
lines: { show: true, fill: true },
|
lines: { show: true, fill: true },
|
||||||
points: { show: true, align: "left" }
|
points: { show: true, align: "left" }
|
||||||
|
@ -980,10 +995,10 @@ function woocommerce_top_sellers() {
|
||||||
|
|
||||||
if ( $product_title ) {
|
if ( $product_title ) {
|
||||||
$product_name = '<a href="' . get_permalink( $product_id ) . '">'. __( $product_title ) .'</a>';
|
$product_name = '<a href="' . get_permalink( $product_id ) . '">'. __( $product_title ) .'</a>';
|
||||||
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=' . urlencode( $product_title ) . '&shop_order_status=completed,processing,on-hold' );
|
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=' . urlencode( $product_title ) . '&shop_order_status=' . implode( ",", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) );
|
||||||
} else {
|
} else {
|
||||||
$product_name = __( 'Product does not exist', 'woocommerce' );
|
$product_name = __( 'Product does not exist', 'woocommerce' );
|
||||||
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=&shop_order_status=completed,processing,on-hold' );
|
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=&shop_order_status=' . implode( ",", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<tr><th>' . $product_name . '</th><td width="1%"><span>' . esc_html( $sales ) . '</span></td><td class="bars"><a href="' . esc_url( $orders_link ) . '" style="width:' . esc_attr( $width ) . '%"> </a></td></tr>';
|
echo '<tr><th>' . $product_name . '</th><td width="1%"><span>' . esc_html( $sales ) . '</span></td><td class="bars"><a href="' . esc_url( $orders_link ) . '" style="width:' . esc_attr( $width ) . '%"> </a></td></tr>';
|
||||||
|
@ -1077,10 +1092,10 @@ function woocommerce_top_earners() {
|
||||||
|
|
||||||
if ( $product_title ) {
|
if ( $product_title ) {
|
||||||
$product_name = '<a href="'.get_permalink( $product_id ).'">'. __( $product_title ) .'</a>';
|
$product_name = '<a href="'.get_permalink( $product_id ).'">'. __( $product_title ) .'</a>';
|
||||||
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=' . urlencode( $product_title ) . '&shop_order_status=completed,processing,on-hold' );
|
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=' . urlencode( $product_title ) . '&shop_order_status=' . implode( ",", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) );
|
||||||
} else {
|
} else {
|
||||||
$product_name = __( 'Product no longer exists', 'woocommerce' );
|
$product_name = __( 'Product no longer exists', 'woocommerce' );
|
||||||
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=&shop_order_status=completed,processing,on-hold' );
|
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=&shop_order_status=' . implode( ",", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<tr><th>' . $product_name . '</th><td width="1%"><span>' . woocommerce_price( $sales ) . '</span></td><td class="bars"><a href="' . esc_url( $orders_link ) . '" style="width:' . esc_attr( $width ) . '%"> </a></td></tr>';
|
echo '<tr><th>' . $product_name . '</th><td width="1%"><span>' . woocommerce_price( $sales ) . '</span></td><td class="bars"><a href="' . esc_url( $orders_link ) . '" style="width:' . esc_attr( $width ) . '%"> </a></td></tr>';
|
||||||
|
@ -1191,7 +1206,7 @@ function woocommerce_product_sales() {
|
||||||
$width = ($sales>0) ? (round($sales) / round($max_sales)) * 100 : 0;
|
$width = ($sales>0) ? (round($sales) / round($max_sales)) * 100 : 0;
|
||||||
$width2 = ($product_totals[$date]>0) ? (round($product_totals[$date]) / round($max_totals)) * 100 : 0;
|
$width2 = ($product_totals[$date]>0) ? (round($product_totals[$date]) / round($max_totals)) * 100 : 0;
|
||||||
|
|
||||||
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=' . urlencode( implode( ' ', $chosen_product_titles ) ) . '&m=' . date( 'Ym', strtotime( $date . '01' ) ) . '&shop_order_status=completed,processing,on-hold' );
|
$orders_link = admin_url( 'edit.php?s&post_status=all&post_type=shop_order&action=-1&s=' . urlencode( implode( ' ', $chosen_product_titles ) ) . '&m=' . date( 'Ym', strtotime( $date . '01' ) ) . '&shop_order_status=' . implode( ",", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) );
|
||||||
|
|
||||||
echo '<tr><th><a href="' . esc_url( $orders_link ) . '">' . date_i18n( 'F', strtotime( $date . '01' ) ) . '</a></th>
|
echo '<tr><th><a href="' . esc_url( $orders_link ) . '">' . date_i18n( 'F', strtotime( $date . '01' ) ) . '</a></th>
|
||||||
<td width="1%"><span>' . esc_html( $sales ) . '</span><span class="alt">' . woocommerce_price( $product_totals[ $date ] ) . '</span></td>
|
<td width="1%"><span>' . esc_html( $sales ) . '</span><span class="alt">' . woocommerce_price( $product_totals[ $date ] ) . '</span></td>
|
||||||
|
@ -1643,6 +1658,7 @@ function woocommerce_coupon_discounts() {
|
||||||
<h3><span><?php _e( 'Monthly discounts by coupon', 'woocommerce' ); ?></span></h3>
|
<h3><span><?php _e( 'Monthly discounts by coupon', 'woocommerce' ); ?></span></h3>
|
||||||
<div class="inside chart">
|
<div class="inside chart">
|
||||||
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
||||||
|
<div id="cart_legend"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1671,6 +1687,10 @@ function woocommerce_coupon_discounts() {
|
||||||
echo implode( ',', $labels );
|
echo implode( ',', $labels );
|
||||||
?>
|
?>
|
||||||
], {
|
], {
|
||||||
|
legend: {
|
||||||
|
container: jQuery('#cart_legend'),
|
||||||
|
noColumns: 2
|
||||||
|
},
|
||||||
series: {
|
series: {
|
||||||
lines: { show: true, fill: true },
|
lines: { show: true, fill: true },
|
||||||
points: { show: true, align: "left" }
|
points: { show: true, align: "left" }
|
||||||
|
@ -1826,6 +1846,7 @@ function woocommerce_customer_overview() {
|
||||||
<h3><span><?php _e( 'Signups per day', 'woocommerce' ); ?></span></h3>
|
<h3><span><?php _e( 'Signups per day', 'woocommerce' ); ?></span></h3>
|
||||||
<div class="inside chart">
|
<div class="inside chart">
|
||||||
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
||||||
|
<div id="cart_legend"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1877,6 +1898,10 @@ function woocommerce_customer_overview() {
|
||||||
var placeholder = jQuery("#placeholder");
|
var placeholder = jQuery("#placeholder");
|
||||||
|
|
||||||
var plot = jQuery.plot(placeholder, [ { data: d } ], {
|
var plot = jQuery.plot(placeholder, [ { data: d } ], {
|
||||||
|
legend: {
|
||||||
|
container: jQuery('#cart_legend'),
|
||||||
|
noColumns: 2
|
||||||
|
},
|
||||||
series: {
|
series: {
|
||||||
bars: {
|
bars: {
|
||||||
barWidth: 60 * 60 * 24 * 1000,
|
barWidth: 60 * 60 * 24 * 1000,
|
||||||
|
@ -1932,9 +1957,6 @@ function woocommerce_stock_overview() {
|
||||||
$nostockamount = get_option('woocommerce_notify_no_stock_amount');
|
$nostockamount = get_option('woocommerce_notify_no_stock_amount');
|
||||||
if (!is_numeric($nostockamount)) $nostockamount = 0;
|
if (!is_numeric($nostockamount)) $nostockamount = 0;
|
||||||
|
|
||||||
$outofstock = array();
|
|
||||||
$lowinstock = array();
|
|
||||||
|
|
||||||
// Get low in stock simple/downloadable/virtual products. Grouped don't have stock. Variations need a separate query.
|
// Get low in stock simple/downloadable/virtual products. Grouped don't have stock. Variations need a separate query.
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => 'product',
|
'post_type' => 'product',
|
||||||
|
@ -1955,12 +1977,14 @@ function woocommerce_stock_overview() {
|
||||||
'tax_query' => array(
|
'tax_query' => array(
|
||||||
array(
|
array(
|
||||||
'taxonomy' => 'product_type',
|
'taxonomy' => 'product_type',
|
||||||
'field' => 'slug',
|
'field' => 'name',
|
||||||
'terms' => array('simple'),
|
'terms' => array('simple'),
|
||||||
'operator' => 'IN'
|
'operator' => 'IN'
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
|
'fields' => 'id=>parent'
|
||||||
);
|
);
|
||||||
|
|
||||||
$low_stock_products = (array) get_posts($args);
|
$low_stock_products = (array) get_posts($args);
|
||||||
|
|
||||||
// Get low stock product variations
|
// Get low stock product variations
|
||||||
|
@ -1977,14 +2001,16 @@ function woocommerce_stock_overview() {
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'key' => '_stock',
|
'key' => '_stock',
|
||||||
'value' => array('', false, null),
|
'value' => array( '', false, null ),
|
||||||
'compare' => 'NOT IN'
|
'compare' => 'NOT IN'
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
|
'fields' => 'id=>parent'
|
||||||
);
|
);
|
||||||
|
|
||||||
$low_stock_variations = (array) get_posts($args);
|
$low_stock_variations = (array) get_posts($args);
|
||||||
|
|
||||||
// Finally, get low stock variable products (where stock is set for the parent)
|
// Get low stock variable products (where stock is set for the parent)
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => array('product'),
|
'post_type' => array('product'),
|
||||||
'post_status' => 'publish',
|
'post_status' => 'publish',
|
||||||
|
@ -2005,17 +2031,35 @@ function woocommerce_stock_overview() {
|
||||||
'tax_query' => array(
|
'tax_query' => array(
|
||||||
array(
|
array(
|
||||||
'taxonomy' => 'product_type',
|
'taxonomy' => 'product_type',
|
||||||
'field' => 'slug',
|
'field' => 'name',
|
||||||
'terms' => array('variable'),
|
'terms' => array('variable'),
|
||||||
'operator' => 'IN'
|
'operator' => 'IN'
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
|
'fields' => 'id=>parent'
|
||||||
);
|
);
|
||||||
|
|
||||||
$low_stock_variable_products = (array) get_posts($args);
|
$low_stock_variable_products = (array) get_posts($args);
|
||||||
|
|
||||||
// Merge results
|
// Get products marked out of stock
|
||||||
$low_in_stock = array_merge($low_stock_products, $low_stock_variations, $low_stock_variable_products);
|
$args = array(
|
||||||
|
'post_type' => array( 'product' ),
|
||||||
|
'post_status' => 'publish',
|
||||||
|
'posts_per_page' => -1,
|
||||||
|
'meta_query' => array(
|
||||||
|
'relation' => 'AND',
|
||||||
|
array(
|
||||||
|
'key' => '_stock_status',
|
||||||
|
'value' => 'outofstock'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'fields' => 'id=>parent'
|
||||||
|
);
|
||||||
|
|
||||||
|
$out_of_stock_status_products = (array) get_posts($args);
|
||||||
|
|
||||||
|
// Merge results
|
||||||
|
$low_in_stock = apply_filters( 'woocommerce_reports_stock_overview_products', $low_stock_products + $low_stock_variations + $low_stock_variable_products + $out_of_stock_status_products );
|
||||||
?>
|
?>
|
||||||
<div id="poststuff" class="woocommerce-reports-wrap halved">
|
<div id="poststuff" class="woocommerce-reports-wrap halved">
|
||||||
<div class="woocommerce-reports-left">
|
<div class="woocommerce-reports-left">
|
||||||
|
@ -2025,22 +2069,23 @@ function woocommerce_stock_overview() {
|
||||||
<?php
|
<?php
|
||||||
if ( $low_in_stock ) {
|
if ( $low_in_stock ) {
|
||||||
echo '<ul class="stock_list">';
|
echo '<ul class="stock_list">';
|
||||||
foreach ( $low_in_stock as $product ) {
|
foreach ( $low_in_stock as $product_id => $parent ) {
|
||||||
|
|
||||||
$stock = (int) get_post_meta( $product->ID, '_stock', true );
|
$stock = (int) get_post_meta( $product_id, '_stock', true );
|
||||||
$sku = get_post_meta( $product->ID, '_sku', true );
|
$sku = get_post_meta( $product_id, '_sku', true );
|
||||||
|
|
||||||
if ( $stock <= $nostockamount ) continue;
|
if ( $stock <= $nostockamount || in_array( $product_id, array_keys( $out_of_stock_status_products ) ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
$title = esc_html__( $product->post_title );
|
$title = esc_html__( get_the_title( $product_id ) );
|
||||||
|
|
||||||
if ( $sku )
|
if ( $sku )
|
||||||
$title .= ' (' . __( 'SKU', 'woocommerce' ) . ': ' . esc_html( $sku ) . ')';
|
$title .= ' (' . __( 'SKU', 'woocommerce' ) . ': ' . esc_html( $sku ) . ')';
|
||||||
|
|
||||||
if ( $product->post_type=='product' )
|
if ( get_post_type( $product_id ) == 'product' )
|
||||||
$product_url = admin_url( 'post.php?post=' . $product->ID . '&action=edit' );
|
$product_url = admin_url( 'post.php?post=' . $product_id . '&action=edit' );
|
||||||
else
|
else
|
||||||
$product_url = admin_url( 'post.php?post=' . $product->post_parent . '&action=edit' );
|
$product_url = admin_url( 'post.php?post=' . $parent . '&action=edit' );
|
||||||
|
|
||||||
printf( '<li><a href="%s"><small>' . _n('%d in stock', '%d in stock', $stock, 'woocommerce') . '</small> %s</a></li>', $product_url, $stock, $title );
|
printf( '<li><a href="%s"><small>' . _n('%d in stock', '%d in stock', $stock, 'woocommerce') . '</small> %s</a></li>', $product_url, $stock, $title );
|
||||||
|
|
||||||
|
@ -2060,24 +2105,28 @@ function woocommerce_stock_overview() {
|
||||||
<?php
|
<?php
|
||||||
if ( $low_in_stock ) {
|
if ( $low_in_stock ) {
|
||||||
echo '<ul class="stock_list">';
|
echo '<ul class="stock_list">';
|
||||||
foreach ( $low_in_stock as $product ) {
|
foreach ( $low_in_stock as $product_id => $parent ) {
|
||||||
|
|
||||||
$stock = (int) get_post_meta( $product->ID, '_stock', true );
|
$stock = get_post_meta( $product_id, '_stock', true );
|
||||||
$sku = get_post_meta( $product->ID, '_sku', true );
|
$sku = get_post_meta( $product_id, '_sku', true );
|
||||||
|
|
||||||
if ( $stock > $nostockamount ) continue;
|
if ( $stock > $nostockamount && ! in_array( $product_id, array_keys( $out_of_stock_status_products ) ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
$title = esc_html__( $product->post_title );
|
$title = esc_html__( get_the_title( $product_id ) );
|
||||||
|
|
||||||
if ( $sku )
|
if ( $sku )
|
||||||
$title .= ' (' . __( 'SKU', 'woocommerce' ) . ': ' . esc_html( $sku ) . ')';
|
$title .= ' (' . __( 'SKU', 'woocommerce' ) . ': ' . esc_html( $sku ) . ')';
|
||||||
|
|
||||||
if ( $product->post_type=='product' )
|
if ( get_post_type( $product_id ) == 'product' )
|
||||||
$product_url = admin_url( 'post.php?post=' . $product->ID . '&action=edit' );
|
$product_url = admin_url( 'post.php?post=' . $product_id . '&action=edit' );
|
||||||
else
|
else
|
||||||
$product_url = admin_url( 'post.php?post=' . $product->post_parent . '&action=edit' );
|
$product_url = admin_url( 'post.php?post=' . $parent . '&action=edit' );
|
||||||
|
|
||||||
printf( '<li><a href="%s"><small>' . _n('%d in stock', '%d in stock', $stock, 'woocommerce') . '</small> %s</a></li>', $product_url, $stock, $title );
|
if ( $stock == '' )
|
||||||
|
printf( '<li><a href="%s"><small>' . __('Marked out of stock', 'woocommerce') . '</small> %s</a></li>', $product_url, $title );
|
||||||
|
else
|
||||||
|
printf( '<li><a href="%s"><small>' . _n('%d in stock', '%d in stock', $stock, 'woocommerce') . '</small> %s</a></li>', $product_url, $stock, $title );
|
||||||
|
|
||||||
}
|
}
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
|
@ -2395,8 +2444,7 @@ function woocommerce_category_sales() {
|
||||||
$first_year = $wpdb->get_var( "SELECT post_date FROM $wpdb->posts WHERE post_date != 0 ORDER BY post_date ASC LIMIT 1;" );
|
$first_year = $wpdb->get_var( "SELECT post_date FROM $wpdb->posts WHERE post_date != 0 ORDER BY post_date ASC LIMIT 1;" );
|
||||||
$first_year = ( $first_year ) ? date( 'Y', strtotime( $first_year ) ) : date( 'Y' );
|
$first_year = ( $first_year ) ? date( 'Y', strtotime( $first_year ) ) : date( 'Y' );
|
||||||
|
|
||||||
$current_year = isset( $_POST['show_year'] ) ? $_POST['show_year'] : date( 'Y', current_time( 'timestamp' ) );
|
$current_year = isset( $_POST['show_year'] ) ? $_POST['show_year'] : date( 'Y', current_time( 'timestamp' ) );
|
||||||
$start_date = strtotime( $current_year . '0101' );
|
|
||||||
|
|
||||||
$categories = get_terms( 'product_cat', array( 'orderby' => 'name' ) );
|
$categories = get_terms( 'product_cat', array( 'orderby' => 'name' ) );
|
||||||
?>
|
?>
|
||||||
|
@ -2433,8 +2481,6 @@ function woocommerce_category_sales() {
|
||||||
$item_sales = array();
|
$item_sales = array();
|
||||||
|
|
||||||
// Get order items
|
// Get order items
|
||||||
$start_date = date( 'Ym', strtotime( date( 'Ym', strtotime( '-1 year', $start_date ) ) . '01' ) );
|
|
||||||
|
|
||||||
$order_items = apply_filters( 'woocommerce_reports_category_sales_order_items', $wpdb->get_results( $wpdb->prepare( "
|
$order_items = apply_filters( 'woocommerce_reports_category_sales_order_items', $wpdb->get_results( $wpdb->prepare( "
|
||||||
SELECT order_item_meta_2.meta_value as product_id, posts.post_date, SUM( order_item_meta.meta_value ) as line_total
|
SELECT order_item_meta_2.meta_value as product_id, posts.post_date, SUM( order_item_meta.meta_value ) as line_total
|
||||||
FROM {$wpdb->prefix}woocommerce_order_items as order_items
|
FROM {$wpdb->prefix}woocommerce_order_items as order_items
|
||||||
|
@ -2450,13 +2496,13 @@ function woocommerce_category_sales() {
|
||||||
AND posts.post_status = 'publish'
|
AND posts.post_status = 'publish'
|
||||||
AND tax.taxonomy = 'shop_order_status'
|
AND tax.taxonomy = 'shop_order_status'
|
||||||
AND term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "')
|
AND term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "')
|
||||||
AND date_format(posts.post_date,'%%Y%%m') >= %s
|
AND date_format(posts.post_date,'%%Y') = %s
|
||||||
AND order_items.order_item_type = 'line_item'
|
AND order_items.order_item_type = 'line_item'
|
||||||
AND order_item_meta.meta_key = '_line_total'
|
AND order_item_meta.meta_key = '_line_total'
|
||||||
AND order_item_meta_2.meta_key = '_product_id'
|
AND order_item_meta_2.meta_key = '_product_id'
|
||||||
GROUP BY order_items.order_id
|
GROUP BY order_items.order_item_id
|
||||||
ORDER BY posts.post_date ASC
|
ORDER BY posts.post_date ASC
|
||||||
", $start_date ) ) );
|
", $current_year ) ) );
|
||||||
|
|
||||||
if ( $order_items ) {
|
if ( $order_items ) {
|
||||||
foreach ( $order_items as $order_item ) {
|
foreach ( $order_items as $order_item ) {
|
||||||
|
@ -2533,7 +2579,8 @@ function woocommerce_category_sales() {
|
||||||
$total = 0;
|
$total = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$month_totals[ $count ] += $total;
|
if ( sizeof( array_intersect( $include_categories, get_ancestors( $category->term_id, 'product_cat' ) ) ) == 0 )
|
||||||
|
$month_totals[ $count ] += $total;
|
||||||
|
|
||||||
$category_sales_html .= '<td>' . woocommerce_price( $total ) . '</td>';
|
$category_sales_html .= '<td>' . woocommerce_price( $total ) . '</td>';
|
||||||
|
|
||||||
|
@ -2633,6 +2680,7 @@ function woocommerce_category_sales() {
|
||||||
<h3><span><?php _e( 'Monthly sales by category', 'woocommerce' ); ?></span></h3>
|
<h3><span><?php _e( 'Monthly sales by category', 'woocommerce' ); ?></span></h3>
|
||||||
<div class="inside chart">
|
<div class="inside chart">
|
||||||
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
<div id="placeholder" style="width:100%; overflow:hidden; height:568px; position:relative;"></div>
|
||||||
|
<div id="cart_legend"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2661,6 +2709,10 @@ function woocommerce_category_sales() {
|
||||||
echo implode( ',', $labels );
|
echo implode( ',', $labels );
|
||||||
?>
|
?>
|
||||||
], {
|
], {
|
||||||
|
legend: {
|
||||||
|
container: jQuery('#cart_legend'),
|
||||||
|
noColumns: 2
|
||||||
|
},
|
||||||
series: {
|
series: {
|
||||||
lines: { show: true, fill: true },
|
lines: { show: true, fill: true },
|
||||||
points: { show: true, align: "left" }
|
points: { show: true, align: "left" }
|
||||||
|
@ -2677,7 +2729,7 @@ function woocommerce_category_sales() {
|
||||||
},
|
},
|
||||||
xaxis: {
|
xaxis: {
|
||||||
mode: "time",
|
mode: "time",
|
||||||
timeformat: "%b %y",
|
timeformat: "%b",
|
||||||
monthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,
|
monthNames: <?php echo json_encode( array_values( $wp_locale->month_abbrev ) ) ?>,
|
||||||
tickLength: 1,
|
tickLength: 1,
|
||||||
minTickSize: [1, "month"]
|
minTickSize: [1, "month"]
|
||||||
|
@ -2699,4 +2751,4 @@ function woocommerce_category_sales() {
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,20 +52,24 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
include_once( 'settings/settings-save.php' );
|
include_once( 'settings/settings-save.php' );
|
||||||
|
|
||||||
switch ( $current_tab ) {
|
switch ( $current_tab ) {
|
||||||
case "general" :
|
case "payment_gateways" :
|
||||||
case "pages" :
|
|
||||||
case "catalog" :
|
|
||||||
case "inventory" :
|
|
||||||
case "payment" :
|
|
||||||
case "shipping" :
|
|
||||||
case "tax" :
|
|
||||||
case "email" :
|
|
||||||
woocommerce_update_options( $woocommerce_settings[ $current_tab ] );
|
woocommerce_update_options( $woocommerce_settings[ $current_tab ] );
|
||||||
|
$woocommerce->payment_gateways->process_admin_options();
|
||||||
|
break;
|
||||||
|
case "shipping" :
|
||||||
|
woocommerce_update_options( $woocommerce_settings[ $current_tab ] );
|
||||||
|
$woocommerce->shipping->process_admin_options();
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
if ( isset( $woocommerce_settings[ $current_tab ] ) )
|
||||||
|
woocommerce_update_options( $woocommerce_settings[ $current_tab ] );
|
||||||
|
|
||||||
|
// Trigger action for tab
|
||||||
|
do_action( 'woocommerce_update_options_' . $current_tab );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
do_action( 'woocommerce_update_options' );
|
do_action( 'woocommerce_update_options' );
|
||||||
do_action( 'woocommerce_update_options_' . $current_tab );
|
|
||||||
|
|
||||||
// Handle Colour Settings
|
// Handle Colour Settings
|
||||||
if ( $current_tab == 'general' && get_option('woocommerce_frontend_css') == 'yes' ) {
|
if ( $current_tab == 'general' && get_option('woocommerce_frontend_css') == 'yes' ) {
|
||||||
|
@ -95,7 +99,7 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// If saving a shipping methods options, load 'er up
|
// If saving a shipping methods options, load 'er up
|
||||||
if ( $current_tab == 'shipping' && class_exists( $current_section ) ) {
|
if ( ( $current_tab == 'shipping' || $current_tab == 'payment_gateways' && class_exists( $current_section ) ) ) {
|
||||||
|
|
||||||
$current_section_class = new $current_section();
|
$current_section_class = new $current_section();
|
||||||
do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section_class->id );
|
do_action( 'woocommerce_update_options_' . $current_tab . '_' . $current_section_class->id );
|
||||||
|
@ -104,7 +108,7 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
} elseif ( $current_tab == 'email' ) {
|
} elseif ( $current_tab == 'email' ) {
|
||||||
|
|
||||||
// Load mailer
|
// Load mailer
|
||||||
$mailer = $woocommerce->mailer();
|
$mailer = $woocommerce->mailer();
|
||||||
|
|
||||||
if ( class_exists( $current_section ) ) {
|
if ( class_exists( $current_section ) ) {
|
||||||
$current_section_class = new $current_section();
|
$current_section_class = new $current_section();
|
||||||
|
@ -165,45 +169,8 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide WC Link
|
// Hide WC Link
|
||||||
if (isset($_GET['hide-wc-extensions-message']))
|
if ( ! empty( $_GET['hide-wc-extensions-message'] ) )
|
||||||
update_option('hide-wc-extensions-message', 1);
|
update_option( 'hide-wc-extensions-message', 1 );
|
||||||
|
|
||||||
// Install/page installer
|
|
||||||
$install_complete = false;
|
|
||||||
|
|
||||||
// Add pages button
|
|
||||||
if (isset($_GET['install_woocommerce_pages']) && $_GET['install_woocommerce_pages']) {
|
|
||||||
|
|
||||||
require_once( 'woocommerce-admin-install.php' );
|
|
||||||
woocommerce_create_pages();
|
|
||||||
update_option('skip_install_woocommerce_pages', 1);
|
|
||||||
$install_complete = true;
|
|
||||||
|
|
||||||
// Skip button
|
|
||||||
} elseif (isset($_GET['skip_install_woocommerce_pages']) && $_GET['skip_install_woocommerce_pages']) {
|
|
||||||
|
|
||||||
update_option('skip_install_woocommerce_pages', 1);
|
|
||||||
$install_complete = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($install_complete) {
|
|
||||||
?>
|
|
||||||
<div id="message" class="updated woocommerce-message wc-connect">
|
|
||||||
<div class="squeezer">
|
|
||||||
<h4><?php _e( '<strong>Congratulations!</strong> – WooCommerce has been installed and setup. Enjoy :)', 'woocommerce' ); ?></h4>
|
|
||||||
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully." data-via="WooThemes" data-size="large" data-hashtags="WooCommerce">Tweet</a>
|
|
||||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
// Flush rules after install
|
|
||||||
flush_rewrite_rules( false );
|
|
||||||
|
|
||||||
// Set installed option
|
|
||||||
update_option('woocommerce_installed', 0);
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<div class="wrap woocommerce">
|
<div class="wrap woocommerce">
|
||||||
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
<form method="post" id="mainform" action="" enctype="multipart/form-data">
|
||||||
|
@ -221,6 +188,9 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
'integration' => __( 'Integration', 'woocommerce' )
|
'integration' => __( 'Integration', 'woocommerce' )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( ! $woocommerce->integrations->get_integrations() )
|
||||||
|
unset( $tabs['integration'] );
|
||||||
|
|
||||||
$tabs = apply_filters('woocommerce_settings_tabs_array', $tabs);
|
$tabs = apply_filters('woocommerce_settings_tabs_array', $tabs);
|
||||||
|
|
||||||
foreach ( $tabs as $name => $label ) {
|
foreach ( $tabs as $name => $label ) {
|
||||||
|
@ -345,38 +315,44 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
woocommerce_admin_fields( $woocommerce_settings[$current_tab] );
|
woocommerce_admin_fields( $woocommerce_settings[ $current_tab ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "payment_gateways" :
|
case "payment_gateways" :
|
||||||
include('settings/settings-payment-gateways.php');
|
include('settings/settings-payment-gateways.php');
|
||||||
|
|
||||||
$links = array( '<a href="#payment-gateways">'.__( 'Payment Gateways', 'woocommerce' ).'</a>' );
|
$current = $current_section ? '' : 'class="current"';
|
||||||
|
|
||||||
foreach ( $woocommerce->payment_gateways->payment_gateways() as $gateway ) :
|
$links = array( '<a href="' . admin_url('admin.php?page=woocommerce_settings&tab=payment_gateways') . '" ' . $current . '>' . __( 'Payment Gateways', 'woocommerce' ) . '</a>' );
|
||||||
$title = empty( $gateway->method_title ) ? ucwords( $gateway->id ) : ucwords( $gateway->method_title );
|
|
||||||
|
|
||||||
$links[] = '<a href="#gateway-'.$gateway->id.'">' . esc_html( $title ) . '</a>';
|
// Load shipping methods so we can show any global options they may have
|
||||||
endforeach;
|
$payment_gateways = $woocommerce->payment_gateways->payment_gateways();
|
||||||
|
|
||||||
echo '<div class="subsubsub_section"><ul class="subsubsub"><li>' . implode( ' | </li><li>', $links ) . '</li></ul><br class="clear" />';
|
foreach ( $payment_gateways as $gateway ) {
|
||||||
|
|
||||||
echo '<div class="section" id="payment-gateways">';
|
$title = empty( $gateway->method_title ) ? ucwords( $gateway->id ) : ucwords( $gateway->method_title );
|
||||||
|
|
||||||
woocommerce_admin_fields( $woocommerce_settings[$current_tab] );
|
$current = ( get_class( $gateway ) == $current_section ) ? 'class="current"' : '';
|
||||||
|
|
||||||
echo '</div>';
|
$links[] = '<a href="' . add_query_arg( 'section', get_class( $gateway ), admin_url('admin.php?page=woocommerce_settings&tab=payment_gateways') ) . '"' . $current . '>' . esc_html( $title ) . '</a>';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<ul class="subsubsub"><li>' . implode( ' | </li><li>', $links ) . '</li></ul><br class="clear" />';
|
||||||
|
|
||||||
// Specific method options
|
// Specific method options
|
||||||
foreach ( $woocommerce->payment_gateways->payment_gateways() as $gateway ) {
|
if ( $current_section ) {
|
||||||
echo '<div class="section" id="gateway-'.$gateway->id.'">';
|
foreach ( $payment_gateways as $gateway ) {
|
||||||
$gateway->admin_options();
|
if ( get_class( $gateway ) == $current_section ) {
|
||||||
echo '</div>';
|
$gateway->admin_options();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
woocommerce_admin_fields( $woocommerce_settings[ $current_tab ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</div>';
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "integration" :
|
case "integration" :
|
||||||
|
|
||||||
|
@ -384,6 +360,8 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
|
|
||||||
$current_section = empty( $current_section ) ? key( $integrations ) : $current_section;
|
$current_section = empty( $current_section ) ? key( $integrations ) : $current_section;
|
||||||
|
|
||||||
|
$links = array();
|
||||||
|
|
||||||
foreach ( $integrations as $integration ) {
|
foreach ( $integrations as $integration ) {
|
||||||
$title = empty( $integration->method_title ) ? ucwords( $integration->id ) : ucwords( $integration->method_title );
|
$title = empty( $integration->method_title ) ? ucwords( $integration->id ) : ucwords( $integration->method_title );
|
||||||
|
|
||||||
|
@ -413,32 +391,6 @@ if ( ! function_exists( 'woocommerce_settings' ) ) {
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(window).load(function(){
|
jQuery(window).load(function(){
|
||||||
// Subsubsub tabs
|
|
||||||
jQuery('div.subsubsub_section ul.subsubsub li a:eq(0)').addClass('current');
|
|
||||||
jQuery('div.subsubsub_section .section:gt(0)').hide();
|
|
||||||
|
|
||||||
jQuery('div.subsubsub_section ul.subsubsub li a').click(function(){
|
|
||||||
var $clicked = jQuery(this);
|
|
||||||
var $section = $clicked.closest('.subsubsub_section');
|
|
||||||
var $target = $clicked.attr('href');
|
|
||||||
|
|
||||||
$section.find('a').removeClass('current');
|
|
||||||
|
|
||||||
if ( $section.find('.section:visible').size() > 0 ) {
|
|
||||||
$section.find('.section:visible').fadeOut( 100, function() {
|
|
||||||
$section.find( $target ).fadeIn('fast');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$section.find( $target ).fadeIn('fast');
|
|
||||||
}
|
|
||||||
|
|
||||||
$clicked.addClass('current');
|
|
||||||
jQuery('#last_tab').val( $target );
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
<?php if ( ! empty( $_GET['subtab'] ) ) echo 'jQuery("div.subsubsub_section ul.subsubsub li a[href=#' . esc_js( $_GET['subtab'] ) . ']").click();'; ?>
|
|
||||||
|
|
||||||
// Countries
|
// Countries
|
||||||
jQuery('select#woocommerce_allowed_countries').change(function(){
|
jQuery('select#woocommerce_allowed_countries').change(function(){
|
||||||
|
@ -553,10 +505,10 @@ function woocommerce_settings_get_option( $option_name, $default = '' ) {
|
||||||
|
|
||||||
if ( is_array( $option_value ) )
|
if ( is_array( $option_value ) )
|
||||||
$option_value = array_map( 'stripslashes', $option_value );
|
$option_value = array_map( 'stripslashes', $option_value );
|
||||||
elseif ( $option_value )
|
elseif ( ! is_null( $option_value ) )
|
||||||
$option_value = stripslashes( $option_value );
|
$option_value = stripslashes( $option_value );
|
||||||
|
|
||||||
return $option_value == null ? $default : $option_value;
|
return $option_value === null ? $default : $option_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -609,9 +561,13 @@ function woocommerce_admin_fields( $options ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) {
|
if ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) {
|
||||||
$tip = '<span class="help_tip" data-tip="' . esc_attr( $tip ) . '">[?]</span>';
|
|
||||||
|
$tip = '<p class="description">' . $tip . '</p>';
|
||||||
|
|
||||||
} elseif ( $tip ) {
|
} elseif ( $tip ) {
|
||||||
|
|
||||||
$tip = '<img class="help_tip" data-tip="' . esc_attr( $tip ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" height="16" width="16" />';
|
$tip = '<img class="help_tip" data-tip="' . esc_attr( $tip ) . '" src="' . $woocommerce->plugin_url() . '/assets/images/help.png" height="16" width="16" />';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch based on type
|
// Switch based on type
|
||||||
|
@ -637,6 +593,7 @@ function woocommerce_admin_fields( $options ) {
|
||||||
case 'email':
|
case 'email':
|
||||||
case 'number':
|
case 'number':
|
||||||
case 'color' :
|
case 'color' :
|
||||||
|
case 'password' :
|
||||||
|
|
||||||
$type = $value['type'];
|
$type = $value['type'];
|
||||||
$class = '';
|
$class = '';
|
||||||
|
@ -704,7 +661,7 @@ function woocommerce_admin_fields( $options ) {
|
||||||
</th>
|
</th>
|
||||||
<td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
|
<td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
|
||||||
<select
|
<select
|
||||||
name="<?php echo esc_attr( $value['id'] ); ?>"
|
name="<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) echo '[]'; ?>"
|
||||||
id="<?php echo esc_attr( $value['id'] ); ?>"
|
id="<?php echo esc_attr( $value['id'] ); ?>"
|
||||||
style="<?php echo esc_attr( $value['css'] ); ?>"
|
style="<?php echo esc_attr( $value['css'] ); ?>"
|
||||||
class="<?php echo esc_attr( $value['class'] ); ?>"
|
class="<?php echo esc_attr( $value['class'] ); ?>"
|
||||||
|
@ -807,7 +764,7 @@ function woocommerce_admin_fields( $options ) {
|
||||||
value="1"
|
value="1"
|
||||||
<?php checked( $option_value, 'yes'); ?>
|
<?php checked( $option_value, 'yes'); ?>
|
||||||
<?php echo implode( ' ', $custom_attributes ); ?>
|
<?php echo implode( ' ', $custom_attributes ); ?>
|
||||||
/> <?php echo wp_kses_post( $value['desc'] ) ?></label> <?php echo $tip; ?><br />
|
/> <?php echo wp_kses_post( $value['desc'] ) ?></label> <?php echo $tip; ?>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if ( ! isset( $value['checkboxgroup'] ) || ( isset( $value['checkboxgroup'] ) && $value['checkboxgroup'] == 'end' ) ) {
|
if ( ! isset( $value['checkboxgroup'] ) || ( isset( $value['checkboxgroup'] ) && $value['checkboxgroup'] == 'end' ) ) {
|
||||||
|
@ -832,7 +789,7 @@ function woocommerce_admin_fields( $options ) {
|
||||||
$crop = checked( 1, woocommerce_settings_get_option( $value['id'] . '[crop]', $value['default']['crop'] ), false );
|
$crop = checked( 1, woocommerce_settings_get_option( $value['id'] . '[crop]', $value['default']['crop'] ), false );
|
||||||
|
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?></th>
|
<th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?> <?php echo $tip; ?></th>
|
||||||
<td class="forminp">
|
<td class="forminp">
|
||||||
|
|
||||||
<?php _e( 'Width', 'woocommerce' ); ?> <input name="<?php echo esc_attr( $value['id'] ); ?>[width]" id="<?php echo esc_attr( $value['id'] ); ?>-width" type="text" size="3" value="<?php echo $width; ?>" />
|
<?php _e( 'Width', 'woocommerce' ); ?> <input name="<?php echo esc_attr( $value['id'] ); ?>[width]" id="<?php echo esc_attr( $value['id'] ); ?>-width" type="text" size="3" value="<?php echo $width; ?>" />
|
||||||
|
@ -841,7 +798,7 @@ function woocommerce_admin_fields( $options ) {
|
||||||
|
|
||||||
<label><?php _e( 'Hard Crop', 'woocommerce' ); ?> <input name="<?php echo esc_attr( $value['id'] ); ?>[crop]" id="<?php echo esc_attr( $value['id'] ); ?>-crop" type="checkbox" <?php echo $crop; ?> /></label>
|
<label><?php _e( 'Hard Crop', 'woocommerce' ); ?> <input name="<?php echo esc_attr( $value['id'] ); ?>[crop]" id="<?php echo esc_attr( $value['id'] ); ?>-crop" type="checkbox" <?php echo $crop; ?> /></label>
|
||||||
|
|
||||||
<?php echo $description; ?></td>
|
</td>
|
||||||
</tr><?php
|
</tr><?php
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -924,4 +881,4 @@ function woocommerce_admin_fields( $options ) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,325 +15,134 @@
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocommerce_status() {
|
function woocommerce_status() {
|
||||||
global $woocommerce;
|
global $woocommerce, $wpdb;
|
||||||
|
|
||||||
$tools = apply_filters( 'wc_debug_tools', array(
|
|
||||||
'clear_transients' => array(
|
|
||||||
'name' => __( 'Transients','woocommerce'),
|
|
||||||
'button' => __('Clear Transients','woocommerce'),
|
|
||||||
'desc' => __( 'This tool will clear the product/shop transients cache.', 'woocommerce' ),
|
|
||||||
),
|
|
||||||
'recount_terms' => array(
|
|
||||||
'name' => __('Term counts','woocommerce'),
|
|
||||||
'button' => __('Recount Terms','woocommerce'),
|
|
||||||
'desc' => __( 'This tool will recount product terms - useful when changing your settings in a way which hides products from the catalog.', 'woocommerce' ),
|
|
||||||
),
|
|
||||||
'reset_roles' => array(
|
|
||||||
'name' => __('Capabilities','woocommerce'),
|
|
||||||
'button' => __('Reset Capabilities','woocommerce'),
|
|
||||||
'desc' => __( 'This tool will reset the admin, customer and shop_manager roles to default. Use this if your users cannot access all of the WooCommerce admin pages.', 'woocommerce' ),
|
|
||||||
),
|
|
||||||
) );
|
|
||||||
|
|
||||||
|
$current_tab = ! empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'status';
|
||||||
?>
|
?>
|
||||||
<div class="wrap woocommerce">
|
<div class="wrap woocommerce">
|
||||||
<div class="icon32 icon32-woocommerce-status" id="icon-woocommerce"><br /></div>
|
<div class="icon32 icon32-woocommerce-status" id="icon-woocommerce"><br /></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||||
<h2><?php _e( 'System Status', 'woocommerce' ); ?> <a href="#" class="add-new-h2 debug-report"><?php _e('Generate report', 'woocommerce' ); ?></a></h2>
|
<?php
|
||||||
|
$tabs = array(
|
||||||
<?php
|
'status' => __( 'System Status', 'woocommerce' ),
|
||||||
if ( ! empty( $_GET['action'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'debug_action' ) ) {
|
'tools' => __( 'Tools', 'woocommerce' ),
|
||||||
|
);
|
||||||
switch ( $_GET['action'] ) {
|
foreach ( $tabs as $name => $label ) {
|
||||||
case "clear_transients" :
|
echo '<a href="' . admin_url( 'admin.php?page=woocommerce_status&tab=' . $name ) . '" class="nav-tab ';
|
||||||
$woocommerce->clear_product_transients();
|
if ( $current_tab == $name ) echo 'nav-tab-active';
|
||||||
|
echo '">' . $label . '</a>';
|
||||||
echo '<div class="updated"><p>' . __( 'Product Transients Cleared', 'woocommerce' ) . '</p></div>';
|
|
||||||
break;
|
|
||||||
case "reset_roles" :
|
|
||||||
// Remove then re-add caps and roles
|
|
||||||
woocommerce_remove_roles();
|
|
||||||
woocommerce_init_roles();
|
|
||||||
|
|
||||||
echo '<div class="updated"><p>' . __( 'Roles successfully reset', 'woocommerce' ) . '</p></div>';
|
|
||||||
break;
|
|
||||||
case "recount_terms" :
|
|
||||||
|
|
||||||
$product_cats = get_terms( 'product_cat', array( 'hide_empty' => false, 'fields' => 'id=>parent' ) );
|
|
||||||
|
|
||||||
_woocommerce_term_recount( $product_cats, get_taxonomy( 'product_cat' ), false, false );
|
|
||||||
|
|
||||||
$product_tags = get_terms( 'product_tag', array( 'hide_empty' => false, 'fields' => 'id=>parent' ) );
|
|
||||||
|
|
||||||
_woocommerce_term_recount( $product_cats, get_taxonomy( 'product_tag' ), false, false );
|
|
||||||
|
|
||||||
echo '<div class="updated"><p>' . __( 'Terms successfully recounted', 'woocommerce' ) . '</p></div>';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$action = esc_attr( $_GET['action'] );
|
|
||||||
if( isset( $tools[ $action ]['callback'] ) ) {
|
|
||||||
$callback = $tools[ $action ]['callback'];
|
|
||||||
$return = call_user_func( $callback );
|
|
||||||
if( $return === false ) {
|
|
||||||
if( is_array( $callback ) ) {
|
|
||||||
echo '<div class="error"><p>' . sprintf( __( 'There was an error calling %s::%s', 'woocommerce' ), get_class( $callback[0] ), $callback[1] ) . '</p></div>';
|
|
||||||
|
|
||||||
} else {
|
|
||||||
echo '<div class="error"><p>' . sprintf( __( 'There was an error calling %s', 'woocommerce' ), $callback ) . '</p></div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
</h2><br/>
|
||||||
|
<?php
|
||||||
|
switch ( $current_tab ) {
|
||||||
|
case "tools" :
|
||||||
|
woocommerce_status_tools();
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
woocommerce_status_report();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<br/>
|
</div>
|
||||||
<textarea id="debug-report" readonly="readonly"></textarea>
|
<?php
|
||||||
<table class="wc_status_table widefat" cellspacing="0">
|
}
|
||||||
|
|
||||||
<thead>
|
/**
|
||||||
<tr>
|
* woocommerce_status_report function.
|
||||||
<th colspan="2"><?php _e( 'Versions', 'woocommerce' ); ?></th>
|
*
|
||||||
</tr>
|
* @access public
|
||||||
</thead>
|
* @return void
|
||||||
|
*/
|
||||||
|
function woocommerce_status_report() {
|
||||||
|
global $woocommerce, $wpdb;
|
||||||
|
|
||||||
<tbody>
|
?>
|
||||||
<tr>
|
<div class="woocommerce-message">
|
||||||
<td><?php _e('WooCommerce version','woocommerce')?></td>
|
<div class="squeezer">
|
||||||
<td><?php echo esc_html( $woocommerce->version ); ?></td>
|
<h4><?php _e( 'Please include this information when requesting support:', 'woocommerce' ); ?> </h4>
|
||||||
</tr>
|
<p class="submit"><a href="#" download="wc_report.txt" class="button-primary debug-report"><?php _e( 'Download System Report File', 'woocommerce' ); ?></a></p>
|
||||||
<tr>
|
</div>
|
||||||
<td><?php _e('WooCommerce DB version','woocommerce')?></td>
|
</div>
|
||||||
<td><?php echo esc_html( get_option( 'woocommerce_db_version' ) ); ?></td>
|
<br/>
|
||||||
</tr>
|
<table class="wc_status_table widefat" cellspacing="0">
|
||||||
<tr>
|
|
||||||
<td><?php _e('WordPress version','woocommerce')?></td>
|
|
||||||
<td><?php if ( is_multisite() ) echo 'WPMU'; else echo 'WP'; ?> <?php echo bloginfo('version'); ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('Installed plugins','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
$active_plugins = (array) get_option( 'active_plugins', array() );
|
|
||||||
|
|
||||||
if ( is_multisite() )
|
<thead>
|
||||||
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
|
<tr>
|
||||||
|
<th colspan="2"><?php _e( 'Environment', 'woocommerce' ); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
$wc_plugins = array();
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'Home URL','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php echo home_url(); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'Site URL','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php echo site_url(); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'WC Version','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php echo esc_html( $woocommerce->version ); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'WC Database Version','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php echo esc_html( get_option( 'woocommerce_db_version' ) ); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'WP Version','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php if ( is_multisite() ) echo 'WPMU'; else echo 'WP'; ?> <?php echo bloginfo('version'); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'Web Server Info','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'PHP Version','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php if ( function_exists( 'phpversion' ) ) echo esc_html( phpversion() ); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'MySQL Version','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php if ( function_exists( 'mysql_get_server_info' ) ) echo esc_html( mysql_get_server_info() ); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'WP Memory Limit','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php
|
||||||
|
$memory = woocommerce_let_to_num( WP_MEMORY_LIMIT );
|
||||||
|
|
||||||
foreach ( $active_plugins as $plugin ) {
|
if ( $memory < 67108864 ) {
|
||||||
|
echo '<mark class="error">' . sprintf( __( '%s - We recommend setting memory to at least 64MB. See: <a href="%s">Increasing memory allocated to PHP</a>', 'woocommerce' ), wp_convert_bytes_to_hr( $memory ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . '</mark>';
|
||||||
$plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
|
} else {
|
||||||
|
echo '<mark class="yes">' . wp_convert_bytes_to_hr( $memory ) . '</mark>';
|
||||||
if ( ! empty( $plugin_data['Name'] ) ) {
|
}
|
||||||
|
?></td>
|
||||||
$wc_plugins[] = $plugin_data['Name'] . ' ' . __( 'by', 'woocommerce' ) . ' ' . $plugin_data['Author'] . ' ' . __( 'version', 'woocommerce' ) . ' ' . $plugin_data['Version'];
|
</tr>
|
||||||
|
<tr>
|
||||||
}
|
<td><?php _e( 'WP Debug Mode','woocommerce' ); ?>:</td>
|
||||||
}
|
<td><?php if ( defined('WP_DEBUG') && WP_DEBUG ) echo '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>'; else echo '<mark class="no">' . __( 'No', 'woocommerce' ) . '</mark>'; ?></td>
|
||||||
|
</tr>
|
||||||
if ( sizeof( $wc_plugins ) == 0 ) echo '-'; else echo '<ul><li>' . implode( ', </li><li>', $wc_plugins ) . '</li></ul>';
|
<tr>
|
||||||
|
<td><?php _e( 'WP Max Upload Size','woocommerce' ); ?>:</td>
|
||||||
?></td>
|
<td><?php echo wp_convert_bytes_to_hr( wp_max_upload_size() ); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
<tr>
|
||||||
|
<td><?php _e('PHP Post Max Size','woocommerce' ); ?>:</td>
|
||||||
<thead>
|
<td><?php if ( function_exists( 'ini_get' ) ) echo wp_convert_bytes_to_hr( woocommerce_let_to_num( ini_get('post_max_size') ) ); ?></td>
|
||||||
<tr>
|
</tr>
|
||||||
<th colspan="2"><?php _e( 'Settings', 'woocommerce' ); ?></th>
|
<tr>
|
||||||
</tr>
|
<td><?php _e('PHP Time Limit','woocommerce' ); ?>:</td>
|
||||||
</thead>
|
<td><?php if ( function_exists( 'ini_get' ) ) echo ini_get('max_execution_time'); ?></td>
|
||||||
|
</tr>
|
||||||
<tbody>
|
<tr>
|
||||||
<tr>
|
<td><?php _e( 'WC Logging','woocommerce' ); ?>:</td>
|
||||||
<td><?php _e('Home URL','woocommerce')?></td>
|
<td><?php
|
||||||
<td><?php echo home_url(); ?></td>
|
if ( @fopen( $woocommerce->plugin_path() . '/logs/paypal.txt', 'a' ) )
|
||||||
</tr>
|
echo '<mark class="yes">' . __( 'Log directory is writable.', 'woocommerce' ) . '</mark>';
|
||||||
<tr>
|
else
|
||||||
<td><?php _e('Site URL','woocommerce')?></td>
|
echo '<mark class="error">' . __( 'Log directory (<code>woocommerce/logs/</code>) is not writable. Logging will not be possible.', 'woocommerce' ) . '</mark>';
|
||||||
<td><?php echo site_url(); ?></td>
|
?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<?php
|
||||||
<td><?php _e('Force SSL','woocommerce')?></td>
|
|
||||||
<td><?php echo ( get_option( 'woocommerce_force_ssl_checkout' ) === 'yes' ) ? '<mark class="yes">'.__( 'Yes', 'woocommerce' ).'</mark>' : '<mark class="no">'.__( 'No', 'woocommerce' ).'</mark>'; ?></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colspan="2"><?php _e( 'Shop Pages', 'woocommerce' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
$check_pages = array(
|
|
||||||
__( 'Shop base page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_shop_page_id',
|
|
||||||
'shortcode' => ''
|
|
||||||
),
|
|
||||||
__( 'Cart Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_cart_page_id',
|
|
||||||
'shortcode' => '[woocommerce_cart]'
|
|
||||||
),
|
|
||||||
__( 'Checkout Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_checkout_page_id',
|
|
||||||
'shortcode' => '[woocommerce_checkout]'
|
|
||||||
),
|
|
||||||
__( 'Pay Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_pay_page_id',
|
|
||||||
'shortcode' => '[woocommerce_pay]'
|
|
||||||
),
|
|
||||||
__( 'Thanks Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_thanks_page_id',
|
|
||||||
'shortcode' => '[woocommerce_thankyou]'
|
|
||||||
),
|
|
||||||
__( 'My Account Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_myaccount_page_id',
|
|
||||||
'shortcode' => '[woocommerce_my_account]'
|
|
||||||
),
|
|
||||||
__( 'Edit Address Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_edit_address_page_id',
|
|
||||||
'shortcode' => '[woocommerce_edit_address]'
|
|
||||||
),
|
|
||||||
__( 'View Order Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_view_order_page_id',
|
|
||||||
'shortcode' => '[woocommerce_view_order]'
|
|
||||||
),
|
|
||||||
__( 'Change Password Page', 'woocommerce' ) => array(
|
|
||||||
'option' => 'woocommerce_change_password_page_id',
|
|
||||||
'shortcode' => '[woocommerce_change_password]'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$alt = 1;
|
|
||||||
|
|
||||||
foreach ( $check_pages as $page_name => $values ) {
|
|
||||||
|
|
||||||
if ( $alt == 1 ) echo '<tr>'; else echo '<tr>';
|
|
||||||
|
|
||||||
echo '<td>' . esc_html( $page_name ) . '</td><td>';
|
|
||||||
|
|
||||||
$error = false;
|
|
||||||
|
|
||||||
$page_id = get_option($values['option']);
|
|
||||||
|
|
||||||
// Page ID check
|
|
||||||
if ( ! $page_id ) {
|
|
||||||
echo '<mark class="error">' . __( 'Page not set', 'woocommerce' ) . '</mark>';
|
|
||||||
$error = true;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// Shortcode check
|
|
||||||
if ( $values['shortcode'] ) {
|
|
||||||
$page = get_post( $page_id );
|
|
||||||
|
|
||||||
if ( ! strstr( $page->post_content, $values['shortcode'] ) ) {
|
|
||||||
|
|
||||||
echo '<mark class="error">' . sprintf(__( 'Page does not contain the shortcode: %s', 'woocommerce' ), $values['shortcode'] ) . '</mark>';
|
|
||||||
$error = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! $error ) echo '<mark class="yes">#' . absint( $page_id ) . ' - ' . get_permalink( $page_id ) . '</mark>';
|
|
||||||
|
|
||||||
echo '</td></tr>';
|
|
||||||
|
|
||||||
$alt = $alt * -1;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colspan="2"><?php _e( 'Core Taxonomies', 'woocommerce' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('Order Statuses','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
$order_statuses = get_terms( 'shop_order_status', array( 'fields' => 'names', 'hide_empty' => 0 ) );
|
|
||||||
echo implode( ', ', array_map( 'esc_html', $order_statuses ) );
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colspan="2"><?php _e( 'Server Environment', 'woocommerce' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('PHP Version','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
if ( function_exists( 'phpversion' ) )
|
|
||||||
echo esc_html( phpversion() );
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('Server Software','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
echo esc_html( $_SERVER['SERVER_SOFTWARE'] );
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('WP Max Upload Size','woocommerce'); ?></td>
|
|
||||||
<td><?php
|
|
||||||
echo wp_convert_bytes_to_hr( wp_max_upload_size() );
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('Server upload_max_filesize','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
if(function_exists('phpversion'))
|
|
||||||
echo wp_convert_bytes_to_hr( woocommerce_let_to_num( ini_get('upload_max_filesize') ) );
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('Server post_max_size','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
if(function_exists('phpversion'))
|
|
||||||
echo wp_convert_bytes_to_hr( woocommerce_let_to_num( ini_get('post_max_size') ) );
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('WP Memory Limit','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
$memory = woocommerce_let_to_num( WP_MEMORY_LIMIT );
|
|
||||||
|
|
||||||
if ( $memory < 67108864 ) {
|
|
||||||
echo '<mark class="error">' . sprintf( __( '%s - We recommend setting memory to at least 64MB. See: <a href="%s">Increasing memory allocated to PHP</a>', 'woocommerce' ), wp_convert_bytes_to_hr( $memory ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . '</mark>';
|
|
||||||
} else {
|
|
||||||
echo '<mark class="yes">' . wp_convert_bytes_to_hr( $memory ) . '</mark>';
|
|
||||||
}
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('WP Debug Mode','woocommerce')?></td>
|
|
||||||
<td><?php if ( defined('WP_DEBUG') && WP_DEBUG ) echo '<mark class="yes">' . __( 'Yes', 'woocommerce' ) . '</mark>'; else echo '<mark class="no">' . __( 'No', 'woocommerce' ) . '</mark>'; ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?php _e('WC Logging','woocommerce')?></td>
|
|
||||||
<td><?php
|
|
||||||
if ( @fopen( $woocommerce->plugin_path() . '/logs/paypal.txt', 'a' ) )
|
|
||||||
echo '<mark class="yes">' . __( 'Log directory is writable.', 'woocommerce' ) . '</mark>';
|
|
||||||
else
|
|
||||||
echo '<mark class="error">' . __( 'Log directory (<code>woocommerce/logs/</code>) is not writable. Logging will not be possible.', 'woocommerce' ) . '</mark>';
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colspan="2"><?php _e( 'Remote Posting/IPN', 'woocommerce' ); ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$posting = array();
|
$posting = array();
|
||||||
|
|
||||||
// fsockopen/cURL
|
// fsockopen/cURL
|
||||||
|
@ -348,22 +157,22 @@ function woocommerce_status() {
|
||||||
}
|
}
|
||||||
$posting['fsockopen_curl']['success'] = true;
|
$posting['fsockopen_curl']['success'] = true;
|
||||||
} else {
|
} else {
|
||||||
$posting['fsockopen_curl']['note'] = __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'woocommerce' ). '</mark>';
|
$posting['fsockopen_curl']['note'] = __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'woocommerce' ). '</mark>';
|
||||||
$posting['fsockopen_curl']['success'] = false;
|
$posting['fsockopen_curl']['success'] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SOAP
|
// SOAP
|
||||||
$posting['soap_client']['name'] = __( 'SOAP Client','woocommerce' );
|
$posting['soap_client']['name'] = __( 'SOAP Client','woocommerce' );
|
||||||
if ( class_exists( 'SoapClient' ) ) {
|
if ( class_exists( 'SoapClient' ) ) {
|
||||||
$posting['soap_client']['note'] = __('Your server has the SOAP Client class enabled.', 'woocommerce' );
|
$posting['soap_client']['note'] = __('Your server has the SOAP Client class enabled.', 'woocommerce' );
|
||||||
$posting['soap_client']['success'] = true;
|
$posting['soap_client']['success'] = true;
|
||||||
} else {
|
} else {
|
||||||
$posting['soap_client']['note'] = sprintf( __( 'Your server does not have the <a href="%s">SOAP Client</a> class enabled - some gateway plugins which use SOAP may not work as expected.', 'woocommerce' ), 'http://php.net/manual/en/class.soapclient.php' ) . '</mark>';
|
$posting['soap_client']['note'] = sprintf( __( 'Your server does not have the <a href="%s">SOAP Client</a> class enabled - some gateway plugins which use SOAP may not work as expected.', 'woocommerce' ), 'http://php.net/manual/en/class.soapclient.php' ) . '</mark>';
|
||||||
$posting['soap_client']['success'] = false;
|
$posting['soap_client']['success'] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WP Remote Post Check
|
// WP Remote Post Check
|
||||||
$posting['wp_remote_post']['name'] = __( 'WP Remote Post Check','woocommerce');
|
$posting['wp_remote_post']['name'] = __( 'WP Remote Post','woocommerce');
|
||||||
$request['cmd'] = '_notify-validate';
|
$request['cmd'] = '_notify-validate';
|
||||||
$params = array(
|
$params = array(
|
||||||
'sslverify' => false,
|
'sslverify' => false,
|
||||||
|
@ -374,101 +183,459 @@ function woocommerce_status() {
|
||||||
$response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
|
$response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params );
|
||||||
|
|
||||||
if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
|
if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
|
||||||
$posting['wp_remote_post']['note'] = __('wp_remote_post() was successful - PayPal IPN is working.', 'woocommerce' );
|
$posting['wp_remote_post']['note'] = __('wp_remote_post() was successful - PayPal IPN is working.', 'woocommerce' );
|
||||||
$posting['wp_remote_post']['success'] = true;
|
$posting['wp_remote_post']['success'] = true;
|
||||||
} elseif ( is_wp_error( $response ) ) {
|
} elseif ( is_wp_error( $response ) ) {
|
||||||
$posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider. Error:', 'woocommerce' ) . ' ' . $response->get_error_message();
|
$posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider. Error:', 'woocommerce' ) . ' ' . $response->get_error_message();
|
||||||
$posting['wp_remote_post']['success'] = false;
|
$posting['wp_remote_post']['success'] = false;
|
||||||
} else {
|
} else {
|
||||||
$posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN may not work with your server.', 'woocommerce' );
|
$posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN may not work with your server.', 'woocommerce' );
|
||||||
$posting['wp_remote_post']['success'] = false;
|
$posting['wp_remote_post']['success'] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$posting = apply_filters( 'wc_debug_posting', $posting );
|
$posting = apply_filters( 'woocommerce_debug_posting', $posting );
|
||||||
?>
|
|
||||||
|
|
||||||
<tbody>
|
foreach( $posting as $post ) { $mark = ( isset( $post['success'] ) && $post['success'] == true ) ? 'yes' : 'error';
|
||||||
<?php foreach($posting as $post) { $mark = ( isset( $post['success'] ) && $post['success'] == true ) ? 'yes' : 'error'; ?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo esc_html( $post['name'] ); ?></td>
|
<td><?php echo esc_html( $post['name'] ); ?>:</td>
|
||||||
<td>
|
<td>
|
||||||
<mark class="<?php echo $mark; ?>">
|
<mark class="<?php echo $mark; ?>">
|
||||||
<?php echo wp_kses_data( $post['note'] ); ?>
|
<?php echo wp_kses_data( $post['note'] ); ?>
|
||||||
</mark>
|
</mark>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php
|
||||||
</tbody>
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
<thead class="tools">
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2"><?php _e( 'Tools', 'woocommerce' ); ?></th>
|
<th colspan="2"><?php _e( 'Plugins', 'woocommerce' ); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody class="tools">
|
<tbody>
|
||||||
<?php foreach($tools as $action => $tool) { ?>
|
<tr>
|
||||||
<tr>
|
<td><?php _e( 'Installed Plugins','woocommerce' ); ?>:</td>
|
||||||
<td><?php echo esc_html( $tool['name'] ); ?></td>
|
<td><?php
|
||||||
<td>
|
$active_plugins = (array) get_option( 'active_plugins', array() );
|
||||||
<p>
|
|
||||||
<a href="<?php echo wp_nonce_url( admin_url('admin.php?page=woocommerce_status&action=' . $action ), 'debug_action' ); ?>" class="button"><?php echo esc_html( $tool['button'] ); ?></a>
|
|
||||||
<span class="description"><?php echo wp_kses_post( $tool['desc'] ); ?></span>
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php } ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
if ( is_multisite() )
|
||||||
<script type="text/javascript">
|
$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
|
||||||
|
|
||||||
jQuery('a.debug-report').click(function(){
|
$wc_plugins = array();
|
||||||
|
|
||||||
if ( ! jQuery('#debug-report').val() ) {
|
foreach ( $active_plugins as $plugin ) {
|
||||||
|
|
||||||
// Generate report - user can paste into forum
|
$plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
|
||||||
var report = '`';
|
|
||||||
|
|
||||||
jQuery('thead:not(".tools"), tbody:not(".tools")', '.wc_status_table').each(function(){
|
if ( ! empty( $plugin_data['Name'] ) ) {
|
||||||
|
|
||||||
$this = jQuery( this );
|
$wc_plugins[] = $plugin_data['Name'] . ' ' . __( 'by', 'woocommerce' ) . ' ' . $plugin_data['Author'] . ' ' . __( 'version', 'woocommerce' ) . ' ' . $plugin_data['Version'];
|
||||||
|
|
||||||
if ( $this.is('thead') ) {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
report = report + "\n=============================================================================================\n";
|
if ( sizeof( $wc_plugins ) == 0 )
|
||||||
report = report + " " + jQuery.trim( $this.text() ) + "\n";
|
echo '-';
|
||||||
report = report + "=============================================================================================\n";
|
else
|
||||||
|
echo implode( ', <br/>', $wc_plugins );
|
||||||
|
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2"><?php _e( 'Settings', 'woocommerce' ); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'Force SSL','woocommerce' ); ?>:</td>
|
||||||
|
<td><?php echo get_option( 'woocommerce_force_ssl_checkout' ) === 'yes' ? '<mark class="yes">'.__( 'Yes', 'woocommerce' ).'</mark>' : '<mark class="no">'.__( 'No', 'woocommerce' ).'</mark>'; ?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2"><?php _e( 'WC Pages', 'woocommerce' ); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$check_pages = array(
|
||||||
|
__( 'Shop Base', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_shop_page_id',
|
||||||
|
'shortcode' => ''
|
||||||
|
),
|
||||||
|
__( 'Cart', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_cart_page_id',
|
||||||
|
'shortcode' => '[woocommerce_cart]'
|
||||||
|
),
|
||||||
|
__( 'Checkout', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_checkout_page_id',
|
||||||
|
'shortcode' => '[woocommerce_checkout]'
|
||||||
|
),
|
||||||
|
__( 'Pay', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_pay_page_id',
|
||||||
|
'shortcode' => '[woocommerce_pay]'
|
||||||
|
),
|
||||||
|
__( 'Thanks', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_thanks_page_id',
|
||||||
|
'shortcode' => '[woocommerce_thankyou]'
|
||||||
|
),
|
||||||
|
__( 'My Account', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_myaccount_page_id',
|
||||||
|
'shortcode' => '[woocommerce_my_account]'
|
||||||
|
),
|
||||||
|
__( 'Edit Address', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_edit_address_page_id',
|
||||||
|
'shortcode' => '[woocommerce_edit_address]'
|
||||||
|
),
|
||||||
|
__( 'View Order', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_view_order_page_id',
|
||||||
|
'shortcode' => '[woocommerce_view_order]'
|
||||||
|
),
|
||||||
|
__( 'Change Password', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_change_password_page_id',
|
||||||
|
'shortcode' => '[woocommerce_change_password]'
|
||||||
|
),
|
||||||
|
__( 'Lost Password', 'woocommerce' ) => array(
|
||||||
|
'option' => 'woocommerce_lost_password_page_id',
|
||||||
|
'shortcode' => '[woocommerce_lost_password]'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$alt = 1;
|
||||||
|
|
||||||
|
foreach ( $check_pages as $page_name => $values ) {
|
||||||
|
|
||||||
|
if ( $alt == 1 ) echo '<tr>'; else echo '<tr>';
|
||||||
|
|
||||||
|
echo '<td>' . esc_html( $page_name ) . ':</td><td>';
|
||||||
|
|
||||||
|
$error = false;
|
||||||
|
|
||||||
|
$page_id = get_option( $values['option'] );
|
||||||
|
|
||||||
|
// Page ID check
|
||||||
|
if ( ! $page_id ) {
|
||||||
|
echo '<mark class="error">' . __( 'Page not set', 'woocommerce' ) . '</mark>';
|
||||||
|
$error = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
jQuery('tr', $this).each(function(){
|
// Shortcode check
|
||||||
|
if ( $values['shortcode'] ) {
|
||||||
|
$page = get_post( $page_id );
|
||||||
|
|
||||||
$this = jQuery( this );
|
if ( empty( $page ) ) {
|
||||||
|
|
||||||
report = report + $this.find('td:eq(0)').text() + ": \t";
|
echo '<mark class="error">' . sprintf( __( 'Page does not exist', 'woocommerce' ) ) . '</mark>';
|
||||||
report = report + $this.find('td:eq(1)').text() + "\n";
|
$error = true;
|
||||||
|
|
||||||
});
|
} else if ( ! strstr( $page->post_content, $values['shortcode'] ) ) {
|
||||||
|
|
||||||
|
echo '<mark class="error">' . sprintf( __( 'Page does not contain the shortcode: %s', 'woocommerce' ), $values['shortcode'] ) . '</mark>';
|
||||||
|
$error = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
if ( ! $error ) echo '<mark class="yes">#' . absint( $page_id ) . ' - ' . str_replace( home_url(), '', get_permalink( $page_id ) ) . '</mark>';
|
||||||
|
|
||||||
report = report + '`';
|
echo '</td></tr>';
|
||||||
|
|
||||||
jQuery('#debug-report').val( report );
|
$alt = $alt * -1;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2"><?php _e( 'WC Taxonomies', 'woocommerce' ); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'Order Statuses', 'woocommerce' ); ?>:</td>
|
||||||
|
<td><?php
|
||||||
|
$display_terms = array();
|
||||||
|
$terms = get_terms( 'shop_order_status', array( 'hide_empty' => 0 ) );
|
||||||
|
foreach ( $terms as $term )
|
||||||
|
$display_terms[] = $term->name . ' (' . $term->slug . ')';
|
||||||
|
echo implode( ', ', array_map( 'esc_html', $display_terms ) );
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'Product Types', 'woocommerce' ); ?>:</td>
|
||||||
|
<td><?php
|
||||||
|
$display_terms = array();
|
||||||
|
$terms = get_terms( 'product_type', array( 'hide_empty' => 0 ) );
|
||||||
|
foreach ( $terms as $term )
|
||||||
|
$display_terms[] = $term->name . ' (' . $term->slug . ')';
|
||||||
|
echo implode( ', ', array_map( 'esc_html', $display_terms ) );
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="2"><?php _e( 'Templates', 'woocommerce' ); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><?php _e( 'Template Overrides', 'woocommerce' ); ?>:</td>
|
||||||
|
<td><?php
|
||||||
|
|
||||||
|
$template_path = $woocommerce->plugin_path() . '/templates/';
|
||||||
|
$found_files = array();
|
||||||
|
$files = woocommerce_scan_template_files( $template_path );
|
||||||
|
|
||||||
|
foreach ( $files as $file ) {
|
||||||
|
if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
|
||||||
|
$found_files[] = '/' . $file;
|
||||||
|
} elseif( file_exists( get_stylesheet_directory() . '/woocommerce/' . $file ) ) {
|
||||||
|
$found_files[] = '/woocommerce/' . $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $found_files ) {
|
||||||
|
echo implode( ', <br/>', $found_files );
|
||||||
|
} else {
|
||||||
|
_e( 'No core overrides present in theme.', 'woocommerce' );
|
||||||
|
}
|
||||||
|
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
jQuery.wc_strPad = function(i,l,s) {
|
||||||
|
var o = i.toString();
|
||||||
|
if (!s) { s = '0'; }
|
||||||
|
while (o.length < l) {
|
||||||
|
o = o + s;
|
||||||
}
|
}
|
||||||
|
return o;
|
||||||
|
};
|
||||||
|
|
||||||
jQuery('#debug-report').slideToggle('500', function() {
|
jQuery('a.debug-report').click(function(){
|
||||||
jQuery(this).select();
|
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
var report = "data:text/plain;charset=utf-8,";
|
||||||
|
|
||||||
|
jQuery('.wc_status_table thead, .wc_status_table tbody').each(function(){
|
||||||
|
|
||||||
|
$this = jQuery( this );
|
||||||
|
|
||||||
|
if ( $this.is('thead') ) {
|
||||||
|
|
||||||
|
report = report + "\n### " + jQuery.trim( $this.text() ) + " ###\n\n";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
jQuery('tr', $this).each(function(){
|
||||||
|
|
||||||
|
$this = jQuery( this );
|
||||||
|
|
||||||
|
name = jQuery.wc_strPad( jQuery.trim( $this.find('td:eq(0)').text() ), 25, ' ' );
|
||||||
|
value = jQuery.trim( $this.find('td:eq(1)').text() );
|
||||||
|
|
||||||
|
report = report + '' + name + value + "\n\n";
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} );
|
||||||
|
|
||||||
|
jQuery(this).attr( 'href', encodeURI( report ) );
|
||||||
|
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* woocommerce_scan_template_files function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param mixed $template_path
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function woocommerce_scan_template_files( $template_path ) {
|
||||||
|
$files = scandir( $template_path );
|
||||||
|
$result = array();
|
||||||
|
if ( $files ) {
|
||||||
|
foreach ( $files as $key => $value ) {
|
||||||
|
if ( ! in_array( $value, array( ".",".." ) ) ) {
|
||||||
|
if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {
|
||||||
|
$sub_files = woocommerce_scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );
|
||||||
|
foreach ( $sub_files as $sub_file ) {
|
||||||
|
$result[] = $value . DIRECTORY_SEPARATOR . $sub_file;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$result[] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* woocommerce_status_tools function.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function woocommerce_status_tools() {
|
||||||
|
global $woocommerce, $wpdb;
|
||||||
|
|
||||||
|
$tools = apply_filters( 'woocommerce_debug_tools', array(
|
||||||
|
'clear_transients' => array(
|
||||||
|
'name' => __( 'WC Transients','woocommerce'),
|
||||||
|
'button' => __('Clear transients','woocommerce'),
|
||||||
|
'desc' => __( 'This tool will clear the product/shop transients cache.', 'woocommerce' ),
|
||||||
|
),
|
||||||
|
'clear_expired_transients' => array(
|
||||||
|
'name' => __( 'Expired Transients','woocommerce'),
|
||||||
|
'button' => __('Clear expired transients','woocommerce'),
|
||||||
|
'desc' => __( 'This tool will clear ALL expired transients from Wordpress.', 'woocommerce' ),
|
||||||
|
),
|
||||||
|
'recount_terms' => array(
|
||||||
|
'name' => __('Term counts','woocommerce'),
|
||||||
|
'button' => __('Recount terms','woocommerce'),
|
||||||
|
'desc' => __( 'This tool will recount product terms - useful when changing your settings in a way which hides products from the catalog.', 'woocommerce' ),
|
||||||
|
),
|
||||||
|
'reset_roles' => array(
|
||||||
|
'name' => __('Capabilities','woocommerce'),
|
||||||
|
'button' => __('Reset capabilities','woocommerce'),
|
||||||
|
'desc' => __( 'This tool will reset the admin, customer and shop_manager roles to default. Use this if your users cannot access all of the WooCommerce admin pages.', 'woocommerce' ),
|
||||||
|
),
|
||||||
|
) );
|
||||||
|
|
||||||
|
if ( ! empty( $_GET['action'] ) && ! empty( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'debug_action' ) ) {
|
||||||
|
|
||||||
|
switch ( $_GET['action'] ) {
|
||||||
|
case "clear_transients" :
|
||||||
|
$woocommerce->clear_product_transients();
|
||||||
|
|
||||||
|
echo '<div class="updated"><p>' . __( 'Product Transients Cleared', 'woocommerce' ) . '</p></div>';
|
||||||
|
break;
|
||||||
|
case "clear_expired_transients" :
|
||||||
|
|
||||||
|
// http://w-shadow.com/blog/2012/04/17/delete-stale-transients/
|
||||||
|
$rows = $wpdb->query( "
|
||||||
|
DELETE
|
||||||
|
a, b
|
||||||
|
FROM
|
||||||
|
{$wpdb->options} a, {$wpdb->options} b
|
||||||
|
WHERE
|
||||||
|
a.option_name LIKE '_transient_%' AND
|
||||||
|
a.option_name NOT LIKE '_transient_timeout_%' AND
|
||||||
|
b.option_name = CONCAT(
|
||||||
|
'_transient_timeout_',
|
||||||
|
SUBSTRING(
|
||||||
|
a.option_name,
|
||||||
|
CHAR_LENGTH('_transient_') + 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
AND b.option_value < UNIX_TIMESTAMP()
|
||||||
|
" );
|
||||||
|
|
||||||
|
$rows2 = $wpdb->query( "
|
||||||
|
DELETE
|
||||||
|
a, b
|
||||||
|
FROM
|
||||||
|
{$wpdb->options} a, {$wpdb->options} b
|
||||||
|
WHERE
|
||||||
|
a.option_name LIKE '_site_transient_%' AND
|
||||||
|
a.option_name NOT LIKE '_site_transient_timeout_%' AND
|
||||||
|
b.option_name = CONCAT(
|
||||||
|
'_site_transient_timeout_',
|
||||||
|
SUBSTRING(
|
||||||
|
a.option_name,
|
||||||
|
CHAR_LENGTH('_site_transient_') + 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
AND b.option_value < UNIX_TIMESTAMP()
|
||||||
|
" );
|
||||||
|
|
||||||
|
echo '<div class="updated"><p>' . sprintf( __( '%d Transients Rows Cleared', 'woocommerce' ), $rows + $rows2 ) . '</p></div>';
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "reset_roles" :
|
||||||
|
// Remove then re-add caps and roles
|
||||||
|
woocommerce_remove_roles();
|
||||||
|
woocommerce_init_roles();
|
||||||
|
|
||||||
|
echo '<div class="updated"><p>' . __( 'Roles successfully reset', 'woocommerce' ) . '</p></div>';
|
||||||
|
break;
|
||||||
|
case "recount_terms" :
|
||||||
|
|
||||||
|
$product_cats = get_terms( 'product_cat', array( 'hide_empty' => false, 'fields' => 'id=>parent' ) );
|
||||||
|
|
||||||
|
_woocommerce_term_recount( $product_cats, get_taxonomy( 'product_cat' ), false, false );
|
||||||
|
|
||||||
|
$product_tags = get_terms( 'product_tag', array( 'hide_empty' => false, 'fields' => 'id=>parent' ) );
|
||||||
|
|
||||||
|
_woocommerce_term_recount( $product_cats, get_taxonomy( 'product_tag' ), false, false );
|
||||||
|
|
||||||
|
echo '<div class="updated"><p>' . __( 'Terms successfully recounted', 'woocommerce' ) . '</p></div>';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$action = esc_attr( $_GET['action'] );
|
||||||
|
if( isset( $tools[ $action ]['callback'] ) ) {
|
||||||
|
$callback = $tools[ $action ]['callback'];
|
||||||
|
$return = call_user_func( $callback );
|
||||||
|
if( $return === false ) {
|
||||||
|
if( is_array( $callback ) ) {
|
||||||
|
echo '<div class="error"><p>' . sprintf( __( 'There was an error calling %s::%s', 'woocommerce' ), get_class( $callback[0] ), $callback[1] ) . '</p></div>';
|
||||||
|
|
||||||
|
} else {
|
||||||
|
echo '<div class="error"><p>' . sprintf( __( 'There was an error calling %s', 'woocommerce' ), $callback ) . '</p></div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<table class="wc_status_table widefat" cellspacing="0">
|
||||||
|
|
||||||
|
<thead class="tools">
|
||||||
|
<tr>
|
||||||
|
<th colspan="2"><?php _e( 'Tools', 'woocommerce' ); ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody class="tools">
|
||||||
|
<?php foreach($tools as $action => $tool) { ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo esc_html( $tool['name'] ); ?></td>
|
||||||
|
<td>
|
||||||
|
<p>
|
||||||
|
<a href="<?php echo wp_nonce_url( admin_url('admin.php?page=woocommerce_status&tab=tools&action=' . $action ), 'debug_action' ); ?>" class="button"><?php echo esc_html( $tool['button'] ); ?></a>
|
||||||
|
<span class="description"><?php echo wp_kses_post( $tool['desc'] ); ?></span>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
}
|
}
|
|
@ -44,38 +44,42 @@ function woocommerce_add_category_fields() {
|
||||||
if ( ! jQuery('#product_cat_thumbnail_id').val() )
|
if ( ! jQuery('#product_cat_thumbnail_id').val() )
|
||||||
jQuery('.remove_image_button').hide();
|
jQuery('.remove_image_button').hide();
|
||||||
|
|
||||||
window.send_to_editor_default = window.send_to_editor;
|
// Uploading files
|
||||||
|
var file_frame;
|
||||||
|
|
||||||
window.send_to_termmeta = function(html) {
|
jQuery(document).on( 'click', '.upload_image_button', function( event ){
|
||||||
|
|
||||||
jQuery('body').append('<div id="temp_image">' + html + '</div>');
|
event.preventDefault();
|
||||||
|
|
||||||
var img = jQuery('#temp_image').find('img');
|
// If the media frame already exists, reopen it.
|
||||||
|
if ( file_frame ) {
|
||||||
|
file_frame.open();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
imgurl = img.attr('src');
|
// Create the media frame.
|
||||||
imgclass = img.attr('class');
|
file_frame = wp.media.frames.downloadable_file = wp.media({
|
||||||
imgid = parseInt(imgclass.replace(/\D/g, ''), 10);
|
title: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',
|
||||||
|
button: {
|
||||||
|
text: '<?php _e( 'Use image', 'woocommerce' ); ?>',
|
||||||
|
},
|
||||||
|
multiple: false
|
||||||
|
});
|
||||||
|
|
||||||
jQuery('#product_cat_thumbnail_id').val(imgid);
|
// When an image is selected, run a callback.
|
||||||
jQuery('#product_cat_thumbnail img').attr('src', imgurl);
|
file_frame.on( 'select', function() {
|
||||||
jQuery('.remove_image_button').show();
|
attachment = file_frame.state().get('selection').first().toJSON();
|
||||||
jQuery('#temp_image').remove();
|
|
||||||
|
|
||||||
tb_remove();
|
jQuery('#product_cat_thumbnail_id').val( attachment.id );
|
||||||
|
jQuery('#product_cat_thumbnail img').attr('src', attachment.url );
|
||||||
|
jQuery('.remove_image_button').show();
|
||||||
|
});
|
||||||
|
|
||||||
window.send_to_editor = window.send_to_editor_default;
|
// Finally, open the modal.
|
||||||
}
|
file_frame.open();
|
||||||
|
|
||||||
jQuery('.upload_image_button').live('click', function(){
|
|
||||||
var post_id = 0;
|
|
||||||
|
|
||||||
window.send_to_editor = window.send_to_termmeta;
|
|
||||||
|
|
||||||
tb_show('', 'media-upload.php?post_id=' + post_id + '&type=image&TB_iframe=true');
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('.remove_image_button').live('click', function(){
|
jQuery(document).on( 'click', '.remove_image_button', function( event ){
|
||||||
jQuery('#product_cat_thumbnail img').attr('src', '<?php echo woocommerce_placeholder_img_src(); ?>');
|
jQuery('#product_cat_thumbnail img').attr('src', '<?php echo woocommerce_placeholder_img_src(); ?>');
|
||||||
jQuery('#product_cat_thumbnail_id').val('');
|
jQuery('#product_cat_thumbnail_id').val('');
|
||||||
jQuery('.remove_image_button').hide();
|
jQuery('.remove_image_button').hide();
|
||||||
|
@ -132,35 +136,45 @@ function woocommerce_edit_category_fields( $term, $taxonomy ) {
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
window.send_to_termmeta = function(html) {
|
// Uploading files
|
||||||
|
var file_frame;
|
||||||
|
|
||||||
jQuery('body').append('<div id="temp_image">' + html + '</div>');
|
jQuery(document).on( 'click', '.upload_image_button', function( event ){
|
||||||
|
|
||||||
var img = jQuery('#temp_image').find('img');
|
event.preventDefault();
|
||||||
|
|
||||||
imgurl = img.attr('src');
|
// If the media frame already exists, reopen it.
|
||||||
imgclass = img.attr('class');
|
if ( file_frame ) {
|
||||||
imgid = parseInt(imgclass.replace(/\D/g, ''), 10);
|
file_frame.open();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
jQuery('#product_cat_thumbnail_id').val(imgid);
|
// Create the media frame.
|
||||||
jQuery('#product_cat_thumbnail img').attr('src', imgurl);
|
file_frame = wp.media.frames.downloadable_file = wp.media({
|
||||||
jQuery('#temp_image').remove();
|
title: '<?php _e( 'Choose an image', 'woocommerce' ); ?>',
|
||||||
|
button: {
|
||||||
|
text: '<?php _e( 'Use image', 'woocommerce' ); ?>',
|
||||||
|
},
|
||||||
|
multiple: false
|
||||||
|
});
|
||||||
|
|
||||||
tb_remove();
|
// When an image is selected, run a callback.
|
||||||
}
|
file_frame.on( 'select', function() {
|
||||||
|
attachment = file_frame.state().get('selection').first().toJSON();
|
||||||
|
|
||||||
jQuery('.upload_image_button').live('click', function(){
|
jQuery('#product_cat_thumbnail_id').val( attachment.id );
|
||||||
var post_id = 0;
|
jQuery('#product_cat_thumbnail img').attr('src', attachment.url );
|
||||||
|
jQuery('.remove_image_button').show();
|
||||||
|
});
|
||||||
|
|
||||||
window.send_to_editor = window.send_to_termmeta;
|
// Finally, open the modal.
|
||||||
|
file_frame.open();
|
||||||
tb_show('', 'media-upload.php?post_id=' + post_id + '&type=image&TB_iframe=true');
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('.remove_image_button').live('click', function(){
|
jQuery(document).on( 'click', '.remove_image_button', function( event ){
|
||||||
jQuery('#product_cat_thumbnail img').attr('src', '<?php echo woocommerce_placeholder_img_src(); ?>');
|
jQuery('#product_cat_thumbnail img').attr('src', '<?php echo woocommerce_placeholder_img_src(); ?>');
|
||||||
jQuery('#product_cat_thumbnail_id').val('');
|
jQuery('#product_cat_thumbnail_id').val('');
|
||||||
|
jQuery('.remove_image_button').hide();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -189,6 +203,8 @@ function woocommerce_category_fields_save( $term_id, $tt_id, $taxonomy ) {
|
||||||
|
|
||||||
if ( isset( $_POST['product_cat_thumbnail_id'] ) )
|
if ( isset( $_POST['product_cat_thumbnail_id'] ) )
|
||||||
update_woocommerce_term_meta( $term_id, 'thumbnail_id', absint( $_POST['product_cat_thumbnail_id'] ) );
|
update_woocommerce_term_meta( $term_id, 'thumbnail_id', absint( $_POST['product_cat_thumbnail_id'] ) );
|
||||||
|
|
||||||
|
delete_transient( 'wc_term_counts' );
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'created_term', 'woocommerce_category_fields_save', 10,3 );
|
add_action( 'created_term', 'woocommerce_category_fields_save', 10,3 );
|
||||||
|
@ -328,7 +344,7 @@ add_filter( 'manage_product_cat_custom_column', 'woocommerce_product_cat_column'
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocommerce_shipping_class_columns( $columns ) {
|
function woocommerce_shipping_class_columns( $columns ) {
|
||||||
$columns['configure'] = ' ';
|
$columns['edit'] = ' ';
|
||||||
return $columns;
|
return $columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,8 +361,8 @@ add_filter( 'manage_edit-product_shipping_class_columns', 'woocommerce_shipping_
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function woocommerce_shipping_class_column( $columns, $column, $id ) {
|
function woocommerce_shipping_class_column( $columns, $column, $id ) {
|
||||||
if ( $column == 'configure' )
|
if ( $column == 'edit' )
|
||||||
$columns .= '<a href="'. admin_url( 'edit-tags.php?action=edit&taxonomy=product_shipping_class&tag_ID='. $id .'&post_type=product' ) .'" class="button alignright">'.__( 'Configure shipping class', 'woocommerce' ).'</a>';
|
$columns .= '<a href="'. admin_url( 'edit-tags.php?action=edit&taxonomy=product_shipping_class&tag_ID='. $id .'&post_type=product' ) .'" class="button alignright">'.__( 'Edit Class', 'woocommerce' ).'</a>';
|
||||||
|
|
||||||
return $columns;
|
return $columns;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,9 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
function do_update_woocommerce() {
|
function do_update_woocommerce() {
|
||||||
global $woocommerce;
|
global $woocommerce;
|
||||||
|
|
||||||
|
// Include installer so we have page creation functions
|
||||||
|
include_once( 'woocommerce-admin-install.php' );
|
||||||
|
|
||||||
// Do updates
|
// Do updates
|
||||||
$current_db_version = get_option( 'woocommerce_db_version' );
|
$current_db_version = get_option( 'woocommerce_db_version' );
|
||||||
|
|
||||||
|
|
|
@ -120,9 +120,9 @@ function woocommerce_user_column_values( $value, $column_name, $user_id ) {
|
||||||
$paying_customer = get_user_meta( $user_id, 'paying_customer', true );
|
$paying_customer = get_user_meta( $user_id, 'paying_customer', true );
|
||||||
|
|
||||||
if ( $paying_customer )
|
if ( $paying_customer )
|
||||||
$value = '<img src="' . $woocommerce->plugin_url() . '/assets/images/success.png" alt="yes" width="16px" />';
|
$value = '<img src="' . $woocommerce->plugin_url() . '/assets/images/success@2x.png" alt="yes" width="16px" />';
|
||||||
else
|
else
|
||||||
$value = '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off.png" alt="no" width="16px" />';
|
$value = '<img src="' . $woocommerce->plugin_url() . '/assets/images/success-off@2x.png" alt="no" width="16px" />';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
endswitch;
|
endswitch;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
.woocommerce-message{position:relative;z-index:100;border:1px solid #b76ca9!important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 15px rgba(0,0,0,0.04);-moz-box-shadow:inset 0 0 15px rgba(0,0,0,0.04);box-shadow:inset 0 0 15px rgba(0,0,0,0.04);overflow:hidden;padding:10px 0 10px!important;background:#cc99c2 url(../images/message.png) no-repeat right bottom!important}.woocommerce-message .squeezer{max-width:960px;margin:0;padding:0 10px;text-align:left;overflow:hidden}.woocommerce-message h4{margin:0 10px 0 0;font-size:18px;line-height:36px;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;font-weight:normal;color:#fff;text-shadow:0 1px 1px #b574a8;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;float:left;vertical-align:middle}.woocommerce-message p{margin:0!important;padding:2px 0!important;float:left!important;line-height:32px;vertical-align:middle}.woocommerce-message p a.button-primary{font-size:16px!important;line-height:16px!important;height:auto!important;margin:0 5px 0 0;padding:6px 15px;vertical-align:middle;color:#fff;text-align:center;text-decoration:none;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:1px solid #88537e;background:#a46497;-moz-box-shadow:inset 0 0 2px #fff,0 1px 1px rgba(0,0,0,0.1);-webkit-box-shadow:inset 0 0 2px #fff,0 1px 1px rgba(0,0,0,0.1);box-shadow:inset 0 0 2px #fff,0 1px 1px rgba(0,0,0,0.1);text-shadow:0 -1px 0 rgba(0,0,0,0.3);-webkit-transition-duration:.3s;-moz-transition-duration:.3s;cursor:pointer;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif}.woocommerce-message p a.button-primary:hover,.woocommerce-message p a.button-primary:active{background-color:#f0a000;border-color:#c87800;-webkit-transition-duration:.3s;outline:0;opacity:1}.woocommerce-message p a.skip,.woocommerce-message p a.docs{opacity:.5}.woocommerce-message .twitter-share-button{vertical-align:middle}
|
.woocommerce-message{position:relative;z-index:100;border:1px solid #b76ca9!important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 15px rgba(0,0,0,0.04);-moz-box-shadow:inset 0 0 15px rgba(0,0,0,0.04);box-shadow:inset 0 0 15px rgba(0,0,0,0.04);overflow:hidden;padding:10px 0 10px!important;background:#cc99c2 url(../images/message.png) no-repeat right bottom!important}.woocommerce-message .squeezer{max-width:960px;margin:0;padding:0 10px;text-align:left;overflow:hidden}.woocommerce-message h4{margin:5px 10px 5px 0;font-size:18px;line-height:27px;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;font-weight:normal;color:#fff;text-shadow:0 1px 1px #b574a8;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;float:left;vertical-align:middle}.woocommerce-message p{margin:5px 0!important;padding:1px 2px!important;float:left!important;line-height:27px;vertical-align:middle}.woocommerce-message .twitter-share-button{vertical-align:middle;margin-left:3px}p.woocommerce-actions a.button-primary,.woocommerce-message a.button-primary{font-size:14px!important;line-height:16px!important;height:auto!important;-webkit-border-radius:3px;border-radius:3px;margin:0 5px 0 0;padding:5px 12px;vertical-align:middle;color:#fff;text-align:center;text-decoration:none;border:1px solid #76456d;-webkit-transition:none;-moz-transition:none;cursor:pointer;outline:0;font-family:"Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;text-shadow:0 1px 0 rgba(0,0,0,0.3);background-color:#a46497;background-image:-webkit-gradient(linear,left top,left bottom,from(#a46497),to(#864f7b));background-image:-webkit-linear-gradient(top,#a46497,#864f7b);background-image:-moz-linear-gradient(top,#a46497,#864f7b);background-image:-ms-linear-gradient(top,#a46497,#864f7b);background-image:-o-linear-gradient(top,#a46497,#864f7b);background-image:linear-gradient(to bottom,#a46497,#864f7b);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 0 rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 0 rgba(0,0,0,0.1)}p.woocommerce-actions a.button-primary:hover,.woocommerce-message a.button-primary:hover{text-shadow:0 -1px 0 rgba(0,0,0,0.3);border:1px solid #76456d;background-color:#ad74a2;background-image:-webkit-gradient(linear,left top,left bottom,from(#ad74a2),to(#864f7b));background-image:-webkit-linear-gradient(top,#ad74a2,#864f7b);background-image:-moz-linear-gradient(top,#ad74a2,#864f7b);background-image:-ms-linear-gradient(top,#ad74a2,#864f7b);background-image:-o-linear-gradient(top,#ad74a2,#864f7b);background-image:linear-gradient(to bottom,#ad74a2,#864f7b);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 0 rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 0 rgba(0,0,0,0.1)}p.woocommerce-actions a.button-primary:active,.woocommerce-message a.button-primary:active{border:1px solid #76456d;text-shadow:0 1px 0 rgba(0,0,0,0.3);background-color:#864f7b;background-image:-webkit-gradient(linear,left top,left bottom,from(#864f7b),to(#864f7b));background-image:-webkit-linear-gradient(top,#864f7b,#a46497);background-image:-moz-linear-gradient(top,#864f7b,#a46497);background-image:-ms-linear-gradient(top,#864f7b,#a46497);background-image:-o-linear-gradient(top,#864f7b,#a46497);background-image:linear-gradient(to bottom,#a46497,#a46497);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.2);box-shadow:inset 0 1px 1px rgba(0,0,0,0.2)}p.woocommerce-actions a.skip,.woocommerce-message a.skip,p.woocommerce-actions a.docs,.woocommerce-message a.docs{opacity:.7}p.woocommerce-actions .twitter-share-button,.woocommerce-message .twitter-share-button{vertical-align:middle;margin-left:3px}p.woocommerce-actions{margin-bottom:2em}.woocommerce-about-text{margin-bottom:1em!important}
|
|
@ -19,9 +19,9 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
h4 {
|
h4 {
|
||||||
margin: 0 10px 0 0;
|
margin: 5px 10px 5px 0;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 36px;
|
line-height: 27px;
|
||||||
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -33,47 +33,94 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
margin: 0 !important;
|
margin: 5px 0 !important;
|
||||||
padding: 2px 0 !important;
|
padding: 1px 2px !important;
|
||||||
float: left !important;
|
float: left !important;
|
||||||
line-height: 32px;
|
line-height: 27px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
a.button-primary {
|
|
||||||
font-size: 16px !important;
|
|
||||||
line-height: 16px !important;
|
|
||||||
height: auto !important;
|
|
||||||
margin: 0 5px 0 0;
|
|
||||||
padding: 6px 15px;
|
|
||||||
vertical-align: middle;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
-moz-border-radius: 5px;
|
|
||||||
-webkit-border-radius: 5px;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: 1px solid #88537e;
|
|
||||||
background: #a46497;
|
|
||||||
-moz-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
|
||||||
-webkit-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
|
||||||
box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
|
||||||
text-shadow: 0px -1px 0px rgba( 0,0,0,0.3);
|
|
||||||
-webkit-transition-duration: .3s;
|
|
||||||
-moz-transition-duration: .3s;
|
|
||||||
cursor: pointer;
|
|
||||||
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
|
||||||
}
|
|
||||||
a.button-primary:hover, a.button-primary:active {
|
|
||||||
background-color: #f0a000;
|
|
||||||
border-color: #c87800;
|
|
||||||
-webkit-transition-duration: .3s;
|
|
||||||
outline: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
a.skip, a.docs {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.twitter-share-button {
|
.twitter-share-button {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
margin-left:3px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
p.woocommerce-actions, .woocommerce-message {
|
||||||
|
a.button-primary {
|
||||||
|
font-size: 14px !important;
|
||||||
|
line-height: 16px !important;
|
||||||
|
height: auto !important;
|
||||||
|
-webkit-border-radius:3px;
|
||||||
|
border-radius:3px;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
padding: 5px 12px;
|
||||||
|
vertical-align: middle;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 1px solid #76456d;
|
||||||
|
-webkit-transition:none;
|
||||||
|
-moz-transition:none;
|
||||||
|
cursor: pointer;
|
||||||
|
outline:none;
|
||||||
|
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
||||||
|
text-shadow: 0px 1px 0px rgba(0,0,0,0.3);
|
||||||
|
background-color: #a46497;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#a46497), to(#864f7b)); /* Saf4+, Chrome */
|
||||||
|
background-image: -webkit-linear-gradient(top, #a46497, #864f7b); /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||||
|
background-image: -moz-linear-gradient(top, #a46497, #864f7b); /* FF3.6+ */
|
||||||
|
background-image: -ms-linear-gradient(top, #a46497, #864f7b); /* IE10 */
|
||||||
|
background-image: -o-linear-gradient(top, #a46497, #864f7b); /* Opera 11.10+ */
|
||||||
|
background-image: linear-gradient(to bottom, #a46497, #864f7b);
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
a.button-primary:hover {
|
||||||
|
text-shadow: 0px -1px 0px rgba(0,0,0,0.3);
|
||||||
|
border: 1px solid #76456d;
|
||||||
|
background-color: #ad74a2;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#ad74a2), to(#864f7b)); /* Saf4+, Chrome */
|
||||||
|
background-image: -webkit-linear-gradient(top, #ad74a2, #864f7b); /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||||
|
background-image: -moz-linear-gradient(top, #ad74a2, #864f7b); /* FF3.6+ */
|
||||||
|
background-image: -ms-linear-gradient(top, #ad74a2, #864f7b); /* IE10 */
|
||||||
|
background-image: -o-linear-gradient(top, #ad74a2, #864f7b); /* Opera 11.10+ */
|
||||||
|
background-image: linear-gradient(to bottom, #ad74a2, #864f7b);
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
a.button-primary:active {
|
||||||
|
border: 1px solid #76456d;
|
||||||
|
text-shadow: 0px 1px 0px rgba(0,0,0,0.3);
|
||||||
|
background-color: #864f7b;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#864f7b), to(#864f7b)); /* Saf4+, Chrome */
|
||||||
|
background-image: -webkit-linear-gradient(top, #864f7b, #a46497); /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||||
|
background-image: -moz-linear-gradient(top, #864f7b, #a46497); /* FF3.6+ */
|
||||||
|
background-image: -ms-linear-gradient(top, #864f7b, #a46497); /* IE10 */
|
||||||
|
background-image: -o-linear-gradient(top, #864f7b, #a46497); /* Opera 11.10+ */
|
||||||
|
background-image: linear-gradient(to bottom, #a46497, #a46497);
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 1px 1px rgba(0,0,0,0.2);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 1px rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
a.skip, a.docs {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
.twitter-share-button {
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-left:3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p.woocommerce-actions {
|
||||||
|
margin-bottom: 2em;
|
||||||
|
}
|
||||||
|
.woocommerce-about-text {
|
||||||
|
margin-bottom: 1em !important;
|
||||||
}
|
}
|
|
@ -19,9 +19,9 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
h4 {
|
h4 {
|
||||||
margin: 0 10px 0 0;
|
margin: 5px 10px 5px 0;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 36px;
|
line-height: 27px;
|
||||||
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -33,40 +33,75 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
margin: 0 !important;
|
margin: 5px 0 !important;
|
||||||
padding: 2px 0 !important;
|
padding: 1px 2px !important;
|
||||||
float: left !important;
|
float: left !important;
|
||||||
line-height: 32px;
|
line-height: 27px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
a.button-primary {
|
a.button-primary {
|
||||||
font-size: 16px !important;
|
font-size: 14px !important;
|
||||||
line-height: 16px !important;
|
line-height: 16px !important;
|
||||||
|
height: auto !important;
|
||||||
|
-webkit-border-radius:3px;
|
||||||
|
border-radius:3px;
|
||||||
margin: 0 5px 0 0;
|
margin: 0 5px 0 0;
|
||||||
padding: 6px 15px;
|
padding: 5px 12px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
-moz-border-radius: 5px;
|
border: 1px solid #76456d;
|
||||||
-webkit-border-radius: 5px;
|
-webkit-transition:none;
|
||||||
border-radius: 5px;
|
-moz-transition:none;
|
||||||
border: 1px solid #88537e;
|
|
||||||
background: #a46497;
|
|
||||||
-moz-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
|
||||||
-webkit-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
|
||||||
box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 );
|
|
||||||
text-shadow: 0px -1px 0px rgba( 0,0,0,0.3);
|
|
||||||
-webkit-transition-duration: .3s;
|
|
||||||
-moz-transition-duration: .3s;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
outline:none;
|
||||||
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
|
||||||
|
text-shadow: 0px 1px 0px rgba(0,0,0,0.3);
|
||||||
|
background-color: #a46497;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#a46497), to(#864f7b)); /* Saf4+, Chrome */
|
||||||
|
background-image: -webkit-linear-gradient(top, #a46497, #864f7b); /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||||
|
background-image: -moz-linear-gradient(top, #a46497, #864f7b); /* FF3.6+ */
|
||||||
|
background-image: -ms-linear-gradient(top, #a46497, #864f7b); /* IE10 */
|
||||||
|
background-image: -o-linear-gradient(top, #a46497, #864f7b); /* Opera 11.10+ */
|
||||||
|
background-image: linear-gradient(to bottom, #a46497, #864f7b);
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
a.button-primary:hover, a.button-primary:active {
|
a.button-primary:hover {
|
||||||
background-color: #f0a000;
|
text-shadow: 0px -1px 0px rgba(0,0,0,0.3);
|
||||||
border-color: #c87800;
|
border: 1px solid #76456d;
|
||||||
-webkit-transition-duration: .3s;
|
background-color: #ad74a2;
|
||||||
outline: none;
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#ad74a2), to(#864f7b)); /* Saf4+, Chrome */
|
||||||
opacity: 1;
|
background-image: -webkit-linear-gradient(top, #ad74a2, #864f7b); /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||||
|
background-image: -moz-linear-gradient(top, #ad74a2, #864f7b); /* FF3.6+ */
|
||||||
|
background-image: -ms-linear-gradient(top, #ad74a2, #864f7b); /* IE10 */
|
||||||
|
background-image: -o-linear-gradient(top, #ad74a2, #864f7b); /* Opera 11.10+ */
|
||||||
|
background-image: linear-gradient(to bottom, #ad74a2, #864f7b);
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.2),
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
a.button-primary:active {
|
||||||
|
border: 1px solid #76456d;
|
||||||
|
text-shadow: 0px 1px 0px rgba(0,0,0,0.3);
|
||||||
|
background-color: #864f7b;
|
||||||
|
background-image: -webkit-gradient(linear, left top, left bottom, from(#864f7b), to(#864f7b)); /* Saf4+, Chrome */
|
||||||
|
background-image: -webkit-linear-gradient(top, #864f7b, #a46497); /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||||
|
background-image: -moz-linear-gradient(top, #864f7b, #a46497); /* FF3.6+ */
|
||||||
|
background-image: -ms-linear-gradient(top, #864f7b, #a46497); /* IE10 */
|
||||||
|
background-image: -o-linear-gradient(top, #864f7b, #a46497); /* Opera 11.10+ */
|
||||||
|
background-image: linear-gradient(to bottom, #a46497, #a46497);
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 1px 1px rgba(0,0,0,0.2);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 1px 1px rgba(0,0,0,0.2);
|
||||||
}
|
}
|
||||||
a.skip, a.docs {
|
a.skip, a.docs {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
@ -112,17 +147,6 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media
|
|
||||||
(-webkit-min-device-pixel-ratio: 2),
|
|
||||||
(min-resolution: 192dpi) {
|
|
||||||
#woocommerce_extensions {
|
|
||||||
background-image: url(../images/icons/wc_icon@2x.png);
|
|
||||||
background-size: 16px 17px;
|
|
||||||
background-position: 6px 6px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#wc_get_started { position: relative; margin: 1em 0 2em; padding: 15px 15px 15px 90px; border: 1px solid #d9d9d9; background: #f5f5f5 url(../images/gear.png) no-repeat 15px 15px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; -moz-box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; -webkit-box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; }
|
#wc_get_started { position: relative; margin: 1em 0 2em; padding: 15px 15px 15px 90px; border: 1px solid #d9d9d9; background: #f5f5f5 url(../images/gear.png) no-repeat 15px 15px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; -moz-box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; -webkit-box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #fff; }
|
||||||
#wc_get_started span { display: block; text-shadow: 1px 1px 0 #fff; font-size: 14px; line-height: 22px; color: #595959; }
|
#wc_get_started span { display: block; text-shadow: 1px 1px 0 #fff; font-size: 14px; line-height: 22px; color: #595959; }
|
||||||
#wc_get_started span.main { margin-top: 2px; font-weight: bold; font-size: 16px; }
|
#wc_get_started span.main { margin-top: 2px; font-weight: bold; font-size: 16px; }
|
||||||
|
@ -141,16 +165,6 @@
|
||||||
background-position: -11px -5px;
|
background-position: -11px -5px;
|
||||||
background-size: auto !important;
|
background-size: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media
|
|
||||||
(-webkit-min-device-pixel-ratio: 2),
|
|
||||||
(min-resolution: 192dpi) {
|
|
||||||
#icon-woocommerce, .woocommerce_icon, .icon32-posts-product, .icon32-posts-shop_order, .icon32-posts-shop_coupon, .icon32-posts-product_variation {
|
|
||||||
background-image: url(../images/icons/woocommerce-icons-x2.png) !important;
|
|
||||||
background-size: 986px 91px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon32-posts-product {
|
.icon32-posts-product {
|
||||||
background-position: -69px -5px !important;
|
background-position: -69px -5px !important;
|
||||||
}
|
}
|
||||||
|
@ -213,11 +227,17 @@ mark.amount {
|
||||||
|
|
||||||
/* Status page */
|
/* Status page */
|
||||||
table.wc_status_table {
|
table.wc_status_table {
|
||||||
|
font-family: monospace;
|
||||||
th {
|
th {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
td:first-child {
|
||||||
|
width: 20%;
|
||||||
|
}
|
||||||
td {
|
td {
|
||||||
padding: 5px 7px;
|
padding: 6px 9px;
|
||||||
|
font-size: 1.1em;
|
||||||
|
|
||||||
mark {
|
mark {
|
||||||
background: transparent none;
|
background: transparent none;
|
||||||
}
|
}
|
||||||
|
@ -439,6 +459,20 @@ ul.wc_coupon_list_block {
|
||||||
|
|
||||||
|
|
||||||
/* Orders */
|
/* Orders */
|
||||||
|
.button.wc-reload {
|
||||||
|
padding:0;
|
||||||
|
-webkit-border-radius:100%;
|
||||||
|
border-radius:100%;
|
||||||
|
span {
|
||||||
|
display: block;
|
||||||
|
text-indent: -999em;
|
||||||
|
background-image:url(../images/icons/reload.png);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center center;
|
||||||
|
width:22px;
|
||||||
|
height:22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.tablenav .actions {
|
.tablenav .actions {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
@ -446,14 +480,48 @@ ul.wc_coupon_list_block {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
#woocommerce-order-data {
|
||||||
|
h3.hndle, .handlediv {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.inside {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
#order_data {
|
#order_data {
|
||||||
padding: 0 10px 9px;
|
padding: 23px 24px 12px 24px;
|
||||||
.order_data_left {
|
h2 {
|
||||||
width: 48%;
|
margin: 0;
|
||||||
|
font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
|
||||||
|
font-size: 21px;
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 1.2;
|
||||||
|
text-shadow: 1px 1px 1px white;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
h4 {
|
||||||
|
color: #333;
|
||||||
|
margin: 1.33em 0 0;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
p.order_number {
|
||||||
|
margin: 0;
|
||||||
|
font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 1.6em;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.order_data_column_container {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
.order_data_column {
|
||||||
|
width: 32%;
|
||||||
|
padding: 0 2% 0 0;
|
||||||
float: left;
|
float: left;
|
||||||
h2 {
|
&:last-child {
|
||||||
margin-top: 11px;
|
padding-right: 0;
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
|
@ -487,6 +555,11 @@ ul.wc_coupon_list_block {
|
||||||
.hour, .minute {
|
.hour, .minute {
|
||||||
width: 2.5em;
|
width: 2.5em;
|
||||||
}
|
}
|
||||||
|
small {
|
||||||
|
display: block;
|
||||||
|
margin: 5px 0 0 0;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.form-field.last {
|
.form-field.last {
|
||||||
float: right;
|
float: right;
|
||||||
|
@ -501,48 +574,20 @@ ul.wc_coupon_list_block {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.order_data_right {
|
|
||||||
width: 48%;
|
|
||||||
float: right;
|
|
||||||
.order_data {
|
|
||||||
overflow: hidden;
|
|
||||||
zoom: 1;
|
|
||||||
width: 49%;
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
.order_data_alt {
|
|
||||||
float:right;
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
margin-top: 11px;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
p.none_set {
|
p.none_set {
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
.form-field {
|
._billing_first_name_field, ._billing_address_1_field, ._billing_city_field, ._billing_country_field, ._billing_email_field,
|
||||||
|
._shipping_first_name_field, ._shipping_address_1_field, ._shipping_city_field, ._shipping_country_field {
|
||||||
float: left;
|
float: left;
|
||||||
width: 50%;
|
}
|
||||||
padding: 0;
|
._billing_last_name_field, ._billing_address_2_field, ._billing_postcode_field, ._billing_state_field, ._billing_phone_field,
|
||||||
margin: 9px 0 0 0;
|
._shipping_last_name_field, ._shipping_address_2_field, ._shipping_postcode_field, ._shipping_state_field {
|
||||||
label {
|
float: right;
|
||||||
display: block;
|
|
||||||
padding: 0 0 3px;
|
|
||||||
}
|
|
||||||
input, select {
|
|
||||||
width: 95%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
._billing_company_field, ._shipping_company_field {
|
._billing_company_field, ._shipping_company_field {
|
||||||
clear: both;
|
clear: both;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
input {
|
|
||||||
width: 97.5%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
._billing_email_field {
|
._billing_email_field {
|
||||||
clear: left
|
clear: left
|
||||||
|
@ -551,6 +596,7 @@ ul.wc_coupon_list_block {
|
||||||
display: none;
|
display: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
zoom: 1;
|
zoom: 1;
|
||||||
|
padding-right: 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -592,14 +638,14 @@ ul.wc_coupon_list_block {
|
||||||
&#actions {
|
&#actions {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.button {
|
.button {
|
||||||
width: 25%;
|
width: 24px;
|
||||||
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
||||||
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
||||||
box-sizing: border-box; /* Opera/IE 8+ */
|
box-sizing: border-box; /* Opera/IE 8+ */
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
width: 70%;
|
width: 225px;
|
||||||
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
||||||
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
||||||
box-sizing: border-box; /* Opera/IE 8+ */
|
box-sizing: border-box; /* Opera/IE 8+ */
|
||||||
|
@ -868,6 +914,7 @@ ul.wc_coupon_list_block {
|
||||||
}
|
}
|
||||||
.woocommerce_order_items_wrapper {
|
.woocommerce_order_items_wrapper {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
overflow: auto;
|
||||||
table.woocommerce_order_items {
|
table.woocommerce_order_items {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
@ -899,10 +946,6 @@ ul.wc_coupon_list_block {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
width: 1%;
|
width: 1%;
|
||||||
}
|
}
|
||||||
tr.refunded {
|
|
||||||
background: url( data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAO0lEQVQYV2NkIAIwElLz5s2b/3gVgRSIiIgwEjQJZBNWRTATYE7BUISuAKdJ6J6Bm4TNBBTr8CkAKQQAdWEXzZ0t/moAAAAASUVORK5CYII= ) repeat;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.item {
|
.item {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
}
|
}
|
||||||
|
@ -920,7 +963,7 @@ ul.wc_coupon_list_block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
input {
|
input {
|
||||||
width: 60px;
|
width: 70px;
|
||||||
vertical-align:middle;
|
vertical-align:middle;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
@ -954,7 +997,7 @@ ul.wc_coupon_list_block {
|
||||||
padding: 1px 4px 1px 0;
|
padding: 1px 4px 1px 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
input {
|
input {
|
||||||
min-width: 100px;
|
min-width: 50px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -979,14 +1022,6 @@ ul.wc_coupon_list_block {
|
||||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAARklEQVQYGWP8//8/AzGACV3Rnj17/oMwujiGQnQFMD7RChlBbsRmFcwkEO3i4sJImonIumGmg0xBFifaRKIVgj2DbAUuNgCfThpracSKqwAAAABJRU5ErkJggg==) no-repeat center;
|
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAARklEQVQYGWP8//8/AzGACV3Rnj17/oMwujiGQnQFMD7RChlBbsRmFcwkEO3i4sJImonIumGmg0xBFifaRKIVgj2DbAUuNgCfThpracSKqwAAAABJRU5ErkJggg==) no-repeat center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tr.refunded {
|
|
||||||
.thumb {
|
|
||||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAS0lEQVQYV42QUQoAIAhD83A7tYcrCiZLsPRL3XOiNiTcfWoNwFhHkiEChA+oEIXcsx8UqwlWTtTDcYMv90vMB+hg/xi6tN5TwfrwBffKRMurJBdPAAAAAElFTkSuQmCC) no-repeat center;
|
|
||||||
* {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1004,9 +1039,12 @@ ul.wc_coupon_list_block {
|
||||||
float:left;
|
float:left;
|
||||||
margin: 0 4px 2px 0;
|
margin: 0 4px 2px 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding:3px 6px;
|
padding:3px 4px;
|
||||||
|
height:auto;
|
||||||
img {
|
img {
|
||||||
display: block;
|
display: block;
|
||||||
|
width:12px;
|
||||||
|
height:auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1020,47 +1058,51 @@ ul.wc_coupon_list_block {
|
||||||
width:9%;
|
width:9%;
|
||||||
}
|
}
|
||||||
.column-order_status {
|
.column-order_status {
|
||||||
width:75px;
|
width:45px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
mark {
|
mark {
|
||||||
display:block;
|
display:block;
|
||||||
text-align: center;
|
height:18px;
|
||||||
white-space: nowrap;
|
width:18px;
|
||||||
padding: 0 2px;
|
text-indent: -999em;
|
||||||
|
margin:0 auto;
|
||||||
background: #999;
|
background: #bbb;
|
||||||
font-size:11px;
|
background-repeat: no-repeat;
|
||||||
line-height: 1.75;
|
background-position: center;
|
||||||
-webkit-border-radius:3px;
|
-webkit-border-radius:100%;
|
||||||
-moz-border-radius:3px;
|
border-radius:100%;
|
||||||
-o-border-radius:3px;
|
|
||||||
border-radius:3px;
|
|
||||||
margin: 0;
|
|
||||||
color:#fff;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
mark.pending {
|
mark.pending {
|
||||||
|
background-image:url(../images/icons/pending.png);
|
||||||
background-color: #999;
|
background-color: #999;
|
||||||
}
|
}
|
||||||
mark.completed {
|
mark.completed {
|
||||||
background-color: #a0658b;
|
background-image:url(../images/icons/completed.png);
|
||||||
|
background-color: #21759b;
|
||||||
}
|
}
|
||||||
mark.on-hold {
|
mark.on-hold {
|
||||||
background-color: #E66F00;
|
background-image:url(../images/icons/on-hold.png);
|
||||||
|
background-color: #de9e0c;
|
||||||
}
|
}
|
||||||
mark.failed {
|
mark.failed {
|
||||||
background-color: red;
|
background-image:url(../images/icons/failed.png);
|
||||||
|
background-color: #e6db55;
|
||||||
}
|
}
|
||||||
mark.cancelled {
|
mark.cancelled {
|
||||||
background-color: #ccc;
|
background-image:url(../images/icons/cancelled.png);
|
||||||
|
background-color: #d54e21;
|
||||||
}
|
}
|
||||||
mark.processing {
|
mark.processing {
|
||||||
background-color: #2184c2;
|
background-image:url(../images/icons/st-processing.png);
|
||||||
|
background-color: #73a724;
|
||||||
}
|
}
|
||||||
mark.refunded {
|
mark.refunded {
|
||||||
background-color: #ccc;
|
background-image:url(../images/icons/refunded.png);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
td.column-order_status {
|
||||||
|
padding-top:10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Order notes */
|
/* Order notes */
|
||||||
|
@ -1126,6 +1168,9 @@ table.wp-list-table {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
white-space: nowrap
|
white-space: nowrap
|
||||||
}
|
}
|
||||||
|
.column-name {
|
||||||
|
width:22%;
|
||||||
|
}
|
||||||
.column-product_cat, .column-product_tag {
|
.column-product_cat, .column-product_tag {
|
||||||
width: 11% !important;
|
width: 11% !important;
|
||||||
}
|
}
|
||||||
|
@ -1161,13 +1206,13 @@ table.wp-list-table {
|
||||||
img {
|
img {
|
||||||
margin: 1px 2px;
|
margin: 1px 2px;
|
||||||
}
|
}
|
||||||
.column-thumb img {
|
td.column-thumb img {
|
||||||
padding: 2px;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: 1px solid #dfdfdf;
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
width: 32px;
|
width: auto;
|
||||||
height: 32px;
|
height: auto;
|
||||||
|
max-width: 40px;
|
||||||
|
max-height: 40px;
|
||||||
}
|
}
|
||||||
span.na {
|
span.na {
|
||||||
color: #999;
|
color: #999;
|
||||||
|
@ -1175,14 +1220,6 @@ table.wp-list-table {
|
||||||
.column-is_in_stock {
|
.column-is_in_stock {
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
}
|
}
|
||||||
@media
|
|
||||||
(-webkit-min-device-pixel-ratio: 2),
|
|
||||||
(min-resolution: 192dpi) {
|
|
||||||
span.product-type {
|
|
||||||
background-image: url(../images/product_types-x2.png) !important;
|
|
||||||
background-size:96px 16px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
span.product-type {
|
span.product-type {
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
@ -1402,16 +1439,39 @@ ul.recent-orders, ul.stock_list {
|
||||||
}
|
}
|
||||||
.star-rating {
|
.star-rating {
|
||||||
float: right;
|
float: right;
|
||||||
width: 50px;
|
overflow: hidden;
|
||||||
height: 10px;
|
position: relative;
|
||||||
margin: 3px 0 0 0;
|
height: 1.5em;
|
||||||
background: url(../images/admin-star.png) repeat-x left -10px;
|
line-height: 1.5;
|
||||||
|
margin-left:.5em;
|
||||||
|
width: 5.4em;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
|
||||||
|
&:before {
|
||||||
|
content: "\2605\2605\2605\2605\2605";
|
||||||
|
color: darken( #ccc, 10 );
|
||||||
|
float: left;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
letter-spacing:0\9; // IE8 & below hack ;-(
|
||||||
|
}
|
||||||
span {
|
span {
|
||||||
background: url(../images/admin-star.png) repeat-x left 0;
|
|
||||||
height: 0;
|
|
||||||
padding-top: 10px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
float: left;
|
float: left;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
padding-top: 1.5em;
|
||||||
|
}
|
||||||
|
span:before {
|
||||||
|
content: "\2605\2605\2605\2605\2605";
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
letter-spacing:0\9; // IE8 & below hack ;-(
|
||||||
|
color: #9c5d90;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1470,10 +1530,20 @@ table.wc_tax_rates {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
td.sort {
|
td.sort {
|
||||||
width: 16px;
|
padding-left: 2em;
|
||||||
padding: 0;
|
|
||||||
cursor: move;
|
cursor: move;
|
||||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAHUlEQVQYV2O8f//+fwY8gJGgAny6QXKETRgEVgAAXxAVsa5Xr3QAAAAASUVORK5CYII=) no-repeat center;
|
position: relative;
|
||||||
|
background: #f9f9f9;
|
||||||
|
&:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0.75em;
|
||||||
|
left: 0.5em;
|
||||||
|
width: 1em;
|
||||||
|
height: 0.125em;
|
||||||
|
border-top: 0.375em double #777;
|
||||||
|
border-bottom: 0.125em solid #777;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.button {
|
.button {
|
||||||
float: left;
|
float: left;
|
||||||
|
@ -1563,14 +1633,20 @@ img.help_tip {
|
||||||
padding-right: 24px;
|
padding-right: 24px;
|
||||||
}
|
}
|
||||||
th img.help_tip {
|
th img.help_tip {
|
||||||
position: absolute;
|
margin: 0 -24px 0 0;
|
||||||
right: 0;
|
float: right;
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
fieldset {
|
fieldset {
|
||||||
|
margin-top: 4px;
|
||||||
img.help_tip {
|
img.help_tip {
|
||||||
margin: -3px 0 0 5px;
|
margin: -3px 0 0 5px;
|
||||||
}
|
}
|
||||||
|
p.description {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
&:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.color_box {
|
.color_box {
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
@ -1637,12 +1713,21 @@ img.help_tip {
|
||||||
#product_variation-parent #parent_id {
|
#product_variation-parent #parent_id {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
#postimagediv {
|
||||||
|
img {
|
||||||
|
border: 1px solid #d5d5d5;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
#woocommerce-product-images {
|
#woocommerce-product-images {
|
||||||
.inside {
|
.inside {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
.add_product_images {
|
||||||
|
padding: 0 9px;
|
||||||
|
}
|
||||||
#product_images_container {
|
#product_images_container {
|
||||||
padding: 9px 0 0 9px;
|
padding: 0 0 0 9px;
|
||||||
ul {
|
ul {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -1654,7 +1739,7 @@ img.help_tip {
|
||||||
float: left;
|
float: left;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
border: 1px solid #d5d5d5;
|
border: 1px solid #d5d5d5;
|
||||||
margin: 0 9px 9px 0;
|
margin: 9px 9px 0 0;
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
-webkit-border-radius: 2px;
|
-webkit-border-radius: 2px;
|
||||||
-moz-border-radius: 2px;
|
-moz-border-radius: 2px;
|
||||||
|
@ -1668,41 +1753,11 @@ img.help_tip {
|
||||||
height: auto;
|
height: auto;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.loading {
|
|
||||||
background: #fff url(../images/ajax-loader.gif) no-repeat center;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
opacity: 0.5;
|
|
||||||
position: absolute;
|
|
||||||
display: none;
|
|
||||||
top:0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
li.excluded {
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
li.loading {
|
|
||||||
.loading {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
li.image:first-child {
|
|
||||||
margin: 0 0 9px 0;
|
|
||||||
width: 258px;
|
|
||||||
height: auto;
|
|
||||||
overflow: visible;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
}
|
||||||
li.wc-metabox-sortable-placeholder {
|
li.wc-metabox-sortable-placeholder {
|
||||||
border: 4px dashed #dddddd;
|
border: 4px dashed #dddddd;
|
||||||
background: #f7f7f7 url(../images/image_watermark.png) no-repeat center;
|
background: #f7f7f7 url(../images/image_watermark.png) no-repeat center;
|
||||||
}
|
}
|
||||||
li.wc-metabox-sortable-placeholder:first-child {
|
|
||||||
background: #f7f7f7 url(../images/star_watermark.png) no-repeat center;
|
|
||||||
width: 258px;
|
|
||||||
height: 258px;
|
|
||||||
}
|
|
||||||
ul.actions {
|
ul.actions {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top:0;
|
top:0;
|
||||||
|
@ -1739,36 +1794,6 @@ img.help_tip {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#plupload-upload-ui {
|
|
||||||
text-align: center;
|
|
||||||
color: #999;
|
|
||||||
background: none;
|
|
||||||
cursor: default !important;
|
|
||||||
border: 0;
|
|
||||||
width: 258px;
|
|
||||||
height: auto;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 0 9px 9px;
|
|
||||||
#drag-drop-area {
|
|
||||||
padding: 20px 0;
|
|
||||||
height: auto;
|
|
||||||
-webkit-border-radius: 2px;
|
|
||||||
-moz-border-radius: 2px;
|
|
||||||
border-radius: 2px;
|
|
||||||
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
|
||||||
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
|
||||||
box-sizing: border-box; /* Opera/IE 8+ */
|
|
||||||
line-height: 1.4em;
|
|
||||||
p {
|
|
||||||
color: #AAA;
|
|
||||||
font-size: 14px;
|
|
||||||
margin: 5px 0;
|
|
||||||
}
|
|
||||||
p.drag-drop-info {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#woocommerce-product-data {
|
#woocommerce-product-data {
|
||||||
|
@ -1829,21 +1854,6 @@ img.help_tip {
|
||||||
border-right: 1px solid #DFDFDF;
|
border-right: 1px solid #DFDFDF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media
|
|
||||||
(-webkit-min-device-pixel-ratio: 2),
|
|
||||||
(min-resolution: 192dpi) {
|
|
||||||
#woocommerce-product-data ul.product_data_tabs li {
|
|
||||||
&.general_options, &.tax_options, &.inventory_options, &.shipping_options, &.linked_product_options, &.attribute_options, &.variation_options, &.advanced_options {
|
|
||||||
a {
|
|
||||||
background-image: url(../images/icons/wc-tab-icons-x2.png) !important;
|
|
||||||
background-size: 17px 720px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#woocommerce-product-data ul.product_data_tabs, .woocommerce ul.wc-tabs {
|
#woocommerce-product-data ul.product_data_tabs, .woocommerce ul.wc-tabs {
|
||||||
background: #f1f1f1;
|
background: #f1f1f1;
|
||||||
line-height: 1em;
|
line-height: 1em;
|
||||||
|
@ -2105,7 +2115,10 @@ img.help_tip {
|
||||||
}
|
}
|
||||||
.upload_file_button {
|
.upload_file_button {
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
background: #fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAQ0lEQVQYV3WPUQoAMAhC1+E6tYdrFBgiW185X7biSAGolpkZfN6GJg1CA7ip0CYo+FzxBTqeE/7J1qGAXsTEAdxQfQHJTymZe4oqiAAAAABJRU5ErkJggg==) no-repeat 8px 5px;
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAQ0lEQVQYV3WPUQoAMAhC1+E6tYdrFBgiW185X7biSAGolpkZfN6GJg1CA7ip0CYo+FzxBTqeE/7J1qGAXsTEAdxQfQHJTymZe4oqiAAAAABJRU5ErkJggg==) !important;
|
||||||
|
background-color: #FEFEFE !important;
|
||||||
|
background-repeat: no-repeat !important;
|
||||||
|
background-position: 8px 7px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#woocommerce-product-data input.dp-applied {
|
#woocommerce-product-data input.dp-applied {
|
||||||
|
@ -2221,6 +2234,11 @@ img.help_tip {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
color: #555;
|
color: #555;
|
||||||
}
|
}
|
||||||
|
.upload_file_button {
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 3px 8px 3px 20px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
select, .chzn-container {
|
select, .chzn-container {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
@ -2337,7 +2355,7 @@ img.help_tip {
|
||||||
}
|
}
|
||||||
&.data {
|
&.data {
|
||||||
padding: 0 0 0 12px;
|
padding: 0 0 0 12px;
|
||||||
table {
|
table.data_table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0 12px 6px 12px;
|
padding: 0 12px 6px 12px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
@ -2356,7 +2374,7 @@ img.help_tip {
|
||||||
box-sizing: border-box; /* Opera/IE 8+ */
|
box-sizing: border-box; /* Opera/IE 8+ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
table:before {
|
table.data_table:before {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -2366,7 +2384,7 @@ img.help_tip {
|
||||||
border: 7px solid #dfdfdf;
|
border: 7px solid #dfdfdf;
|
||||||
border-color: transparent transparent transparent #dfdfdf;
|
border-color: transparent transparent transparent #dfdfdf;
|
||||||
}
|
}
|
||||||
table:after {
|
table.data_table:after {
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -2423,7 +2441,10 @@ img.help_tip {
|
||||||
width: auto;
|
width: auto;
|
||||||
margin: 5px 0 0 0;
|
margin: 5px 0 0 0;
|
||||||
padding: 3px 8px 3px 20px;
|
padding: 3px 8px 3px 20px;
|
||||||
background: #fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAQ0lEQVQYV3WPUQoAMAhC1+E6tYdrFBgiW185X7biSAGolpkZfN6GJg1CA7ip0CYo+FzxBTqeE/7J1qGAXsTEAdxQfQHJTymZe4oqiAAAAABJRU5ErkJggg==) no-repeat 8px 5px;
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAQ0lEQVQYV3WPUQoAMAhC1+E6tYdrFBgiW185X7biSAGolpkZfN6GJg1CA7ip0CYo+FzxBTqeE/7J1qGAXsTEAdxQfQHJTymZe4oqiAAAAABJRU5ErkJggg==) !important;
|
||||||
|
background-color: #FEFEFE !important;
|
||||||
|
background-repeat: no-repeat !important;
|
||||||
|
background-position: 8px 7px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2446,31 +2467,6 @@ img.help_tip {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media
|
|
||||||
(-webkit-min-device-pixel-ratio: 2),
|
|
||||||
(min-resolution: 192dpi) {
|
|
||||||
.wc-metaboxes-wrapper {
|
|
||||||
a.plus, a.minus, .expand_all, .close_all {
|
|
||||||
background-image: url(../images/icons/edit_variations@2x.png) !important;
|
|
||||||
background-size: 21px 165px;
|
|
||||||
&:hover {
|
|
||||||
background-size: 21px 165px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#variable_product_options {
|
|
||||||
p.toolbar {
|
|
||||||
a.set, a.toggle, a.delete_variations {
|
|
||||||
background-image: url(../images/icons/edit_variations@2x.png) !important;
|
|
||||||
background-size: 21px 165px;
|
|
||||||
&:hover {
|
|
||||||
background-size: 21px 165px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tooltips */
|
/* Tooltips */
|
||||||
.tips {
|
.tips {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
|
@ -2574,7 +2570,7 @@ img.ui-datepicker-trigger { vertical-align: middle; margin-top: -1px; cursor: po
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.chart {
|
.chart {
|
||||||
padding: 16px;
|
padding: 16px 16px 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.woocommerce-reports-main {
|
.woocommerce-reports-main {
|
||||||
|
@ -2743,5 +2739,86 @@ table.bar_chart {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// HiDPI optimisation
|
||||||
|
@media
|
||||||
|
(-webkit-min-device-pixel-ratio: 2),
|
||||||
|
(min-resolution: 192dpi) {
|
||||||
|
#icon-woocommerce, .woocommerce_icon, .icon32-posts-product, .icon32-posts-shop_order, .icon32-posts-shop_coupon, .icon32-posts-product_variation {
|
||||||
|
background-image: url(../images/icons/woocommerce-icons-x2.png) !important;
|
||||||
|
background-size: 986px 91px !important;
|
||||||
|
}
|
||||||
|
#woocommerce_extensions {
|
||||||
|
background-image: url(../images/icons/wc_icon@2x.png);
|
||||||
|
background-size: 16px 17px;
|
||||||
|
background-position: 6px 6px;
|
||||||
|
}
|
||||||
|
table.wp-list-table span.product-type {
|
||||||
|
background-image: url(../images/product_types-x2.png) !important;
|
||||||
|
background-size:96px 16px !important;
|
||||||
|
}
|
||||||
|
#woocommerce-product-data ul.product_data_tabs li {
|
||||||
|
&.general_options, &.tax_options, &.inventory_options, &.shipping_options, &.linked_product_options, &.attribute_options, &.variation_options, &.advanced_options {
|
||||||
|
a {
|
||||||
|
background-image: url(../images/icons/wc-tab-icons-x2.png) !important;
|
||||||
|
background-size: 17px 720px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wc-metaboxes-wrapper {
|
||||||
|
a.plus, a.minus, .expand_all, .close_all {
|
||||||
|
background-image: url(../images/icons/edit_variations@2x.png) !important;
|
||||||
|
background-size: 21px 165px;
|
||||||
|
&:hover {
|
||||||
|
background-size: 21px 165px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#variable_product_options {
|
||||||
|
p.toolbar {
|
||||||
|
a.set, a.toggle, a.delete_variations {
|
||||||
|
background-image: url(../images/icons/edit_variations@2x.png) !important;
|
||||||
|
background-size: 21px 165px;
|
||||||
|
&:hover {
|
||||||
|
background-size: 21px 165px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.widefat {
|
||||||
|
.column-order_status {
|
||||||
|
mark.pending {
|
||||||
|
background-image:url(../images/icons/pending@2x.png);
|
||||||
|
background-size: 10px 8px;
|
||||||
|
}
|
||||||
|
mark.completed {
|
||||||
|
background-image:url(../images/icons/completed@2x.png);
|
||||||
|
background-size: 10px 8px;
|
||||||
|
}
|
||||||
|
mark.on-hold {
|
||||||
|
background-image:url(../images/icons/on-hold@2x.png);
|
||||||
|
background-size: 10px 10px;
|
||||||
|
}
|
||||||
|
mark.failed {
|
||||||
|
background-image:url(../images/icons/failed@2x.png);
|
||||||
|
background-size: 10px 8px;
|
||||||
|
}
|
||||||
|
mark.cancelled {
|
||||||
|
background-image:url(../images/icons/cancelled@2x.png);
|
||||||
|
background-size: 10px 8px;
|
||||||
|
}
|
||||||
|
mark.processing {
|
||||||
|
background-image:url(../images/icons/st-processing@2x.png);
|
||||||
|
background-size: 10px 8px;
|
||||||
|
}
|
||||||
|
mark.refunded {
|
||||||
|
background-image:url(../images/icons/refunded@2x.png);
|
||||||
|
background-size: 10px 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button.wc-reload span {
|
||||||
|
background-image: url(../images/icons/reload@2x.png);
|
||||||
|
background-size: 12px 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@import 'chosen.less';
|
@import 'chosen.less';
|
|
@ -1 +0,0 @@
|
||||||
#fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:11104;display:none}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background-image:url('../images/fancybox/fancybox.png')}#fancybox-overlay{position:absolute;top:0;left:0;width:100%;z-index:11100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{position:absolute;top:0;left:0;padding:20px;z-index:11101;outline:0;display:none}#fancybox-outer{position:relative;width:100%;height:100%;background:#fff;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em;-webkit-box-shadow:0 0 1em rgba(0,0,0,0.6);-moz-box-shadow:0 0 1em rgba(0,0,0,0.6);box-shadow:0 0 1em rgba(0,0,0,0.6)}#fancybox-content{width:0;height:0;padding:0;outline:0;position:relative;overflow:hidden;z-index:11102;border:0 solid #fff;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;z-index:11101}#fancybox-close{position:absolute;top:-15px;right:-15px;width:24px;height:24px;line-height:24px!important;font-size:16px!important;font-family:sans-serif!important;cursor:pointer;z-index:11103;display:none;text-align:center;background:#000;display:inline-block;border:2px solid #fff;-webkit-border-radius:2em;-moz-border-radius:2em;border-radius:2em;font-weight:bold;color:#fff;text-shadow:none;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);box-shadow:0 1px 3px rgba(0,0,0,0.8);-webkit-transition:all ease-in-out .2s}#fancybox-close:hover{background:#a36396;text-decoration:none!important}#fancybox-error{color:#444;font:normal 12px/20px Arial;padding:14px;margin:0}#fancybox-img{width:100%;height:100%;padding:0;margin:0;border:0;outline:0;line-height:0;vertical-align:top}#fancybox-frame{width:100%;height:100%;border:0;display:block}#fancybox-left,#fancybox-right{position:absolute;bottom:0;height:100%;width:35%;cursor:pointer;outline:0;background:transparent url('../images/fancybox/blank.gif');z-index:11102;display:none}#fancybox-left{left:0}#fancybox-right{right:0}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:11102;display:block}#fancybox-left-ico{background-image:url('../images/fancybox/fancybox.png');background-position:-40px -30px}#fancybox-right-ico{background-image:url('../images/fancybox/fancybox.png');background-position:-40px -60px}#fancybox-left:hover,#fancybox-right:hover{visibility:visible}#fancybox-left:hover span{left:20px}#fancybox-right:hover span{left:auto;right:20px}.fancybox-bg{position:absolute;padding:0;margin:0;border:0;width:20px;height:20px;z-index:11001}#fancybox-title{font-family:Helvetica;font-size:12px;z-index:11102;text-align:center;padding-top:10px}#fancybox-title-float{padding:3px 10px;background:#000;display:inline-block;border:2px solid #fff;-webkit-border-radius:2em;-moz-border-radius:2em;border-radius:2em;font-weight:bold;color:#fff;text-shadow:none;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);box-shadow:0 1px 3px rgba(0,0,0,0.8)}
|
|
|
@ -1,250 +0,0 @@
|
||||||
/*
|
|
||||||
* FancyBox - jQuery Plugin
|
|
||||||
* Simple and fancy lightbox alternative
|
|
||||||
*
|
|
||||||
* Examples and documentation at: http://fancybox.net
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
|
||||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
|
||||||
*
|
|
||||||
* Version: 1.3.4 (11/11/2010)
|
|
||||||
* Requires: jQuery v1.3+
|
|
||||||
*
|
|
||||||
* Dual licensed under the MIT and GPL licenses:
|
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
|
||||||
* http://www.gnu.org/licenses/gpl.html
|
|
||||||
*/
|
|
||||||
|
|
||||||
#fancybox-loading {
|
|
||||||
position: fixed;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
margin-top: -20px;
|
|
||||||
margin-left: -20px;
|
|
||||||
cursor: pointer;
|
|
||||||
overflow: hidden;
|
|
||||||
z-index: 11104;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-loading div {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 40px;
|
|
||||||
height: 480px;
|
|
||||||
background-image: url('../images/fancybox/fancybox.png');
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
z-index: 11100;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-tmp {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border: 0;
|
|
||||||
overflow: auto;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-wrap {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
padding: 20px;
|
|
||||||
z-index: 11101;
|
|
||||||
outline: none;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-outer {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: #fff;
|
|
||||||
-webkit-border-radius:1em;
|
|
||||||
-moz-border-radius:1em;
|
|
||||||
border-radius:1em;
|
|
||||||
-webkit-box-shadow:0 0 1em rgba(0,0,0,0.6);
|
|
||||||
-moz-box-shadow:0 0 1em rgba(0,0,0,0.6);
|
|
||||||
box-shadow:0 0 1em rgba(0,0,0,0.6);
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-content {
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
padding: 0;
|
|
||||||
outline: none;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
z-index: 11102;
|
|
||||||
border: 0px solid #fff;
|
|
||||||
-webkit-border-radius:1em;
|
|
||||||
-moz-border-radius:1em;
|
|
||||||
border-radius:1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-hide-sel-frame {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: transparent;
|
|
||||||
z-index: 11101;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-close {
|
|
||||||
position: absolute;
|
|
||||||
top: -15px;
|
|
||||||
right: -15px;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px !important;
|
|
||||||
font-size:16px !important;
|
|
||||||
font-family: sans-serif !important;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 11103;
|
|
||||||
display: none;
|
|
||||||
text-align: center;
|
|
||||||
background: #000;
|
|
||||||
display: inline-block;
|
|
||||||
border:2px solid #fff;
|
|
||||||
-webkit-border-radius:2em;
|
|
||||||
-moz-border-radius:2em;
|
|
||||||
border-radius:2em;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #fff;
|
|
||||||
text-shadow:none;
|
|
||||||
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);
|
|
||||||
-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);
|
|
||||||
box-shadow:0 1px 3px rgba(0,0,0,0.8);
|
|
||||||
-webkit-transition:all ease-in-out .2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-close:hover {
|
|
||||||
background: #a36396;
|
|
||||||
text-decoration:none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-error {
|
|
||||||
color: #444;
|
|
||||||
font: normal 12px/20px Arial;
|
|
||||||
padding: 14px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border: none;
|
|
||||||
outline: none;
|
|
||||||
line-height: 0;
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-frame {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border: none;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-left, #fancybox-right {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0px;
|
|
||||||
height: 100%;
|
|
||||||
width: 35%;
|
|
||||||
cursor: pointer;
|
|
||||||
outline: none;
|
|
||||||
background: transparent url('../images/fancybox/blank.gif');
|
|
||||||
z-index: 11102;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-left {
|
|
||||||
left: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-right {
|
|
||||||
right: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-left-ico, #fancybox-right-ico {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: -9999px;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
margin-top: -15px;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 11102;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-left-ico {
|
|
||||||
background-image: url('../images/fancybox/fancybox.png');
|
|
||||||
background-position: -40px -30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-right-ico {
|
|
||||||
background-image: url('../images/fancybox/fancybox.png');
|
|
||||||
background-position: -40px -60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-left:hover, #fancybox-right:hover {
|
|
||||||
visibility: visible; /* IE6 */
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-left:hover span {
|
|
||||||
left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-right:hover span {
|
|
||||||
left: auto;
|
|
||||||
right: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fancybox-bg {
|
|
||||||
position: absolute;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border: 0;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
z-index: 11001;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-title {
|
|
||||||
font-family: Helvetica;
|
|
||||||
font-size: 12px;
|
|
||||||
z-index: 11102;
|
|
||||||
text-align: center;
|
|
||||||
padding-top:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#fancybox-title-float {
|
|
||||||
padding:3px 10px;
|
|
||||||
background: #000;
|
|
||||||
display: inline-block;
|
|
||||||
border:2px solid #fff;
|
|
||||||
-webkit-border-radius:2em;
|
|
||||||
-moz-border-radius:2em;
|
|
||||||
border-radius:2em;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #fff;
|
|
||||||
text-shadow:none;
|
|
||||||
-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.8);
|
|
||||||
-moz-box-shadow:0 1px 3px rgba(0,0,0,0.8);
|
|
||||||
box-shadow:0 1px 3px rgba(0,0,0,0.8);
|
|
||||||
}
|
|
|
@ -1 +1 @@
|
||||||
#adminmenu #menu-posts-product div.wp-menu-image,#adminmenu #menu-posts-shop_order div.wp-menu-image,#adminmenu #menu-posts-shop_coupon div.wp-menu-image,#adminmenu #toplevel_page_woocommerce div.wp-menu-image{background-image:url(../images/icons/menu_icons.png)}#adminmenu #menu-posts-product div.wp-menu-image{background-position:-32px -32px}#adminmenu #menu-posts-product.wp-menu-open div.wp-menu-image,#adminmenu #menu-posts-product:hover div.wp-menu-image{background-position:-32px 0}#adminmenu #menu-posts-product img{display:none}#adminmenu #menu-posts-shop_order div.wp-menu-image{background-position:-64px -32px}#adminmenu #menu-posts-shop_order.wp-menu-open div.wp-menu-image,#adminmenu #menu-posts-shop_order:hover div.wp-menu-image{background-position:-64px 0}#adminmenu #menu-posts-shop_order img{display:none}#adminmenu #menu-posts-shop_coupon div.wp-menu-image{background-position:-96px -32px}#adminmenu #menu-posts-shop_coupon.wp-menu-open div.wp-menu-image,#adminmenu #menu-posts-shop_coupon:hover div.wp-menu-image{background-position:-96px 0}#adminmenu #menu-posts-shop_coupon img{display:none}#adminmenu #toplevel_page_woocommerce div.wp-menu-image{background-position:0 -32px}#adminmenu #toplevel_page_woocommerce.wp-menu-open div.wp-menu-image,#adminmenu #toplevel_page_woocommerce:hover div.wp-menu-image{background-position:0 0}#adminmenu #toplevel_page_woocommerce img{display:none}@media only screen and (-webkit-min-device-pixel-ratio:1.5){#adminmenu #menu-posts-product div.wp-menu-image,#adminmenu #menu-posts-shop_order div.wp-menu-image,#adminmenu #menu-posts-shop_coupon div.wp-menu-image,#adminmenu #toplevel_page_woocommerce div.wp-menu-image{background-image:url(../images/icons/menu_icons-x2.png);background-size:200px 64px}}span.mce_woocommerce_shortcodes_button{background-image:url(../images/icons/wc_icon.png)!important;background-repeat:no-repeat!important;background-position:center!important}
|
#adminmenu #menu-posts-product div.wp-menu-image,#adminmenu #menu-posts-shop_order div.wp-menu-image,#adminmenu #menu-posts-shop_coupon div.wp-menu-image,#adminmenu #toplevel_page_woocommerce div.wp-menu-image{background-image:url(../images/icons/menu_icons.png)}#adminmenu #menu-posts-product div.wp-menu-image{background-position:-32px -32px}#adminmenu #menu-posts-product.wp-menu-open div.wp-menu-image,#adminmenu #menu-posts-product:hover div.wp-menu-image{background-position:-32px 0}#adminmenu #menu-posts-product img{display:none}#adminmenu #menu-posts-shop_order div.wp-menu-image{background-position:-64px -32px}#adminmenu #menu-posts-shop_order.wp-menu-open div.wp-menu-image,#adminmenu #menu-posts-shop_order:hover div.wp-menu-image{background-position:-64px 0}#adminmenu #menu-posts-shop_order img{display:none}#adminmenu #menu-posts-shop_coupon div.wp-menu-image{background-position:-96px -32px}#adminmenu #menu-posts-shop_coupon.wp-menu-open div.wp-menu-image,#adminmenu #menu-posts-shop_coupon:hover div.wp-menu-image{background-position:-96px 0}#adminmenu #menu-posts-shop_coupon img{display:none}#adminmenu #toplevel_page_woocommerce div.wp-menu-image{background-position:0 -32px}#adminmenu #toplevel_page_woocommerce.wp-menu-open div.wp-menu-image,#adminmenu #toplevel_page_woocommerce:hover div.wp-menu-image{background-position:0 0}#adminmenu #toplevel_page_woocommerce img{display:none}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#adminmenu #menu-posts-product div.wp-menu-image,#adminmenu #menu-posts-shop_order div.wp-menu-image,#adminmenu #menu-posts-shop_coupon div.wp-menu-image,#adminmenu #toplevel_page_woocommerce div.wp-menu-image{background-image:url(../images/icons/menu_icons-x2.png);background-size:200px 64px}}span.mce_woocommerce_shortcodes_button{background-image:url(../images/icons/wc_icon.png)!important;background-repeat:no-repeat!important;background-position:center!important}
|
|
@ -3,10 +3,10 @@
|
||||||
#menu-posts-product div.wp-menu-image, #menu-posts-shop_order div.wp-menu-image, #menu-posts-shop_coupon div.wp-menu-image, #toplevel_page_woocommerce div.wp-menu-image {
|
#menu-posts-product div.wp-menu-image, #menu-posts-shop_order div.wp-menu-image, #menu-posts-shop_coupon div.wp-menu-image, #toplevel_page_woocommerce div.wp-menu-image {
|
||||||
background-image: url(../images/icons/menu_icons.png);
|
background-image: url(../images/icons/menu_icons.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu-posts-product {
|
#menu-posts-product {
|
||||||
div.wp-menu-image {
|
div.wp-menu-image {
|
||||||
background-position: -32px -32px;
|
background-position: -32px -32px;
|
||||||
}
|
}
|
||||||
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
||||||
background-position: -32px 0px;
|
background-position: -32px 0px;
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
}
|
}
|
||||||
#menu-posts-shop_order {
|
#menu-posts-shop_order {
|
||||||
div.wp-menu-image {
|
div.wp-menu-image {
|
||||||
background-position: -64px -32px;
|
background-position: -64px -32px;
|
||||||
}
|
}
|
||||||
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
||||||
background-position: -64px 0px;
|
background-position: -64px 0px;
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
}
|
}
|
||||||
#menu-posts-shop_coupon {
|
#menu-posts-shop_coupon {
|
||||||
div.wp-menu-image {
|
div.wp-menu-image {
|
||||||
background-position: -96px -32px;
|
background-position: -96px -32px;
|
||||||
}
|
}
|
||||||
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
||||||
background-position: -96px 0px;
|
background-position: -96px 0px;
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
}
|
}
|
||||||
#toplevel_page_woocommerce {
|
#toplevel_page_woocommerce {
|
||||||
div.wp-menu-image {
|
div.wp-menu-image {
|
||||||
background-position: 0px -32px;
|
background-position: 0px -32px;
|
||||||
}
|
}
|
||||||
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
&.wp-menu-open div.wp-menu-image, &:hover div.wp-menu-image {
|
||||||
background-position: 0px 0px;
|
background-position: 0px 0px;
|
||||||
|
@ -50,7 +50,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
|
@media
|
||||||
|
(-webkit-min-device-pixel-ratio: 2),
|
||||||
|
(min-resolution: 192dpi) {
|
||||||
#adminmenu {
|
#adminmenu {
|
||||||
#menu-posts-product div.wp-menu-image, #menu-posts-shop_order div.wp-menu-image, #menu-posts-shop_coupon div.wp-menu-image, #toplevel_page_woocommerce div.wp-menu-image {
|
#menu-posts-product div.wp-menu-image, #menu-posts-shop_order div.wp-menu-image, #menu-posts-shop_coupon div.wp-menu-image, #toplevel_page_woocommerce div.wp-menu-image {
|
||||||
background-image: url(../images/icons/menu_icons-x2.png);
|
background-image: url(../images/icons/menu_icons-x2.png);
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@woocommerce: #ad74a2;
|
||||||
|
|
||||||
.clearfix() {
|
.clearfix() {
|
||||||
&:after {
|
&:after {
|
||||||
content:"";
|
content:"";
|
||||||
|
@ -18,7 +20,7 @@
|
||||||
border-top-right-radius: @radius;
|
border-top-right-radius: @radius;
|
||||||
border-bottom-right-radius: @radius;
|
border-bottom-right-radius: @radius;
|
||||||
}
|
}
|
||||||
.border_radius_left(@radius:4px) {
|
.border_radius_left(@radius:4px) {
|
||||||
-webkit-border-top-left-radius: @radius;
|
-webkit-border-top-left-radius: @radius;
|
||||||
-webkit-border-bottom-left-radius: @radius;
|
-webkit-border-bottom-left-radius: @radius;
|
||||||
-moz-border-radius-topleft: @radius;
|
-moz-border-radius-topleft: @radius;
|
||||||
|
@ -75,6 +77,20 @@
|
||||||
transition:@selector @animation @duration;
|
transition:@selector @animation @duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.scale(@ratio:1.5){
|
||||||
|
-webkit-transform:scale(@ratio);
|
||||||
|
-moz-transform:scale(@ratio);
|
||||||
|
-ms-transform:scale(@ratio);
|
||||||
|
-o-transform:scale(@ratio);
|
||||||
|
transform:scale(@ratio);
|
||||||
|
}
|
||||||
|
|
||||||
|
.borderbox () {
|
||||||
|
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
||||||
|
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
||||||
|
box-sizing: border-box; /* Opera/IE 8+ */
|
||||||
|
}
|
||||||
|
|
||||||
.clear { clear: both; }
|
.clear { clear: both; }
|
||||||
.nobr { white-space: nowrap; }
|
.nobr { white-space: nowrap; }
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,469 @@
|
||||||
|
@import 'mixins.less';
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
.button() {
|
||||||
|
.border_radius(100%);
|
||||||
|
height:16px;
|
||||||
|
width:16px;
|
||||||
|
color: #666 !important;
|
||||||
|
.vertical_gradient(#f6f6f6,#e8e8e8);
|
||||||
|
border:1px solid #ccc;
|
||||||
|
font-size:14px !important;
|
||||||
|
font-family: verdana !important;
|
||||||
|
text-shadow:0 1px 0 #fff;
|
||||||
|
font-weight: bold !important;
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.05),
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.5),
|
||||||
|
0 1px 2px rgba(0,0,0,0.075);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 -1px 0 rgba(0,0,0,0.05),
|
||||||
|
inset 0 1px 0 rgba(255,255,255,0.5),
|
||||||
|
0 1px 2px rgba(0,0,0,0.075);
|
||||||
|
&:hover {
|
||||||
|
.vertical_gradient(#fff,#e8e8e8);
|
||||||
|
color: #444 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WooCommerce theme
|
||||||
|
|
||||||
|
div.pp_woocommerce {
|
||||||
|
.pp_content_container {
|
||||||
|
background: #fff;
|
||||||
|
.border_radius(3px);
|
||||||
|
.box_shadow(0,1px,3px,0,rgba(0,0,0,0.25));
|
||||||
|
padding:60px 0 40px 0;
|
||||||
|
}
|
||||||
|
.pp_loaderIcon {
|
||||||
|
background: url(../images/ajax-loader.gif) center no-repeat;
|
||||||
|
}
|
||||||
|
div.ppt {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.pp_gallery {
|
||||||
|
ul {
|
||||||
|
li {
|
||||||
|
a {
|
||||||
|
border:1px solid rgba(0,0,0,0.5);
|
||||||
|
background: #fff;
|
||||||
|
.box_shadow(0,1px,2px,0,rgba(0,0,0,0.2));
|
||||||
|
.border_radius(2px);
|
||||||
|
display: block;
|
||||||
|
&:hover {
|
||||||
|
border-color:#000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.selected {
|
||||||
|
a {
|
||||||
|
border-color:#000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Next / Previous
|
||||||
|
.pp_arrow_previous, .pp_arrow_next, .pp_previous, .pp_next {
|
||||||
|
&:before {
|
||||||
|
line-height: 1.15 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pp_previous, .pp_next {
|
||||||
|
&:before {
|
||||||
|
.button;
|
||||||
|
content: "\2039";
|
||||||
|
text-indent: 0;
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top:50%;
|
||||||
|
margin-top:-10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
&:before {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pp_previous {
|
||||||
|
&:before {
|
||||||
|
left:1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pp_next {
|
||||||
|
&:before {
|
||||||
|
right:1em;
|
||||||
|
content: "\203a";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_details {
|
||||||
|
margin:0;
|
||||||
|
padding-top:1em;
|
||||||
|
}
|
||||||
|
.pp_nav, .pp_description {
|
||||||
|
font-size:14px;
|
||||||
|
}
|
||||||
|
.pp_nav, .pp_nav p, .pp_play, .pp_nav .pp_pause, .pp_arrow_previous, .pp_arrow_next {
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Navigation
|
||||||
|
.pp_nav {
|
||||||
|
margin-right:1em;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.pp_close {
|
||||||
|
.button;
|
||||||
|
width:21px;
|
||||||
|
height:21px;
|
||||||
|
top:-10px;
|
||||||
|
right:-10px;
|
||||||
|
&:before {
|
||||||
|
content:"\00d7";
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
bottom:0;
|
||||||
|
text-align: center;
|
||||||
|
text-indent: 0;
|
||||||
|
line-height: 1.45;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Buttons
|
||||||
|
.pp_arrow_previous, .pp_arrow_next {
|
||||||
|
.button;
|
||||||
|
position: relative;
|
||||||
|
margin-top:-1px;
|
||||||
|
&:before {
|
||||||
|
content:"\2039";
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
bottom:0;
|
||||||
|
text-align: center;
|
||||||
|
text-indent: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pp_arrow_previous {
|
||||||
|
margin-right:.5em;
|
||||||
|
}
|
||||||
|
.pp_arrow_next {
|
||||||
|
margin-left:.5em;
|
||||||
|
&:before {
|
||||||
|
content: "\203a";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a.pp_expand, a.pp_contract {
|
||||||
|
.button;
|
||||||
|
right:auto;
|
||||||
|
left:-10px;
|
||||||
|
top:-10px;
|
||||||
|
height:21px;
|
||||||
|
width:21px;
|
||||||
|
&:before {
|
||||||
|
content:"\2295";
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top:0;
|
||||||
|
left:0;
|
||||||
|
right:0;
|
||||||
|
bottom:0;
|
||||||
|
text-align: center;
|
||||||
|
text-indent: 0;
|
||||||
|
line-height:0.9 !important;
|
||||||
|
font-size:19px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a.pp_contract {
|
||||||
|
&:before {
|
||||||
|
content: "\2297";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#respond {
|
||||||
|
margin:0;
|
||||||
|
width:100%;
|
||||||
|
background: none;
|
||||||
|
border:none;
|
||||||
|
padding:0;
|
||||||
|
.form-submit {
|
||||||
|
margin-top:0;
|
||||||
|
float:none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.pp_inline {
|
||||||
|
padding:0!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------
|
||||||
|
DO NOT CHANGE
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
div.pp_pic_holder a:focus { outline:none; }
|
||||||
|
|
||||||
|
div.pp_overlay {
|
||||||
|
background: #fff;
|
||||||
|
display: none;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.pp_pic_holder {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
width: 100px;
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.pp_top {
|
||||||
|
height: 20px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
* html .pp_top { padding: 0 20px; }
|
||||||
|
|
||||||
|
.pp_top .pp_left {
|
||||||
|
height: 20px;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
.pp_top .pp_middle {
|
||||||
|
height: 20px;
|
||||||
|
left: 20px;
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
|
* html .pp_top .pp_middle {
|
||||||
|
left: 0;
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_top .pp_right {
|
||||||
|
height: 20px;
|
||||||
|
left: auto;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_content { height: 40px; min-width: 40px; }
|
||||||
|
* html .pp_content { width: 40px; }
|
||||||
|
|
||||||
|
.pp_fade { display: none; }
|
||||||
|
|
||||||
|
.pp_content_container {
|
||||||
|
position: relative;
|
||||||
|
text-align: left;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_content_container .pp_left { padding-left: 40px; }
|
||||||
|
.pp_content_container .pp_right { padding-right: 40px; }
|
||||||
|
|
||||||
|
.pp_content_container .pp_details {
|
||||||
|
float: left;
|
||||||
|
margin: 10px 0 2px 0;
|
||||||
|
}
|
||||||
|
.pp_description {
|
||||||
|
display: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_social { float: left; margin: 0; }
|
||||||
|
.pp_social .facebook { float: left; margin-left: 5px; width: 55px; overflow: hidden; }
|
||||||
|
.pp_social .twitter { float: left; }
|
||||||
|
|
||||||
|
.pp_nav {
|
||||||
|
clear: right;
|
||||||
|
float: left;
|
||||||
|
margin: 3px 10px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_nav p {
|
||||||
|
float: left;
|
||||||
|
margin: 2px 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_nav .pp_play,
|
||||||
|
.pp_nav .pp_pause {
|
||||||
|
float: left;
|
||||||
|
margin-right: 4px;
|
||||||
|
text-indent: -10000px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.pp_arrow_previous,
|
||||||
|
a.pp_arrow_next {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
height: 15px;
|
||||||
|
margin-top: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-indent: -10000px;
|
||||||
|
width: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_hoverContainer {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_gallery {
|
||||||
|
display: none;
|
||||||
|
left: 50%;
|
||||||
|
margin-top: -50px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_gallery div {
|
||||||
|
float: left;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_gallery ul {
|
||||||
|
float: left;
|
||||||
|
height: 35px;
|
||||||
|
margin: 0 0 0 5px;
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_gallery ul a {
|
||||||
|
border: 1px #000 solid;
|
||||||
|
border: 1px rgba(0,0,0,0.5) solid;
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
height: 33px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_gallery ul a:hover,
|
||||||
|
.pp_gallery li.selected a { border-color: #fff; }
|
||||||
|
|
||||||
|
.pp_gallery ul a img { border: 0; }
|
||||||
|
|
||||||
|
.pp_gallery li {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_gallery li.default a {
|
||||||
|
display: block;
|
||||||
|
height: 33px;
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_gallery li.default a img { display: none; }
|
||||||
|
|
||||||
|
.pp_gallery .pp_arrow_previous,
|
||||||
|
.pp_gallery .pp_arrow_next {
|
||||||
|
margin-top: 7px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.pp_next {
|
||||||
|
display: block;
|
||||||
|
float: right;
|
||||||
|
height: 100%;
|
||||||
|
text-indent: -10000px;
|
||||||
|
width: 49%;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.pp_previous {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
height: 100%;
|
||||||
|
text-indent: -10000px;
|
||||||
|
width: 49%;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.pp_expand,
|
||||||
|
a.pp_contract {
|
||||||
|
cursor: pointer;
|
||||||
|
display: none;
|
||||||
|
height: 20px;
|
||||||
|
position: absolute;
|
||||||
|
right: 30px;
|
||||||
|
text-indent: -10000px;
|
||||||
|
top: 10px;
|
||||||
|
width: 20px;
|
||||||
|
z-index: 20000;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.pp_close {
|
||||||
|
position: absolute; right: 0; top: 0;
|
||||||
|
display: block;
|
||||||
|
line-height:22px;
|
||||||
|
text-indent: -10000px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_bottom {
|
||||||
|
height: 20px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
* html .pp_bottom { padding: 0 20px; }
|
||||||
|
|
||||||
|
.pp_bottom .pp_left {
|
||||||
|
height: 20px;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
.pp_bottom .pp_middle {
|
||||||
|
height: 20px;
|
||||||
|
left: 20px;
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
|
* html .pp_bottom .pp_middle {
|
||||||
|
left: 0;
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_bottom .pp_right {
|
||||||
|
height: 20px;
|
||||||
|
left: auto;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pp_loaderIcon {
|
||||||
|
display: block;
|
||||||
|
height: 24px;
|
||||||
|
left: 50%;
|
||||||
|
margin: -12px 0 0 -12px;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
width: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pp_full_res .pp_inline {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.ppt {
|
||||||
|
color: #fff;
|
||||||
|
display: none;
|
||||||
|
font-size: 17px;
|
||||||
|
margin: 0 0 5px 15px;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
|
@ -8,29 +8,45 @@
|
||||||
|
|
||||||
/* =Global styles/layout
|
/* =Global styles/layout
|
||||||
-------------------------------------------------------------- */
|
-------------------------------------------------------------- */
|
||||||
.woocommerce_message, .woocommerce_error, .woocommerce_info {
|
.woocommerce-message, .woocommerce-error, .woocommerce-info {
|
||||||
padding: .55em 1em .55em 3em;
|
padding: 1em 1em 1em 3.5em;
|
||||||
margin: 0 0 2em;
|
margin: 0 0 2em;
|
||||||
position: relative;
|
position: relative;
|
||||||
.border_radius(2px);
|
.border_radius(4px);
|
||||||
.vertical_gradient( @secondary, darken( @secondary, 3 ) );
|
.vertical_gradient( lighten( @secondary, 2 ), @secondary );
|
||||||
color: @secondarytext;
|
color: @secondarytext;
|
||||||
.box_shadow( 0, 1px, 2px, 0, rgba(0,0,0,0.25) );
|
|
||||||
.text_shadow( 0, 1px, 0, lighten( @secondary, 4 ) );
|
.text_shadow( 0, 1px, 0, lighten( @secondary, 4 ) );
|
||||||
list-style:none outside;
|
list-style:none outside;
|
||||||
.clearfix();
|
.clearfix();
|
||||||
width: auto;
|
width: auto;
|
||||||
|
-webkit-box-shadow:
|
||||||
|
inset 0 -2px 6px rgba(0,0,0,0.05),
|
||||||
|
inset 0 -2px 30px rgba(0,0,0,0.015),
|
||||||
|
inset 0 1px 0 #fff,
|
||||||
|
0 1px 2px rgba(0,0,0,0.3);
|
||||||
|
box-shadow:
|
||||||
|
inset 0 -2px 6px rgba(0,0,0,0.05),
|
||||||
|
inset 0 -2px 30px rgba(0,0,0,0.015),
|
||||||
|
inset 0 1px 0 #fff,
|
||||||
|
0 1px 2px rgba(0,0,0,0.3);
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
height: 16px;
|
height: 1.5em;
|
||||||
width: 16px;
|
width: 1.5em;
|
||||||
display:block;
|
display:block;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
top: .8em;
|
top: 0;
|
||||||
left: 1em;
|
left: 1em;
|
||||||
background-color: white;
|
font-family: sans-serif;
|
||||||
.border_radius(1em);
|
font-size:1em;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow:0 1px 0 rgba(0,0,0,0.2);
|
||||||
|
padding-top:1em;
|
||||||
|
.border_radius_bottom(4px);
|
||||||
|
.inset_box_shadow(0,-1px,0,0,rgba(0,0,0,0.1));
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
|
@ -39,17 +55,34 @@
|
||||||
|
|
||||||
li {
|
li {
|
||||||
list-style:none outside;
|
list-style:none outside;
|
||||||
|
padding-left:0;
|
||||||
|
margin-left:0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.woocommerce_message:before {
|
.woocommerce-message {
|
||||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAGCAYAAAAPDoR2AAAAN0lEQVQIHXWMQQ4AMAjCxv7/ZxZIanbYPIhSUbbXo2Jqf0BsA4mjgU1ioAVpSSrDVbPzFgPt7QH7qwoJ3MDCYgAAAABJRU5ErkJggg==) center no-repeat #8fae1b; /* check icon */
|
border-top:3px solid #8fae1b;
|
||||||
|
&:before {
|
||||||
|
background-color:#8fae1b;
|
||||||
|
content: "\2713";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.woocommerce_info:before {
|
.woocommerce-info {
|
||||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAFCAYAAABvsz2cAAAAG0lEQVQIHWP8DwQMQMACxIwwBliECcQDATgDAMHrBQqJ6tMZAAAAAElFTkSuQmCC) center no-repeat #18919c; /* info icon */
|
border-top:3px solid #1e85be;
|
||||||
|
&:before {
|
||||||
|
background-color:#1e85be;
|
||||||
|
content: "i";
|
||||||
|
font-family: Times, Georgia, serif;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.woocommerce_error:before {
|
.woocommerce-error {
|
||||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAAFCAYAAABvsz2cAAAAHUlEQVQIHWP8DwQMQMAEIkAAzmABchhBIiAGWA0Ar6MFCigWCYMAAAAASUVORK5CYII=) center no-repeat #b81c23; /* error icon */
|
border-top:3px solid #b81c23;
|
||||||
|
&:before {
|
||||||
|
background-color:#b81c23;
|
||||||
|
content: "\00d7";
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p.demo_store {
|
p.demo_store {
|
||||||
|
@ -65,10 +98,16 @@ p.demo_store {
|
||||||
.vertical_gradient( @primary, darken(@primary, 10) );
|
.vertical_gradient( @primary, darken(@primary, 10) );
|
||||||
border: 1px solid darken(@primary, 10);
|
border: 1px solid darken(@primary, 10);
|
||||||
color: @primarytext;
|
color: @primarytext;
|
||||||
z-index: 999999;
|
z-index: 99998;
|
||||||
.inset_box_shadow( 0, 0, 0, 3px, rgba(255,255,255,0.2) );
|
.inset_box_shadow( 0, 0, 0, 3px, rgba(255,255,255,0.2) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-bar { // Styles applied when the admin bar is present
|
||||||
|
p.demo_store {
|
||||||
|
top:28px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.woocommerce, .woocommerce-page { // namespace to avoid conflict with common global class names
|
.woocommerce, .woocommerce-page { // namespace to avoid conflict with common global class names
|
||||||
|
|
||||||
small.note {
|
small.note {
|
||||||
|
@ -79,7 +118,7 @@ p.demo_store {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#breadcrumb {
|
.woocommerce-breadcrumb{
|
||||||
.clearfix();
|
.clearfix();
|
||||||
margin: 0 0 1em;
|
margin: 0 0 1em;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -198,7 +237,7 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tabs on the product page */
|
/* Tabs on the product page */
|
||||||
.woocommerce_tabs {
|
.woocommerce-tabs {
|
||||||
clear:both;
|
clear:both;
|
||||||
|
|
||||||
ul.tabs {
|
ul.tabs {
|
||||||
|
@ -294,7 +333,8 @@ p.demo_store {
|
||||||
|
|
||||||
/* Cart button */
|
/* Cart button */
|
||||||
p.cart {
|
p.cart {
|
||||||
float: right;
|
margin-bottom: 2em;
|
||||||
|
.clearfix();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add to cart forms */
|
/* add to cart forms */
|
||||||
|
@ -475,18 +515,18 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.woocommerce_result_count {
|
.woocommerce-result-count {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0 0 1em;
|
margin: 0 0 1em;
|
||||||
}
|
}
|
||||||
.woocommerce_ordering {
|
.woocommerce-ordering {
|
||||||
margin: 0 0 1em;
|
margin: 0 0 1em;
|
||||||
float: right;
|
float: right;
|
||||||
select {
|
select {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nav.woocommerce_pagination, #content nav.woocommerce_pagination {
|
nav.woocommerce-pagination, #content nav.woocommerce-pagination {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
ul {
|
ul {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -574,7 +614,7 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*&.added {
|
&.added {
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
position:absolute;
|
position:absolute;
|
||||||
|
@ -584,9 +624,8 @@ p.demo_store {
|
||||||
right: -26px;
|
right: -26px;
|
||||||
text-indent: 0;
|
text-indent: 0;
|
||||||
background: url(../images/success.png) no-repeat;
|
background: url(../images/success.png) no-repeat;
|
||||||
background-size:16px 14px;
|
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.vertical_gradient( @secondary, darken( @secondary, 15 ) );
|
.vertical_gradient( @secondary, darken( @secondary, 15 ) );
|
||||||
|
@ -616,9 +655,7 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
|
|
||||||
a.added_to_cart {
|
a.added_to_cart {
|
||||||
background: url(../images/success.png) no-repeat left;
|
padding-top: .5em;
|
||||||
background-size:16px 14px;
|
|
||||||
padding: 0 0 0 22px;
|
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
@ -749,6 +786,7 @@ p.demo_store {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background:none;
|
background:none;
|
||||||
|
list-style: none;
|
||||||
li {
|
li {
|
||||||
padding: 00;
|
padding: 00;
|
||||||
margin: 0 0 20px;
|
margin: 0 0 20px;
|
||||||
|
@ -760,7 +798,7 @@ p.demo_store {
|
||||||
color: @subtext;
|
color: @subtext;
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
}
|
}
|
||||||
img {
|
img.avatar {
|
||||||
float:left;
|
float:left;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -793,18 +831,49 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start rating */
|
/* Star rating */
|
||||||
.star-rating {
|
.star-rating {
|
||||||
float: right;
|
float: right;
|
||||||
width: 80px;
|
overflow: hidden;
|
||||||
height: 16px;
|
position: relative;
|
||||||
background: url(../images/star.png) repeat-x left 0;
|
height: 1em;
|
||||||
|
line-height: 1em;
|
||||||
|
font-size: 1em;
|
||||||
|
width: 5.4em;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
|
||||||
|
&:before {
|
||||||
|
content: "\2606\2606\2606\2606\2606";
|
||||||
|
color: darken( @secondary, 10 );
|
||||||
|
float: left;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
letter-spacing:0\9; // IE8 & below hack ;-(
|
||||||
|
}
|
||||||
span {
|
span {
|
||||||
background: url(../images/star.png) repeat-x left -32px;
|
overflow: hidden;
|
||||||
height: 0;
|
float: left;
|
||||||
padding-top: 16px;
|
top: 0;
|
||||||
overflow:hidden;
|
left: 0;
|
||||||
float:left;
|
position: absolute;
|
||||||
|
padding-top: 1.5em;
|
||||||
|
}
|
||||||
|
span:before {
|
||||||
|
content: "\2605\2605\2605\2605\2605";
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
letter-spacing:0\9; // IE8 & below hack ;-(
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.products {
|
||||||
|
.star-rating {
|
||||||
|
display: block;
|
||||||
|
margin: 0 0 .5em;
|
||||||
|
float: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -841,35 +910,56 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
|
|
||||||
p.stars {
|
p.stars {
|
||||||
.clearfix();
|
overflow: hidden;
|
||||||
span {
|
position: relative;
|
||||||
width: 80px;
|
height: 1em;
|
||||||
height: 16px;
|
line-height: 1em;
|
||||||
position: relative;
|
font-size: 1em;
|
||||||
float:left;
|
width: 5.4em;
|
||||||
background: url(../images/star.png) repeat-x left 0;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
|
||||||
a {
|
&:before {
|
||||||
float:left;
|
content: "\2606\2606\2606\2606\2606";
|
||||||
position:absolute;
|
float: left;
|
||||||
left: 0;
|
top: 0;
|
||||||
top: 0;
|
left: 0;
|
||||||
width: 16px;
|
position: absolute;
|
||||||
height: 0;
|
letter-spacing: 0.1em;
|
||||||
padding-top: 16px;
|
letter-spacing:0\9; // IE8 & below hack ;-(
|
||||||
overflow:hidden;
|
color: darken( @secondary, 10 );
|
||||||
}
|
|
||||||
a:hover, a:focus {
|
|
||||||
background: url(../images/star.png) repeat-x left -16px;
|
|
||||||
}
|
|
||||||
a.active {
|
|
||||||
background: url(../images/star.png) repeat-x left -32px;
|
|
||||||
}
|
|
||||||
a.star-1 { width: 16px; z-index: 10; }
|
|
||||||
a.star-2 { width: 32px; z-index: 9; }
|
|
||||||
a.star-3 { width: 48px; z-index: 8; }
|
|
||||||
a.star-4 { width: 64px; z-index: 7; }
|
|
||||||
a.star-5 { width: 80px; z-index: 6; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
float: left;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 1em;
|
||||||
|
height: 0;
|
||||||
|
padding-top: 1em;
|
||||||
|
overflow: hidden;
|
||||||
|
&:before {
|
||||||
|
content: "\2605\2605\2605\2605\2605";
|
||||||
|
top: 0;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
letter-spacing:0\9; // IE8 & below hack ;-(
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
a:hover:before, a:focus:before {
|
||||||
|
color: @primary;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
a.active:before {
|
||||||
|
color: @primary;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
a.star-1 { width: 1em; z-index: 10; }
|
||||||
|
a.star-2 { width: 2.1em; z-index: 9; }
|
||||||
|
a.star-3 { width: 3.2em; z-index: 8; }
|
||||||
|
a.star-4 { width: 4.3em; z-index: 7; }
|
||||||
|
a.star-5 { width: 5.4em; z-index: 6; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =Tables
|
/* =Tables
|
||||||
|
@ -922,12 +1012,13 @@ p.demo_store {
|
||||||
border-top: 1px solid rgba(0,0,0,0.1);
|
border-top: 1px solid rgba(0,0,0,0.1);
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
small {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
td.product-quantity {
|
tfoot td, tfoot th {
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
tfoot td {
|
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
|
border-top: 1px solid rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -935,11 +1026,17 @@ p.demo_store {
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
th, td {
|
th, td {
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
vertical-align: top;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.button {
|
.button {
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
}
|
}
|
||||||
|
.order-actions {
|
||||||
|
text-align: right;
|
||||||
|
.button {
|
||||||
|
margin: .125em 0 .125em .25em;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
td.product-name {
|
td.product-name {
|
||||||
|
@ -982,13 +1079,19 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
a.remove {
|
a.remove {
|
||||||
display:block;
|
display:block;
|
||||||
height: 16px;
|
font-size:1.5em;
|
||||||
width: 16px;
|
height:1em;
|
||||||
text-indent: -9999px;
|
width:1em;
|
||||||
background: url(../images/remove.png) darken( @secondary, 10 );
|
text-align: center;
|
||||||
|
line-height: 1;
|
||||||
|
.border_radius(100%);
|
||||||
|
color: red;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
a.remove:hover {
|
a.remove:hover {
|
||||||
background-color: red;
|
background-color: red;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
td.actions {
|
td.actions {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
@ -1227,16 +1330,16 @@ p.demo_store {
|
||||||
-webkit-box-shadow:none;
|
-webkit-box-shadow:none;
|
||||||
box-shadow:none;
|
box-shadow:none;
|
||||||
}
|
}
|
||||||
&.wc-validated {
|
&.woocommerce-validated {
|
||||||
input.input-text {
|
input.input-text {
|
||||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAVElEQVQYV2NkIAIw4lNz5syZ/yB5nIpgCkxMTBixKkJWgNUkdAVgRciC2BSAFe3evfu/oKAg3P3v379ncHV1RXEGmIOsEORQdB/DBUAKQZLopoDEAE3dJm1YbTYqAAAAAElFTkSuQmCC);
|
background-image: url(../images/icons/valid.png);
|
||||||
background-position: 95% center;
|
background-position: 95% center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.wc-error {
|
&.woocommerce-invalid {
|
||||||
input.input-text {
|
input.input-text {
|
||||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAZUlEQVQYV2NkQAO/6zv+szZWMCILo3BAChjfvgPLs0zpgsthKAKZ8ien7D9WRSBTQCbAFCGbBjeJoCKYAoRJpUBTIfpB1oJZyIpgDmdgANnOCFGEUAARRHYTLBjAPkGECUQhOgAAec48xMU9V4oAAAAASUVORK5CYII=);
|
background-image: url(../images/icons/invalid.png);
|
||||||
background-position: 95% center;
|
background-position: 95% center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
@ -1265,6 +1368,9 @@ p.demo_store {
|
||||||
.form-row-last {
|
.form-row-last {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
.form-row-wide {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
form.login, form.checkout_coupon, form.register {
|
form.login, form.checkout_coupon, form.register {
|
||||||
|
@ -1637,3 +1743,55 @@ p.demo_store {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end .woocommerce-page namespacing wrap
|
} // end .woocommerce-page namespacing wrap
|
||||||
|
@media
|
||||||
|
(-webkit-min-device-pixel-ratio: 2),
|
||||||
|
(min-resolution: 192dpi) {
|
||||||
|
.woocommerce, .woocommerce-page {
|
||||||
|
a.button, button.button, input.button, #respond input#submit, #content input.button {
|
||||||
|
&.loading {
|
||||||
|
&:before {
|
||||||
|
background-image: url(../images/ajax-loader@2x.gif);
|
||||||
|
background-size: 16px 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.added:before {
|
||||||
|
background: url(../images/success@2x.png) no-repeat;
|
||||||
|
background-size:16px 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.woocommerce form .form-row.woocommerce-validated input.input-text, .woocommerce-page form .form-row.woocommerce-validated input.input-text {
|
||||||
|
background-image: url(../images/icons/valid@2x.png);
|
||||||
|
background-size: 12px 9px;
|
||||||
|
}
|
||||||
|
.woocommerce form .form-row.woocommerce-invalid input.input-text, .woocommerce-page form .form-row.woocommerce-invalid input.input-text {
|
||||||
|
background-image: url(../images/icons/invalid@2x.png);
|
||||||
|
background-size: 12px 9px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Firefox hack :( (for some reason Firefox doesn't like applying font-size to pseudo-elements containing unicode chars in the content property)
|
||||||
|
@-moz-document url-prefix() {
|
||||||
|
.woocommerce .star-rating, .woocommerce-page .star-rating {
|
||||||
|
width:3.4em;
|
||||||
|
font-size:1.5em;
|
||||||
|
}
|
||||||
|
.woocommerce p.stars, .woocommerce-page p.stars {
|
||||||
|
width:3.5em;
|
||||||
|
font-size:1.5em;
|
||||||
|
a.star-1 {
|
||||||
|
width:.7em;
|
||||||
|
}
|
||||||
|
a.star-2 {
|
||||||
|
width:1.4em;
|
||||||
|
}
|
||||||
|
a.star-3 {
|
||||||
|
width:2.1em;
|
||||||
|
}
|
||||||
|
a.star-4 {
|
||||||
|
width:2.8em;
|
||||||
|
}
|
||||||
|
a.star-5 {
|
||||||
|
width:3.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 885 B |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 424 B After Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 278 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 43 B |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 654 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 814 B After Width: | Height: | Size: 432 B |
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 113 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 109 B |
After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 213 B |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 256 B |
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 129 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 355 B |
After Width: | Height: | Size: 103 B |
After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 253 B |
After Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 145 B |
After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 416 B |
After Width: | Height: | Size: 83 B |
After Width: | Height: | Size: 132 B |
Before Width: | Height: | Size: 345 B After Width: | Height: | Size: 188 B |
After Width: | Height: | Size: 126 B |
After Width: | Height: | Size: 198 B |
After Width: | Height: | Size: 193 B |
After Width: | Height: | Size: 285 B |
After Width: | Height: | Size: 113 B |
After Width: | Height: | Size: 188 B |
After Width: | Height: | Size: 315 B |