Merge branch 'pr/11797'

# Conflicts:
#	includes/admin/meta-boxes/class-wc-meta-box-coupon-data.php
#	includes/api/class-wc-rest-coupons-controller.php
#	includes/class-wc-coupon.php
#	tests/unit-tests/api/coupons.php
#	tests/unit-tests/coupon/crud.php
This commit is contained in:
Mike Jolley 2016-09-01 11:46:05 +01:00
commit 1b2df3dd3b
331 changed files with 2936 additions and 2612 deletions

View File

@ -24,8 +24,36 @@ matrix:
before_script:
- bash tests/bin/install.sh woocommerce_test root '' localhost $WP_VERSION
- bash tests/bin/travis.sh before
# Install CodeSniffer for WordPress Coding Standards checks.
- git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git /tmp/phpcs
# Install WordPress Coding Standards.
- git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git /tmp/sniffs
# Install PHP Compatibility sniffs.
- git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git /tmp/sniffs/PHPCompatibility
# Set install path for PHPCS sniffs.
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
- /tmp/phpcs/scripts/phpcs --config-set installed_paths /tmp/sniffs
# After CodeSniffer install you should refresh your path.
- phpenv rehash
script: phpunit -c phpunit.xml.dist
script:
# Search for PHP syntax errors.
- find . \( -name '*.php' -not -path "./vendor/*" \) -exec php -lf {} \;
# Run PHPUnit tests.
- phpunit -c phpunit.xml.dist
# WordPress Coding Standards.
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link http://pear.php.net/package/PHP_CodeSniffer/
# -p flag: Show progress of the run.
# -s flag: Show sniff codes in all reports.
# -v flag: Print verbose output.
# -n flag: Do not print warnings. (shortcut for --warning-severity=0)
# --standard: Use WordPress as the standard.
# --extensions: Only sniff PHP files.
- /tmp/phpcs/scripts/phpcs -p -s -v -n ./*.php --standard=./phpcs.ruleset.xml --extensions=php
- /tmp/phpcs/scripts/phpcs -p -s -v -n ./**/*.php --standard=./phpcs.ruleset.xml --extensions=php --ignore=./vendor/*.php
- /tmp/phpcs/scripts/phpcs -p -s -v -n ./**/**/*.php --standard=./phpcs.ruleset.xml --extensions=php --ignore=./vendor/**/*.php
- /tmp/phpcs/scripts/phpcs -p -s -v -n ./**/**/**/*.php --standard=./phpcs.ruleset.xml --extensions=php --ignore=./vendor/**/**/*.php
after_script:
- bash tests/bin/travis.sh after

View File

@ -14,7 +14,7 @@ class WC_HookFinder {
if ( ! $path && ( $dir = dirname( $pattern ) ) != '.' ) {
if ($dir == '\\' || $dir == '/') { $dir = ''; } // End IF Statement
if ( $dir == '\\' || $dir == '/' ) { $dir = ''; } // End IF Statement
return self::get_files(basename( $pattern ), $flags, $dir . '/' );
@ -37,7 +37,6 @@ class WC_HookFinder {
if ( is_array( $files ) && is_array( $found_files ) ) {
$files = array_merge( $files, $found_files );
}
} // End FOREACH Loop
}
return $files;
@ -169,7 +168,7 @@ class WC_HookFinder {
'class' => $current_class,
'function' => $current_function,
'file' => array( self::$current_file ),
'type' => $token_type
'type' => $token_type,
);
}
break;

View File

@ -15,10 +15,10 @@ return array(
'state' => '',
'rate' => '10.0000',
'name' => 'GST',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'BD' => array(
'currency_code' => 'BDT',
@ -35,10 +35,10 @@ return array(
'state' => '',
'rate' => '15.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'BE' => array(
'currency_code' => 'EUR',
@ -55,10 +55,10 @@ return array(
'state' => '',
'rate' => '20.0000',
'name' => 'BTW',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'BR' => array(
'currency_code' => 'BRL',
@ -68,7 +68,7 @@ return array(
'num_decimals' => 2,
'weight_unit' => 'kg',
'dimension_unit' => 'cm',
'tax_rates' => array()
'tax_rates' => array(),
),
'CA' => array(
'currency_code' => 'CAD',
@ -86,8 +86,8 @@ return array(
'rate' => '7.0000',
'name' => _x( 'PST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
)
'priority' => 2,
),
),
'SK' => array(
array(
@ -96,8 +96,8 @@ return array(
'rate' => '5.0000',
'name' => _x( 'PST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
)
'priority' => 2,
),
),
'MB' => array(
array(
@ -106,8 +106,8 @@ return array(
'rate' => '8.0000',
'name' => _x( 'PST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
)
'priority' => 2,
),
),
'QC' => array(
array(
@ -116,8 +116,8 @@ return array(
'rate' => '9.975',
'name' => _x( 'QST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => false,
'priority' => 2
)
'priority' => 2,
),
),
'*' => array(
array(
@ -125,94 +125,94 @@ return array(
'state' => 'ON',
'rate' => '13.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NL',
'rate' => '13.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NB',
'rate' => '13.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'PE',
'rate' => '14.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NS',
'rate' => '15.0000',
'name' => _x( 'HST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'AB',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'BC',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NT',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'NU',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'YT',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'SK',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'MB',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
'shipping' => true,
),
array(
'country' => 'CA',
'state' => 'QC',
'rate' => '5.0000',
'name' => _x( 'GST', 'Canadian Tax Rates', 'woocommerce' ),
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'DE' => array(
'currency_code' => 'EUR',
@ -229,10 +229,10 @@ return array(
'state' => '',
'rate' => '19.0000',
'name' => 'Mwst.',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'ES' => array(
'currency_code' => 'EUR',
@ -249,10 +249,10 @@ return array(
'state' => '',
'rate' => '21.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'FR' => array(
'currency_code' => 'EUR',
@ -269,10 +269,10 @@ return array(
'state' => '',
'rate' => '20.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'GB' => array(
'currency_code' => 'GBP',
@ -289,10 +289,10 @@ return array(
'state' => '',
'rate' => '20.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'HU' => array(
'currency_code' => 'HUF',
@ -309,10 +309,10 @@ return array(
'state' => '',
'rate' => '27.0000',
'name' => 'ÁFA',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'IT' => array(
'currency_code' => 'EUR',
@ -329,10 +329,10 @@ return array(
'state' => '',
'rate' => '22.0000',
'name' => 'IVA',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'JP' => array(
'currency_code' => 'JPY',
@ -349,10 +349,10 @@ return array(
'state' => '',
'rate' => '8.0000',
'name' => __( 'Consumption tax', 'woocommerce' ),
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'NL' => array(
'currency_code' => 'EUR',
@ -369,10 +369,10 @@ return array(
'state' => '',
'rate' => '21.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'NO' => array(
'currency_code' => 'Kr',
@ -389,10 +389,10 @@ return array(
'state' => '',
'rate' => '25.0000',
'name' => 'MVA',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'NP' => array(
'currency_code' => 'NPR',
@ -409,10 +409,10 @@ return array(
'state' => '',
'rate' => '13.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'PL' => array(
'currency_code' => 'PLN',
@ -429,10 +429,10 @@ return array(
'state' => '',
'rate' => '23.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'TH' => array(
'currency_code' => 'THB',
@ -449,10 +449,10 @@ return array(
'state' => '',
'rate' => '7.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'TR' => array(
'currency_code' => 'TRY',
@ -469,10 +469,10 @@ return array(
'state' => '',
'rate' => '18.0000',
'name' => 'KDV',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'US' => array(
'currency_code' => 'USD',
@ -489,8 +489,8 @@ return array(
'state' => 'AL',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'AZ' => array(
array(
@ -498,8 +498,8 @@ return array(
'state' => 'AZ',
'rate' => '5.6000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'AR' => array(
array(
@ -507,8 +507,8 @@ return array(
'state' => 'AR',
'rate' => '6.5000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'CA' => array(
array(
@ -516,8 +516,8 @@ return array(
'state' => 'CA',
'rate' => '7.5000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'CO' => array(
array(
@ -525,8 +525,8 @@ return array(
'state' => 'CO',
'rate' => '2.9000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'CT' => array(
array(
@ -534,8 +534,8 @@ return array(
'state' => 'CT',
'rate' => '6.3500',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'DC' => array(
array(
@ -543,8 +543,8 @@ return array(
'state' => 'DC',
'rate' => '5.7500',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'FL' => array(
array(
@ -552,8 +552,8 @@ return array(
'state' => 'FL',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'GA' => array(
array(
@ -561,8 +561,8 @@ return array(
'state' => 'GA',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'GU' => array(
array(
@ -570,8 +570,8 @@ return array(
'state' => 'GU',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'HI' => array(
array(
@ -579,8 +579,8 @@ return array(
'state' => 'HI',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'ID' => array(
array(
@ -588,8 +588,8 @@ return array(
'state' => 'ID',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'IL' => array(
array(
@ -597,8 +597,8 @@ return array(
'state' => 'IL',
'rate' => '6.2500',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'IN' => array(
array(
@ -606,8 +606,8 @@ return array(
'state' => 'IN',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'IA' => array(
array(
@ -615,8 +615,8 @@ return array(
'state' => 'IA',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'KS' => array(
array(
@ -624,8 +624,8 @@ return array(
'state' => 'KS',
'rate' => '6.1500',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'KY' => array(
array(
@ -633,8 +633,8 @@ return array(
'state' => 'KY',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'LA' => array(
array(
@ -642,8 +642,8 @@ return array(
'state' => 'LA',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'ME' => array(
array(
@ -651,8 +651,8 @@ return array(
'state' => 'ME',
'rate' => '5.5000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'MD' => array(
array(
@ -660,8 +660,8 @@ return array(
'state' => 'MD',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'MA' => array(
array(
@ -669,8 +669,8 @@ return array(
'state' => 'MA',
'rate' => '6.2500',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'MI' => array(
array(
@ -678,8 +678,8 @@ return array(
'state' => 'MI',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'MN' => array(
array(
@ -687,8 +687,8 @@ return array(
'state' => 'MN',
'rate' => '6.8750',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'MS' => array(
array(
@ -696,8 +696,8 @@ return array(
'state' => 'MS',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'MO' => array(
array(
@ -705,8 +705,8 @@ return array(
'state' => 'MO',
'rate' => '4.225',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'NE' => array(
array(
@ -714,8 +714,8 @@ return array(
'state' => 'NE',
'rate' => '5.5000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'NV' => array(
array(
@ -723,8 +723,8 @@ return array(
'state' => 'NV',
'rate' => '6.8500',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'NJ' => array(
array(
@ -732,8 +732,8 @@ return array(
'state' => 'NJ',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'NM' => array(
array(
@ -741,8 +741,8 @@ return array(
'state' => 'NM',
'rate' => '5.1250',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'NY' => array(
array(
@ -750,8 +750,8 @@ return array(
'state' => 'NY',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'NC' => array(
array(
@ -759,8 +759,8 @@ return array(
'state' => 'NC',
'rate' => '4.7500',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'ND' => array(
array(
@ -768,8 +768,8 @@ return array(
'state' => 'ND',
'rate' => '5.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'OH' => array(
array(
@ -777,8 +777,8 @@ return array(
'state' => 'OH',
'rate' => '5.7500',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'OK' => array(
array(
@ -786,8 +786,8 @@ return array(
'state' => 'OK',
'rate' => '4.5000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'PA' => array(
array(
@ -795,8 +795,8 @@ return array(
'state' => 'PA',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'PR' => array(
array(
@ -804,8 +804,8 @@ return array(
'state' => 'PR',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'RI' => array(
array(
@ -813,8 +813,8 @@ return array(
'state' => 'RI',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'SC' => array(
array(
@ -822,8 +822,8 @@ return array(
'state' => 'SC',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'SD' => array(
array(
@ -831,8 +831,8 @@ return array(
'state' => 'SD',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'TN' => array(
array(
@ -840,8 +840,8 @@ return array(
'state' => 'TN',
'rate' => '7.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'TX' => array(
array(
@ -849,8 +849,8 @@ return array(
'state' => 'TX',
'rate' => '6.2500',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'UT' => array(
array(
@ -858,8 +858,8 @@ return array(
'state' => 'UT',
'rate' => '5.9500',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'VT' => array(
array(
@ -867,8 +867,8 @@ return array(
'state' => 'VT',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'VA' => array(
array(
@ -876,8 +876,8 @@ return array(
'state' => 'VA',
'rate' => '5.3000',
'name' => 'State Tax',
'shipping' => false
)
'shipping' => false,
),
),
'WA' => array(
array(
@ -885,8 +885,8 @@ return array(
'state' => 'WA',
'rate' => '6.5000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'WV' => array(
array(
@ -894,8 +894,8 @@ return array(
'state' => 'WV',
'rate' => '6.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'WI' => array(
array(
@ -903,8 +903,8 @@ return array(
'state' => 'WI',
'rate' => '5.0000',
'name' => 'State Tax',
'shipping' => true
)
'shipping' => true,
),
),
'WY' => array(
array(
@ -912,10 +912,10 @@ return array(
'state' => 'WY',
'rate' => '4.0000',
'name' => 'State Tax',
'shipping' => true
)
)
)
'shipping' => true,
),
),
),
),
'ZA' => array(
'currency_code' => 'ZAR',
@ -932,9 +932,9 @@ return array(
'state' => '',
'rate' => '14.0000',
'name' => 'VAT',
'shipping' => true
)
)
)
)
'shipping' => true,
),
),
),
),
);

View File

@ -33,5 +33,5 @@ $states['AR'] = array(
'S' => __( 'Santa Fe', 'woocommerce' ),
'G' => __( 'Santiago del Estero', 'woocommerce' ),
'V' => __( 'Tierra del Fuego', 'woocommerce' ),
'T' => __( 'Tucumán', 'woocommerce' )
'T' => __( 'Tucumán', 'woocommerce' ),
);

View File

@ -17,5 +17,5 @@ $states['AU'] = array(
'SA' => __( 'South Australia', 'woocommerce' ),
'TAS' => __( 'Tasmania', 'woocommerce' ),
'VIC' => __( 'Victoria', 'woocommerce' ),
'WA' => __( 'Western Australia', 'woocommerce' )
'WA' => __( 'Western Australia', 'woocommerce' ),
);

View File

@ -73,5 +73,5 @@ $states['BD'] = array(
'SUN' => __( 'Sunamganj', 'woocommerce' ),
'SYL' => __( 'Sylhet', 'woocommerce' ),
'TAN' => __( 'Tangail', 'woocommerce' ),
'THA' => __( 'Thakurgaon', 'woocommerce' )
'THA' => __( 'Thakurgaon', 'woocommerce' ),
);

View File

@ -36,5 +36,5 @@ $states['BR'] = array(
'SC' => __( 'Santa Catarina', 'woocommerce' ),
'SP' => __( 'São Paulo', 'woocommerce' ),
'SE' => __( 'Sergipe', 'woocommerce' ),
'TO' => __( 'Tocantins', 'woocommerce' )
'TO' => __( 'Tocantins', 'woocommerce' ),
);

View File

@ -22,5 +22,5 @@ $states['CA'] = array(
'PE' => __( 'Prince Edward Island', 'woocommerce' ),
'QC' => __( 'Quebec', 'woocommerce' ),
'SK' => __( 'Saskatchewan', 'woocommerce' ),
'YT' => __( 'Yukon Territory', 'woocommerce' )
'YT' => __( 'Yukon Territory', 'woocommerce' ),
);

View File

@ -41,5 +41,5 @@ $states['CN'] = array(
'CN29' => __( 'Ningxia Hui / 宁夏', 'woocommerce' ),
'CN30' => __( 'Macau / 澳门', 'woocommerce' ),
'CN31' => __( 'Tibet / 西藏', 'woocommerce' ),
'CN32' => __( 'Xinjiang / 新疆', 'woocommerce' )
'CN32' => __( 'Xinjiang / 新疆', 'woocommerce' ),
);

View File

@ -61,5 +61,5 @@ $states['ES'] = array(
'VA' => __( 'Valladolid', 'woocommerce' ),
'BI' => __( 'Bizkaia', 'woocommerce' ),
'ZA' => __( 'Zamora', 'woocommerce' ),
'Z' => __( 'Zaragoza', 'woocommerce' )
'Z' => __( 'Zaragoza', 'woocommerce' ),
);

View File

@ -22,5 +22,5 @@ $states['GR'] = array(
'J' => __( 'Πελοπόννησος', 'woocommerce' ),
'K' => __( 'Βόρειο Αιγαίο', 'woocommerce' ),
'L' => __( 'Νότιο Αιγαίο', 'woocommerce' ),
'M' => __( 'Κρήτη', 'woocommerce' )
'M' => __( 'Κρήτη', 'woocommerce' ),
);

View File

@ -12,5 +12,5 @@ global $states;
$states['HK'] = array(
'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ),
'KOWLOON' => __( 'Kowloon', 'woocommerce' ),
'NEW TERRITORIES' => __( 'New Territories', 'woocommerce' )
'NEW TERRITORIES' => __( 'New Territories', 'woocommerce' ),
);

View File

@ -29,5 +29,5 @@ $states['HU'] = array(
'TO' => __( 'Tolna', 'woocommerce' ),
'VA' => __( 'Vas', 'woocommerce' ),
'VE' => __( 'Veszprém', 'woocommerce' ),
'ZA' => __( 'Zala', 'woocommerce' )
'ZA' => __( 'Zala', 'woocommerce' ),
);

View File

@ -43,5 +43,5 @@ $states['ID'] = array(
'MA' => __( 'Maluku', 'woocommerce' ),
'MU' => __( 'Maluku Utara', 'woocommerce' ),
'PA' => __( 'Papua', 'woocommerce' ),
'PB' => __( 'Papua Barat', 'woocommerce' )
'PB' => __( 'Papua Barat', 'woocommerce' ),
);

View File

@ -45,5 +45,5 @@ $states['IN'] = array(
'DD' => __( 'Daman and Diu', 'woocommerce' ),
'DL' => __( 'Delhi', 'woocommerce' ),
'LD' => __( 'Lakshadeep', 'woocommerce' ),
'PY' => __( 'Pondicherry (Puducherry)', 'woocommerce' )
'PY' => __( 'Pondicherry (Puducherry)', 'woocommerce' ),
);

View File

@ -40,5 +40,5 @@ $states['IR'] = array(
'MZN' => __( 'Mazandaran (مازندران)', 'woocommerce' ),
'MKZ' => __( 'Markazi (مرکزی)', 'woocommerce' ),
'HRZ' => __( 'Hormozgan (هرمزگان)', 'woocommerce' ),
'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'woocommerce' )
'SBN' => __( 'Sistan and Baluchestan (سیستان و بلوچستان)', 'woocommerce' ),
);

View File

@ -119,5 +119,5 @@ $states['IT'] = array(
'VR' => __( 'Verona', 'woocommerce' ),
'VV' => __( 'Vibo Valentia', 'woocommerce' ),
'VI' => __( 'Vicenza', 'woocommerce' ),
'VT' => __( 'Viterbo', 'woocommerce' )
'VT' => __( 'Viterbo', 'woocommerce' ),
);

View File

@ -41,5 +41,5 @@ $states['MX'] = array(
'Tlaxcala' => __( 'Tlaxcala', 'woocommerce' ),
'Veracruz' => __( 'Veracruz', 'woocommerce' ),
'Yucatan' => __( 'Yucatán', 'woocommerce' ),
'Zacatecas' => __( 'Zacatecas', 'woocommerce' )
'Zacatecas' => __( 'Zacatecas', 'woocommerce' ),
);

View File

@ -25,5 +25,5 @@ $states['MY'] = array(
'SGR' => __( 'Selangor', 'woocommerce' ),
'TRG' => __( 'Terengganu', 'woocommerce' ),
'PJY' => __( 'Putrajaya', 'woocommerce' ),
'KUL' => __( 'Kuala Lumpur', 'woocommerce' )
'KUL' => __( 'Kuala Lumpur', 'woocommerce' ),
);

View File

@ -23,5 +23,5 @@ $states['NP'] = array(
'NAR' => __( 'Narayani', 'woocommerce' ),
'RAP' => __( 'Rapti', 'woocommerce' ),
'SAG' => __( 'Sagarmatha', 'woocommerce' ),
'SET' => __( 'Seti', 'woocommerce' )
'SET' => __( 'Seti', 'woocommerce' ),
);

View File

@ -35,5 +35,5 @@ $states['PE'] = array(
'SAM' => __( 'San Martín', 'woocommerce' ),
'TAC' => __( 'Tacna', 'woocommerce' ),
'TUM' => __( 'Tumbes', 'woocommerce' ),
'UCA' => __( 'Ucayali', 'woocommerce' )
'UCA' => __( 'Ucayali', 'woocommerce' ),
);

View File

@ -86,5 +86,5 @@ $states['TH'] = array(
'TH-61' => __( 'Uthai Thani (อุทัยธานี)', 'woocommerce' ),
'TH-53' => __( 'Uttaradit (อุตรดิตถ์)', 'woocommerce' ),
'TH-95' => __( 'Yala (ยะลา)', 'woocommerce' ),
'TH-35' => __( 'Yasothon (ยโสธร)', 'woocommerce' )
'TH-35' => __( 'Yasothon (ยโสธร)', 'woocommerce' ),
);

View File

@ -18,5 +18,5 @@ $states['ZA'] = array(
'MP' => __( 'Mpumalanga', 'woocommerce' ),
'NC' => __( 'Northern Cape', 'woocommerce' ),
'NW' => __( 'North West', 'woocommerce' ),
'WC' => __( 'Western Cape', 'woocommerce' )
'WC' => __( 'Western Cape', 'woocommerce' ),
);

View File

@ -51,9 +51,15 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* @var array
*/
protected $_internal_meta_keys = array(
'_order_currency', '_cart_discount',
'_cart_discount_tax', '_order_shipping', '_order_shipping_tax',
'_order_tax', '_order_total', '_order_version', '_prices_include_tax',
'_order_currency',
'_cart_discount',
'_cart_discount_tax',
'_order_shipping',
'_order_shipping_tax',
'_order_tax',
'_order_total',
'_order_version',
'_prices_include_tax',
'_payment_tokens',
);
@ -243,7 +249,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
'post_parent' => $this->get_parent_id(),
),
array(
'ID' => $order_id
'ID' => $order_id,
)
);
@ -625,7 +631,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
return array(
'from' => $old_status,
'to' => $new_status
'to' => $new_status,
);
}
@ -1428,7 +1434,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
$subtotal = wc_price( $this->get_line_subtotal( $item ), array( 'ex_tax_label' => $ex_tax_label, 'currency' => $this->get_currency() ) );
} else {
$subtotal = wc_price( $this->get_line_subtotal( $item, true ), array('currency' => $this->get_currency()) );
$subtotal = wc_price( $this->get_line_subtotal( $item, true ), array( 'currency' => $this->get_currency() ) );
}
return apply_filters( 'woocommerce_order_formatted_line_subtotal', $subtotal, $item, $this );
@ -1468,7 +1474,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( 'excl' === $tax_display && $this->get_prices_include_tax() ) {
$subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
}
} else {
if ( 'incl' === $tax_display ) {
return '';
@ -1510,21 +1515,19 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
if ( $tax_display == 'excl' ) {
// Show shipping excluding tax.
$shipping = wc_price( $this->get_shipping_total(), array('currency' => $this->get_currency()) );
$shipping = wc_price( $this->get_shipping_total(), array( 'currency' => $this->get_currency() ) );
if ( $this->get_shipping_tax() != 0 && $this->get_prices_include_tax() ) {
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', '&nbsp;<small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>', $this, $tax_display );
}
} else {
// Show shipping including tax.
$shipping = wc_price( $this->get_shipping_total() + $this->get_shipping_tax(), array('currency' => $this->get_currency()) );
$shipping = wc_price( $this->get_shipping_total() + $this->get_shipping_tax(), array( 'currency' => $this->get_currency() ) );
if ( $this->get_shipping_tax() != 0 && ! $this->get_prices_include_tax() ) {
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', '&nbsp;<small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>', $this, $tax_display );
}
}
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_shipped_via', '&nbsp;<small class="shipped_via">' . sprintf( __( 'via %s', 'woocommerce' ), $this->get_shipping_method() ) . '</small>', $this );
@ -1586,7 +1589,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
}
$total_rows[ 'fee_' . $fee->get_id() ] = array(
'label' => $fee->get_name() . ':',
'value' => wc_price( 'excl' === $tax_display ? $fee->get_total() : $fee->get_total() + $fee->get_total_tax(), array('currency' => $this->get_currency()) )
'value' => wc_price( 'excl' === $tax_display ? $fee->get_total() : $fee->get_total() + $fee->get_total_tax(), array( 'currency' => $this->get_currency() ) ),
);
}
}
@ -1603,7 +1606,6 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
'value' => $tax->formatted_amount,
);
}
} else {
$total_rows['tax'] = array(

View File

@ -294,5 +294,4 @@ if ( ! defined( 'ABSPATH' ) ) {
$wpdb->delete( $wpdb->prefix . 'woocommerce_payment_tokenmeta', array( 'payment_token_id' => $this->get_id() ), array( '%d' ) );
do_action( 'woocommerce_payment_token_deleted', $this->get_id(), $this );
}
}

View File

@ -400,7 +400,7 @@ class WC_Product {
if ( ! is_array( $file ) ) {
$downloadable_files[ $key ] = array(
'file' => $file,
'name' => ''
'name' => '',
);
}
@ -895,9 +895,7 @@ class WC_Product {
$price = $price * $qty;
}
}
} else {
$price = $price * $qty;
}
@ -970,12 +968,12 @@ class WC_Product {
$find = array(
'{price_including_tax}',
'{price_excluding_tax}'
'{price_excluding_tax}',
);
$replace = array(
wc_price( $this->get_price_including_tax( $qty, $price ) ),
wc_price( $this->get_price_excluding_tax( $qty, $price ) )
wc_price( $this->get_price_excluding_tax( $qty, $price ) ),
);
$price_display_suffix = str_replace( $find, $replace, $price_display_suffix );
@ -1010,7 +1008,6 @@ class WC_Product {
$price = apply_filters( 'woocommerce_price_html', $price, $this );
}
} elseif ( $this->get_price() === '' ) {
$price = apply_filters( 'woocommerce_empty_price_html', '', $this );
@ -1274,7 +1271,6 @@ class WC_Product {
} else {
$this->shipping_class = '';
}
}
return $this->shipping_class;
@ -1329,7 +1325,7 @@ class WC_Product {
$cats_array = $this->get_related_terms( 'product_cat' );
// Don't bother if none are set
if ( 1 === sizeof( $cats_array ) && 1 === sizeof( $tags_array )) {
if ( 1 === sizeof( $cats_array ) && 1 === sizeof( $tags_array ) ) {
$related_posts = array();
} else {
// Sanitize
@ -1376,7 +1372,6 @@ class WC_Product {
return $attribute['value'];
}
}
return '';
@ -1524,7 +1519,7 @@ class WC_Product {
*/
public function list_attributes() {
wc_get_template( 'single-product/product-attributes.php', array(
'product' => $this
'product' => $this,
) );
}
@ -1590,7 +1585,7 @@ class WC_Product {
* @return array
*/
protected function get_related_terms( $term ) {
$terms_array = array(0);
$terms_array = array( 0 );
$terms = apply_filters( 'woocommerce_get_related_' . $term . '_terms', wp_get_post_terms( $this->id, $term ), $this->id );
foreach ( $terms as $term ) {

View File

@ -838,7 +838,7 @@ abstract class WC_Settings_API {
return wp_kses( trim( stripslashes( $value ) ),
array_merge(
array(
'iframe' => array( 'src' => true, 'style' => true, 'id' => true, 'class' => true )
'iframe' => array( 'src' => true, 'style' => true, 'id' => true, 'class' => true ),
),
wp_kses_allowed_html( 'post' )
)

View File

@ -52,7 +52,7 @@ abstract class WC_Widget extends WP_Widget {
$widget_ops = array(
'classname' => $this->widget_cssclass,
'description' => $this->widget_description,
'customize_selective_refresh' => true
'customize_selective_refresh' => true,
);
parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );

View File

@ -25,7 +25,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'key', 'woocommerce' ),
'plural' => __( 'keys', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -41,7 +41,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
'truncated_key' => __( 'Consumer Key Ending In', 'woocommerce' ),
'user' => __( 'User', 'woocommerce' ),
'permissions' => __( 'Permissions', 'woocommerce' ),
'last_access' => __( 'Last Access', 'woocommerce' )
'last_access' => __( 'Last Access', 'woocommerce' ),
);
}
@ -78,7 +78,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$actions = array(
'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $key['key_id'] ),
'edit' => '<a href="' . esc_url( $url ) . '">' . __( 'View/Edit', 'woocommerce' ) . '</a>',
'trash' => '<a class="submitdelete" title="' . esc_attr__( 'Revoke API Key', 'woocommerce' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'revoke-key' => $key['key_id'] ), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ), 'revoke' ) ) . '">' . __( 'Revoke', 'woocommerce' ) . '</a>'
'trash' => '<a class="submitdelete" title="' . esc_attr__( 'Revoke API Key', 'woocommerce' ) . '" href="' . esc_url( wp_nonce_url( add_query_arg( array( 'revoke-key' => $key['key_id'] ), admin_url( 'admin.php?page=wc-settings&tab=api&section=keys' ) ), 'revoke' ) ) . '">' . __( 'Revoke', 'woocommerce' ) . '</a>',
);
$row_actions = array();
@ -133,7 +133,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$permissions = array(
'read' => __( 'Read', 'woocommerce' ),
'write' => __( 'Write', 'woocommerce' ),
'read_write' => __( 'Read/Write', 'woocommerce' )
'read_write' => __( 'Read/Write', 'woocommerce' ),
);
if ( isset( $permissions[ $permission_key ] ) ) {
@ -166,7 +166,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
*/
protected function get_bulk_actions() {
return array(
'revoke' => __( 'Revoke', 'woocommerce' )
'revoke' => __( 'Revoke', 'woocommerce' ),
);
}
@ -211,7 +211,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $count,
'per_page' => $per_page,
'total_pages' => ceil( $count / $per_page )
'total_pages' => ceil( $count / $per_page ),
) );
}
}

View File

@ -87,7 +87,7 @@ class WC_Admin_API_Keys {
'description' => '',
'permissions' => '',
'truncated_key' => '',
'last_access' => ''
'last_access' => '',
);
if ( 0 == $key_id ) {

View File

@ -123,12 +123,12 @@ class WC_Admin_Assets {
'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'search_products_nonce' => wp_create_nonce( 'search-products' ),
'search_customers_nonce' => wp_create_nonce( 'search-customers' )
'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
) );
// Accounting
wp_localize_script( 'accounting', 'accounting_params', array(
'mon_decimal_point' => wc_get_price_decimal_separator()
'mon_decimal_point' => wc_get_price_decimal_separator(),
) );
// WooCommerce admin pages
@ -148,7 +148,7 @@ class WC_Admin_Assets {
'i18n_country_iso_error' => __( 'Please enter in country code with two capital letters.', 'woocommerce' ),
'i18_sale_less_than_regular_error' => __( 'Please enter in a value less than the regular price.', 'woocommerce' ),
'decimal_point' => $decimal,
'mon_decimal_point' => wc_get_price_decimal_separator()
'mon_decimal_point' => wc_get_price_decimal_separator(),
);
wp_localize_script( 'woocommerce_admin', 'woocommerce_admin', $params );
@ -202,7 +202,7 @@ class WC_Admin_Assets {
'i18n_edited_variations' => esc_js( __( 'Save changes before changing page?', 'woocommerce' ) ),
'i18n_variation_count_single' => esc_js( __( '%qty% variation', 'woocommerce' ) ),
'i18n_variation_count_plural' => esc_js( __( '%qty% variations', 'woocommerce' ) ),
'variations_per_page' => absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) )
'variations_per_page' => absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 15 ) ),
);
wp_localize_script( 'wc-admin-variation-meta-boxes', 'woocommerce_admin_meta_boxes_variations', $params );
@ -213,7 +213,7 @@ class WC_Admin_Assets {
$params = array(
'countries' => json_encode( array_merge( WC()->countries->get_allowed_country_states(), WC()->countries->get_shipping_country_states() ) ),
'i18n_select_state_text' => esc_attr__( 'Select an option&hellip;', 'woocommerce' )
'i18n_select_state_text' => esc_attr__( 'Select an option&hellip;', 'woocommerce' ),
);
wp_localize_script( 'wc-admin-order-meta-boxes', 'woocommerce_admin_meta_boxes_order', $params );
@ -284,7 +284,7 @@ class WC_Admin_Assets {
'i18n_permission_revoke' => __( 'Are you sure you want to revoke access to this download?', 'woocommerce' ),
'i18n_tax_rate_already_exists' => __( 'You cannot add the same tax rate twice!', 'woocommerce' ),
'i18n_product_type_alert' => __( 'Your product has variations! Before changing the product type, it is a good idea to delete the variations to avoid errors in the stock reports.', 'woocommerce' ),
'i18n_delete_note' => __( 'Are you sure you wish to delete this note? This action cannot be undone.', 'woocommerce' )
'i18n_delete_note' => __( 'Are you sure you wish to delete this note? This action cannot be undone.', 'woocommerce' ),
);
wp_localize_script( 'wc-admin-meta-boxes', 'woocommerce_admin_meta_boxes', $params );
@ -299,7 +299,7 @@ class WC_Admin_Assets {
$taxonomy = isset( $_GET['taxonomy'] ) ? wc_clean( $_GET['taxonomy'] ) : '';
$woocommerce_term_order_params = array(
'taxonomy' => $taxonomy
'taxonomy' => $taxonomy,
);
wp_localize_script( 'woocommerce_term_ordering', 'woocommerce_term_ordering_params', $woocommerce_term_order_params );
@ -367,9 +367,9 @@ class WC_Admin_Assets {
if ( ! current_user_can( 'manage_woocommerce' ) ) return;
?>
<style type="text/css">
<?php if ( isset($_GET['taxonomy']) && $_GET['taxonomy']=='product_cat' ) : ?>
<?php if ( isset( $_GET['taxonomy'] ) && 'product_cat' === $_GET['taxonomy'] ) : ?>
.icon32-posts-product { background-position: -243px -5px !important; }
<?php elseif ( isset($_GET['taxonomy']) && $_GET['taxonomy']=='product_tag' ) : ?>
<?php elseif ( isset( $_GET['taxonomy'] ) && 'product_tag' === $_GET['taxonomy'] ) : ?>
.icon32-posts-product { background-position: -301px -5px !important; }
<?php endif; ?>
</style>

View File

@ -72,7 +72,7 @@ class WC_Admin_Attributes {
'attribute_name' => isset( $_POST['attribute_name'] ) ? wc_sanitize_taxonomy_name( stripslashes( $_POST['attribute_name'] ) ) : '',
'attribute_type' => isset( $_POST['attribute_type'] ) ? wc_clean( $_POST['attribute_type'] ) : 'select',
'attribute_orderby' => isset( $_POST['attribute_orderby'] ) ? wc_clean( $_POST['attribute_orderby'] ) : '',
'attribute_public' => isset( $_POST['attribute_public'] ) ? 1 : 0
'attribute_public' => isset( $_POST['attribute_public'] ) ? 1 : 0,
);
if ( empty( $attribute['attribute_type'] ) ) {

View File

@ -200,7 +200,6 @@ class WC_Admin_Dashboard {
echo '<p>' . __( 'There are no product reviews yet.', 'woocommerce' ) . '</p>';
}
}
}
endif;

View File

@ -156,7 +156,7 @@ class WC_Admin_Duplicate_Product {
'post_modified_gmt' => $new_post_date_gmt,
'post_parent' => $post_parent,
'menu_order' => $post->menu_order,
'post_mime_type' => $post->post_mime_type
'post_mime_type' => $post->post_mime_type,
)
);
@ -171,7 +171,7 @@ class WC_Admin_Duplicate_Product {
'post_title' => $post_title,
),
array(
'ID' => $new_post_id
'ID' => $new_post_id,
)
);
}
@ -185,7 +185,7 @@ class WC_Admin_Duplicate_Product {
'guid' => get_permalink( $new_post_id ),
),
array(
'ID' => $new_post_id
'ID' => $new_post_id,
)
);
}

View File

@ -39,116 +39,116 @@ class WC_Admin_Help {
$video_map = array(
'wc-settings' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true',
),
'wc-settings-general' => array(
'title' => __( 'General Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/mz2l10u5f6?videoFoam=true',
),
'wc-settings-products' => array(
'title' => __( 'Product Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/lolkan4fxf?videoFoam=true',
),
'wc-settings-tax' => array(
'title' => __( 'Tax Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/qp1v19dwrh?videoFoam=true',
),
'wc-settings-shipping' => array(
'title' => __( 'Shipping Zones', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/95yiocro6p?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/95yiocro6p?videoFoam=true',
),
'wc-settings-shipping-options' => array(
'title' => __( 'Shipping Options', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/9c9008dxnr?videoFoam=true',
),
'wc-settings-shipping-classes' => array(
'title' => __( 'Shipping Classes', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/tpqg17aq99?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/tpqg17aq99?videoFoam=true',
),
'wc-settings-checkout' => array(
'title' => __( 'Checkout Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/65yjv96z51?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/65yjv96z51?videoFoam=true',
),
'wc-settings-checkout-bacs' => array(
'title' => __( 'Bank Transfer (BACS) Payments', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/dh4piy3sek?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/dh4piy3sek?videoFoam=true',
),
'wc-settings-checkout-cheque' => array(
'title' => __( 'Check Payments', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/u2m2kcakea?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/u2m2kcakea?videoFoam=true',
),
'wc-settings-checkout-cod' => array(
'title' => __( 'Cash on Delivery', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/8hyli8wu5f?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/8hyli8wu5f?videoFoam=true',
),
'wc-settings-checkout-paypal' => array(
'title' => __( 'PayPal Standard', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/rbl7e7l4k2?videoFoam=true',
),
'wc-settings-checkout-paypalbraintree_cards' => array(
'title' => __( 'PayPal by Braintree', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/oyksirgn40?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/oyksirgn40?videoFoam=true',
),
'wc-settings-checkout-stripe' => array(
'title' => __( 'Stripe', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/mf975hx5de?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/mf975hx5de?videoFoam=true',
),
'wc-settings-checkout-simplify_commerce' => array(
'title' => __( 'Simplify Commerce', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/jdfzjiiw61?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/jdfzjiiw61?videoFoam=true',
),
'wc-settings-account' => array(
'title' => __( 'Account Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/35mazq7il2?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/35mazq7il2?videoFoam=true',
),
'wc-settings-email' => array(
'title' => __( 'Email Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/svcaftq4xv?videoFoam=true',
),
'wc-settings-api' => array(
'title' => __( 'Webhook Settings', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/1q0ny74vvq?videoFoam=true',
),
'product' => array(
'title' => __( 'Simple Products', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/ziyjmd4kut?videoFoam=true',
),
'edit-product_cat' => array(
'title' => __( 'Product Categories', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
),
'edit-product_tag' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, &amp; Attributes', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
),
'product_attributes' => array(
'title' => __( 'Product Categories, Tags, Shipping Classes, &amp; Attributes', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/f0j5gzqigg?videoFoam=true',
),
'wc-status' => array(
'title' => __( 'System Status', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/xdn733nnhi?videoFoam=true',
),
'wc-reports' => array(
'title' => __( 'Reports', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/6aasex0w99?videoFoam=true',
),
'edit-shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true',
),
'shop_coupon' => array(
'title' => __( 'Coupons', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/gupd4h8sit?videoFoam=true',
),
'edit-shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true',
),
'shop_order' => array(
'title' => __( 'Managing Orders', 'woocommerce' ),
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true'
)
'url' => '//fast.wistia.net/embed/iframe/n8n0sa8hee?videoFoam=true',
),
);
$page = empty( $_GET['page'] ) ? '' : sanitize_title( $_GET['page'] );
@ -172,7 +172,7 @@ class WC_Admin_Help {
'title' => __( 'WooCommerce 101', 'woocommerce' ),
'content' =>
'<h2><a href="https://docs.woocommerce.com/document/woocommerce-101-video-series/?utm_source=helptab&utm_medium=product&utm_content=videos&utm_campaign=woocommerceplugin">' . __( 'WooCommerce 101', 'woocommerce' ) . '</a> &ndash; ' . esc_html( $video_map[ $video_key ]['title'] ) . '</h2>' .
'<iframe data-src="' . esc_url( $video_map[ $video_key ]['url'] ) . '" src="" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="480" height="298"></iframe>'
'<iframe data-src="' . esc_url( $video_map[ $video_key ]['url'] ) . '" src="" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="480" height="298"></iframe>',
) );
}
@ -194,7 +194,7 @@ class WC_Admin_Help {
'</a>'
) . '</p>' .
'<p>' . __( 'Before asking for help we recommend checking the system status page to identify any problems with your configuration.', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System Status', 'woocommerce' ) . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'Community Forum', 'woocommerce' ) . '</a> <a href="' . 'https://woocommerce.com/my-account/tickets/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin' . '" class="button">' . __( 'WooCommerce Helpdesk', 'woocommerce' ) . '</a></p>'
'<p><a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button button-primary">' . __( 'System Status', 'woocommerce' ) . '</a> <a href="' . 'https://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'Community Forum', 'woocommerce' ) . '</a> <a href="' . 'https://woocommerce.com/my-account/tickets/?utm_source=helptab&utm_medium=product&utm_content=tickets&utm_campaign=woocommerceplugin' . '" class="button">' . __( 'WooCommerce Helpdesk', 'woocommerce' ) . '</a></p>',
) );
$screen->add_help_tab( array(
@ -203,7 +203,7 @@ class WC_Admin_Help {
'content' =>
'<h2>' . __( 'Found a bug?', 'woocommerce' ) . '</h2>' .
'<p>' . sprintf( __( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%s">Github issues</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. To help us solve your issue, please be as descriptive as possible and include your <a href="%s">system status report</a>.', 'woocommerce' ), 'https://github.com/woothemes/woocommerce/issues?state=open', 'https://github.com/woothemes/woocommerce/blob/master/.github/CONTRIBUTING.md', admin_url( 'admin.php?page=wc-status' ) ) . '</p>' .
'<p><a href="' . 'https://github.com/woothemes/woocommerce/issues?state=open' . '" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>'
'<p><a href="' . 'https://github.com/woothemes/woocommerce/issues?state=open' . '" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url( 'admin.php?page=wc-status' ) . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>',
) );
@ -213,7 +213,7 @@ class WC_Admin_Help {
'content' =>
'<h2>' . __( 'Education', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'If you would like to learn about using WooCommerce from an expert, consider following a WooCommerce course offered by one of our educational partners.', 'woocommerce' ) . '</p>' .
'<p><a href="' . 'https://woocommerce.com/educational-partners/?utm_source=helptab&utm_medium=product&utm_content=edupartners&utm_campaign=woocommerceplugin' . '" class="button button-primary">' . __( 'View Education Partners', 'woocommerce' ) . '</a></p>'
'<p><a href="' . 'https://woocommerce.com/educational-partners/?utm_source=helptab&utm_medium=product&utm_content=edupartners&utm_campaign=woocommerceplugin' . '" class="button button-primary">' . __( 'View Education Partners', 'woocommerce' ) . '</a></p>',
) );
$screen->add_help_tab( array(
@ -222,7 +222,7 @@ class WC_Admin_Help {
'content' =>
'<h2>' . __( 'Setup Wizard', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'If you need to access the setup wizard again, please click on the button below.', 'woocommerce' ) . '</p>' .
'<p><a href="' . admin_url( 'index.php?page=wc-setup' ) . '" class="button button-primary">' . __( 'Setup Wizard', 'woocommerce' ) . '</a></p>'
'<p><a href="' . admin_url( 'index.php?page=wc-setup' ) . '" class="button button-primary">' . __( 'Setup Wizard', 'woocommerce' ) . '</a></p>',
) );
@ -235,7 +235,6 @@ class WC_Admin_Help {
'<p><a href="' . 'https://woocommerce.com/product-category/woocommerce-extensions/?utm_source=helptab&utm_medium=product&utm_content=wcextensions&utm_campaign=woocommerceplugin' . '" target="_blank">' . __( 'Official Extensions', 'woocommerce' ) . '</a></p>'
);
}
}
endif;

View File

@ -94,7 +94,7 @@ class WC_Admin_Importers {
'attribute_name' => $attribute_name,
'attribute_type' => 'select',
'attribute_orderby' => 'menu_order',
'attribute_public' => 0
'attribute_public' => 0,
);
$wpdb->insert( $wpdb->prefix . 'woocommerce_attribute_taxonomies', $attribute );
delete_transient( 'wc_attribute_taxonomies' );

View File

@ -178,7 +178,6 @@ class WC_Admin_Menus {
} elseif ( ! in_array( $item, array( 'separator-woocommerce' ) ) ) {
$woocommerce_menu_order[] = $item;
}
}
// Return order
@ -325,7 +324,7 @@ class WC_Admin_Menus {
'parent' => 'site-name',
'id' => 'view-store',
'title' => __( 'Visit Store', 'woocommerce' ),
'href' => wc_get_page_permalink( 'shop' )
'href' => wc_get_page_permalink( 'shop' ),
) );
}
}

View File

@ -210,7 +210,6 @@ class WC_Admin_Meta_Boxes {
do_action( 'woocommerce_process_' . $post->post_type . '_meta', $post_id, $post );
}
}
}
new WC_Admin_Meta_Boxes();

View File

@ -235,7 +235,7 @@ class WC_Admin_Notices {
$theme_file = get_stylesheet_directory() . '/woocommerce/' . $file;
} elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
$theme_file = get_template_directory() . '/' . $file;
} elseif( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) {
} elseif ( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) {
$theme_file = get_template_directory() . '/woocommerce/' . $file;
}

View File

@ -106,7 +106,7 @@ class WC_Admin_Permalink_Settings {
$structures = array(
0 => '',
1 => '/' . trailingslashit( $base_slug ),
2 => '/' . trailingslashit( $base_slug ) . trailingslashit( '%product_cat%' )
2 => '/' . trailingslashit( $base_slug ) . trailingslashit( '%product_cat%' ),
);
?>
<table class="form-table wc-permalink-structure">

View File

@ -54,162 +54,162 @@ class WC_Admin_Pointers {
'next' => 'content',
'next_trigger' => array(
'target' => '#title',
'event' => 'input'
'event' => 'input',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Name', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Product Name', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Give your new product a name here. This is a required field and will be what your customers will see in your store.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'top',
'align' => 'left'
)
)
'align' => 'left',
),
),
),
'content' => array(
'target' => "#wp-content-editor-container",
'next' => 'product-type',
'next_trigger' => array(),
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Description', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Product Description', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'This is your products main body of content. Here you should describe your product in detail.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'product-type' => array(
'target' => "#product-type",
'next' => 'virtual',
'next_trigger' => array(
'target' => "#product-type",
'event' => 'change blur click'
'event' => 'change blur click',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Choose Product Type', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Choose Product Type', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Choose a type for this product. Simple is suitable for most physical goods and services (we recommend setting up a simple product for now).', 'woocommerce' ) . '</p>' .
'<p>' . esc_html__( 'Variable is for more complex products such as t-shirts with multiple sizes.', 'woocommerce' ) . '</p>' .
'<p>' . esc_html__( 'Grouped products are for grouping several simple products into one.', 'woocommerce' ) . '</p>' .
'<p>' . esc_html__( 'Finally, external products are for linking off-site.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'virtual' => array(
'target' => "#_virtual",
'next' => 'downloadable',
'next_trigger' => array(
'target' => "#_virtual",
'event' => 'change'
'event' => 'change',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Virtual Products', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Virtual Products', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Check the "Virtual" box if this is a non-physical item, for example a service, which does not need shipping.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'downloadable' => array(
'target' => "#_downloadable",
'next' => 'regular_price',
'next_trigger' => array(
'target' => "#_downloadable",
'event' => 'change'
'event' => 'change',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Downloadable Products', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Downloadable Products', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'If purchasing this product gives a customer access to a downloadable file, e.g. software, check this box.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'regular_price' => array(
'target' => "#_regular_price",
'next' => 'postexcerpt',
'next_trigger' => array(
'target' => "#_regular_price",
'event' => 'input'
'event' => 'input',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Prices', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Prices', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Next you\'ll need to give your product a price.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'postexcerpt' => array(
'target' => "#postexcerpt",
'next' => 'postimagediv',
'next_trigger' => array(
'target' => "#postexcerpt",
'event' => 'input'
'event' => 'input',
),
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Short Description', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Product Short Description', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Add a quick summary for your product here. This will appear on the product page under the product name.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'bottom',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'postimagediv' => array(
'target' => "#postimagediv",
'next' => 'product_tag',
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Images', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Product Images', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Upload or assign an image to your product here. This image will be shown in your store\'s catalog.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'product_tag' => array(
'target' => "#tagsdiv-product_tag",
'next' => 'product_catdiv',
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Tags', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Product Tags', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'You can optionally "tag" your products here. Tags as a method of labeling your products to make them easier for customers to find.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'product_catdiv' => array(
'target' => "#product_catdiv",
'next' => 'submitdiv',
'options' => array(
'content' => '<h3>' . esc_html__( 'Product Categories', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Product Categories', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'Optionally assign categories to your products to make them easier to browse through and find in your store.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
'align' => 'middle',
),
),
),
'submitdiv' => array(
'target' => "#submitdiv",
'next' => '',
'options' => array(
'content' => '<h3>' . esc_html__( 'Publish Your Product!', 'woocommerce' ) . '</h3>' .
'content' => '<h3>' . esc_html__( 'Publish Your Product!', 'woocommerce' ) . '</h3>' .
'<p>' . esc_html__( 'When you are finished editing your product, hit the "Publish" button to publish your product to your store.', 'woocommerce' ) . '</p>',
'position' => array(
'edge' => 'right',
'align' => 'middle'
)
)
)
)
'align' => 'middle',
),
),
),
),
);
$this->enqueue_pointers( $pointers );

View File

@ -150,7 +150,7 @@ class WC_Admin_Post_Types {
9 => sprintf( __( 'Order scheduled for: <strong>%1$s</strong>.', 'woocommerce' ),
date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) ),
10 => __( 'Order draft updated.', 'woocommerce' ),
11 => __( 'Order updated and email sent.', 'woocommerce' )
11 => __( 'Order updated and email sent.', 'woocommerce' ),
);
$messages['shop_coupon'] = array(
@ -165,7 +165,7 @@ class WC_Admin_Post_Types {
8 => __( 'Coupon submitted.', 'woocommerce' ),
9 => sprintf( __( 'Coupon scheduled for: <strong>%1$s</strong>.', 'woocommerce' ),
date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) ),
10 => __( 'Coupon draft updated.', 'woocommerce' )
10 => __( 'Coupon draft updated.', 'woocommerce' ),
);
return $messages;
@ -365,7 +365,6 @@ class WC_Admin_Post_Types {
} else {
echo '<span class="product-type tips simple" data-tip="' . esc_attr__( 'Simple', 'woocommerce' ) . '"></span>';
}
} elseif ( 'variable' == $the_product->product_type ) {
echo '<span class="product-type tips variable" data-tip="' . esc_attr__( 'Variable', 'woocommerce' ) . '"></span>';
} else {
@ -706,7 +705,7 @@ class WC_Admin_Post_Types {
$latest_notes = get_comments( array(
'post_id' => $post->ID,
'number' => 1,
'status' => $status
'status' => $status,
) );
$latest_note = current( $latest_notes );
@ -718,7 +717,6 @@ class WC_Admin_Post_Types {
} else {
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( sprintf( _n( '%d note', '%d notes', $post->comment_count, 'woocommerce' ), $post->comment_count ) ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
}
} else {
echo '<span class="na">&ndash;</span>';
}
@ -780,7 +778,7 @@ class WC_Admin_Post_Types {
$actions['processing'] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=processing&order_id=' . $post->ID ), 'woocommerce-mark-order-status' ),
'name' => __( 'Processing', 'woocommerce' ),
'action' => "processing"
'action' => "processing",
);
}
@ -788,14 +786,14 @@ class WC_Admin_Post_Types {
$actions['complete'] = array(
'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=completed&order_id=' . $post->ID ), 'woocommerce-mark-order-status' ),
'name' => __( 'Complete', 'woocommerce' ),
'action' => "complete"
'action' => "complete",
);
}
$actions['view'] = array(
'url' => admin_url( 'post.php?post=' . $post->ID . '&action=edit' ),
'name' => __( 'View', 'woocommerce' ),
'action' => "view"
'action' => "view",
);
$actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $the_order );
@ -823,7 +821,7 @@ class WC_Admin_Post_Types {
'price' => 'price',
'featured' => array( 'featured', 1 ),
'sku' => 'sku',
'name' => 'title'
'name' => 'title',
);
return wp_parse_args( $custom, $columns );
}
@ -848,7 +846,7 @@ class WC_Admin_Post_Types {
$custom = array(
'order_title' => 'ID',
'order_total' => 'order_total',
'order_date' => 'date'
'order_date' => 'date',
);
unset( $columns['comments'] );
@ -1400,7 +1398,6 @@ class WC_Admin_Post_Types {
if ( ! empty( $_REQUEST['_backorders'] ) ) {
update_post_meta( $post_id, '_backorders', wc_clean( $_REQUEST['_backorders'] ) );
}
}
do_action( 'woocommerce_product_bulk_edit_save', $product );
@ -1575,7 +1572,7 @@ class WC_Admin_Post_Types {
$this->shop_order_filters();
} elseif ( 'product' == $typenow ) {
$this->product_filters();
} elseif( 'shop_coupon' == $typenow ) {
} elseif ( 'shop_coupon' == $typenow ) {
$this->shop_coupon_filters();
}
}
@ -1703,30 +1700,28 @@ class WC_Admin_Post_Types {
if ( 'price' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_price',
'orderby' => 'meta_value_num'
'orderby' => 'meta_value_num',
) );
}
if ( 'featured' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_featured',
'orderby' => 'meta_value'
'orderby' => 'meta_value',
) );
}
if ( 'sku' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_sku',
'orderby' => 'meta_value'
'orderby' => 'meta_value',
) );
}
}
} elseif ( 'shop_coupon' === $typenow ) {
if ( ! empty( $_GET['coupon_type'] ) ) {
$vars['meta_key'] = 'discount_type';
$vars['meta_value'] = wc_clean( $_GET['coupon_type'] );
}
} elseif ( in_array( $typenow, wc_get_order_types( 'order-meta-boxes' ) ) ) {
// Filter the orders by the posted customer.
@ -1735,8 +1730,8 @@ class WC_Admin_Post_Types {
array(
'key' => '_customer_user',
'value' => (int) $_GET['_customer_user'],
'compare' => '='
)
'compare' => '=',
),
);
}
@ -1745,7 +1740,7 @@ class WC_Admin_Post_Types {
if ( 'order_total' == $vars['orderby'] ) {
$vars = array_merge( $vars, array(
'meta_key' => '_order_total',
'orderby' => 'meta_value_num'
'orderby' => 'meta_value_num',
) );
}
}
@ -1798,7 +1793,7 @@ class WC_Admin_Post_Types {
'taxonomy' => 'product_cat',
'field' => 'id',
'terms' => get_terms( 'product_cat', array( 'fields' => 'ids' ) ),
'operator' => 'NOT IN'
'operator' => 'NOT IN',
);
}
@ -1808,7 +1803,7 @@ class WC_Admin_Post_Types {
'taxonomy' => 'product_shipping_class',
'field' => 'id',
'terms' => get_terms( 'product_shipping_class', array( 'fields' => 'ids' ) ),
'operator' => 'NOT IN'
'operator' => 'NOT IN',
);
}
}
@ -1954,7 +1949,6 @@ class WC_Admin_Post_Types {
delete_transient( 'woocommerce_processing_order_count' );
wc_delete_shop_order_transients( $id );
}
}
}
@ -2101,7 +2095,7 @@ class WC_Admin_Post_Types {
'visible' => __( 'Catalog/search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' )
'hidden' => __( 'Hidden', 'woocommerce' ),
) );
?>
<div class="misc-pub-section" id="catalog-visibility">

View File

@ -42,99 +42,99 @@ class WC_Admin_Profile {
'fields' => array(
'billing_first_name' => array(
'label' => __( 'First name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_last_name' => array(
'label' => __( 'Last name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_company' => array(
'label' => __( 'Company', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_city' => array(
'label' => __( 'City', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_country' => array(
'label' => __( 'Country', 'woocommerce' ),
'description' => '',
'class' => 'js_field-country',
'type' => 'select',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
),
'billing_state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'description' => __( 'State/County or state code', 'woocommerce' ),
'class' => 'js_field-state'
'class' => 'js_field-state',
),
'billing_phone' => array(
'label' => __( 'Telephone', 'woocommerce' ),
'description' => ''
'description' => '',
),
'billing_email' => array(
'label' => __( 'Email', 'woocommerce' ),
'description' => ''
)
)
'description' => '',
),
),
),
'shipping' => array(
'title' => __( 'Customer Shipping Address', 'woocommerce' ),
'fields' => array(
'shipping_first_name' => array(
'label' => __( 'First name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_last_name' => array(
'label' => __( 'Last name', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_company' => array(
'label' => __( 'Company', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_city' => array(
'label' => __( 'City', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'description' => ''
'description' => '',
),
'shipping_country' => array(
'label' => __( 'Country', 'woocommerce' ),
'description' => '',
'class' => 'js_field-country',
'type' => 'select',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
),
'shipping_state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'description' => __( 'State/County or state code', 'woocommerce' ),
'class' => 'js_field-state'
)
)
)
'class' => 'js_field-state',
),
),
),
) );
return $show_fields;
}

View File

@ -48,27 +48,27 @@ class WC_Admin_Reports {
'title' => __( 'Sales by date', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"sales_by_product" => array(
'title' => __( 'Sales by product', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"sales_by_category" => array(
'title' => __( 'Sales by category', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"coupon_usage" => array(
'title' => __( 'Coupons by date', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
)
)
'callback' => array( __CLASS__, 'get_report' ),
),
),
),
'customers' => array(
'title' => __( 'Customers', 'woocommerce' ),
@ -77,15 +77,15 @@ class WC_Admin_Reports {
'title' => __( 'Customers vs. Guests', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"customer_list" => array(
'title' => __( 'Customer List', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
)
),
),
'stock' => array(
'title' => __( 'Stock', 'woocommerce' ),
@ -94,22 +94,22 @@ class WC_Admin_Reports {
'title' => __( 'Low in stock', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"out_of_stock" => array(
'title' => __( 'Out of stock', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"most_stocked" => array(
'title' => __( 'Most Stocked', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
)
)
),
),
);
if ( wc_tax_enabled() ) {
@ -120,15 +120,15 @@ class WC_Admin_Reports {
'title' => __( 'Taxes by code', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
"taxes_by_date" => array(
'title' => __( 'Taxes by date', 'woocommerce' ),
'description' => '',
'hide_title' => true,
'callback' => array( __CLASS__, 'get_report' )
'callback' => array( __CLASS__, 'get_report' ),
),
)
),
);
}

View File

@ -139,7 +139,7 @@ class WC_Admin_Settings {
wp_enqueue_script( 'woocommerce_settings', WC()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris', 'select2' ), WC()->version, true );
wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' )
'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'woocommerce' ),
) );
// Include settings pages
@ -501,11 +501,11 @@ class WC_Admin_Settings {
// Image width settings
case 'image_width' :
$image_size = str_replace( '_image_size', '', $value[ 'id' ] );
$image_size = str_replace( '_image_size', '', $value['id'] );
$size = wc_get_image_size( $image_size );
$width = isset( $size[ 'width' ] ) ? $size[ 'width' ] : $value[ 'default' ][ 'width' ];
$height = isset( $size[ 'height' ] ) ? $size[ 'height' ] : $value[ 'default' ][ 'height' ];
$crop = isset( $size[ 'crop' ] ) ? $size[ 'crop' ] : $value[ 'default' ][ 'crop' ];
$width = isset( $size['width'] ) ? $size['width'] : $value['default']['width'];
$height = isset( $size['height'] ) ? $size['height'] : $value['default']['height'];
$crop = isset( $size['crop'] ) ? $size['crop'] : $value['default']['crop'];
$disabled_attr = '';
$disabled_message = '';
@ -537,7 +537,7 @@ class WC_Admin_Settings {
'show_option_none' => ' ',
'class' => $value['class'],
'echo' => false,
'selected' => absint( self::get_option( $value['id'] ) )
'selected' => absint( self::get_option( $value['id'] ) ),
);
if ( isset( $value['args'] ) ) {
@ -652,7 +652,7 @@ class WC_Admin_Settings {
return array(
'description' => $description,
'tooltip_html' => $tooltip_html
'tooltip_html' => $tooltip_html,
);
}
@ -802,7 +802,6 @@ class WC_Admin_Settings {
if ( file_exists( $downloads_url . '/.htaccess' ) ) {
unlink( $downloads_url . '/.htaccess' );
}
} else {
// Force method - protect, add rules to the htaccess file

View File

@ -27,7 +27,7 @@ class WC_Admin_Setup_Wizard {
/** @var array Tweets user can optionally send after install */
private $tweets = array(
'Someone give me woo-t, I just set up a new store with #WordPress and @WooCommerce!',
'Someone give me high five, I just set up a new store with #WordPress and @WooCommerce!'
'Someone give me high five, I just set up a new store with #WordPress and @WooCommerce!',
);
/**
@ -56,35 +56,35 @@ class WC_Admin_Setup_Wizard {
}
$this->steps = array(
'introduction' => array(
'name' => __( 'Introduction', 'woocommerce' ),
'name' => __( 'Introduction', 'woocommerce' ),
'view' => array( $this, 'wc_setup_introduction' ),
'handler' => ''
'handler' => '',
),
'pages' => array(
'name' => __( 'Page Setup', 'woocommerce' ),
'name' => __( 'Page Setup', 'woocommerce' ),
'view' => array( $this, 'wc_setup_pages' ),
'handler' => array( $this, 'wc_setup_pages_save' )
'handler' => array( $this, 'wc_setup_pages_save' ),
),
'locale' => array(
'name' => __( 'Store Locale', 'woocommerce' ),
'name' => __( 'Store Locale', 'woocommerce' ),
'view' => array( $this, 'wc_setup_locale' ),
'handler' => array( $this, 'wc_setup_locale_save' )
'handler' => array( $this, 'wc_setup_locale_save' ),
),
'shipping_taxes' => array(
'name' => __( 'Shipping &amp; Tax', 'woocommerce' ),
'name' => __( 'Shipping &amp; Tax', 'woocommerce' ),
'view' => array( $this, 'wc_setup_shipping_taxes' ),
'handler' => array( $this, 'wc_setup_shipping_taxes_save' ),
),
'payments' => array(
'name' => __( 'Payments', 'woocommerce' ),
'name' => __( 'Payments', 'woocommerce' ),
'view' => array( $this, 'wc_setup_payments' ),
'handler' => array( $this, 'wc_setup_payments_save' ),
),
'next_steps' => array(
'name' => __( 'Ready!', 'woocommerce' ),
'name' => __( 'Ready!', 'woocommerce' ),
'view' => array( $this, 'wc_setup_ready' ),
'handler' => ''
)
'handler' => '',
),
);
$this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) );
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
@ -107,14 +107,14 @@ class WC_Admin_Setup_Wizard {
'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'woocommerce' ),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'search_products_nonce' => wp_create_nonce( 'search-products' ),
'search_customers_nonce' => wp_create_nonce( 'search-customers' )
'search_customers_nonce' => wp_create_nonce( 'search-customers' ),
) );
wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION );
wp_enqueue_style( 'wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array( 'dashicons', 'install' ), WC_VERSION );
wp_register_script( 'wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup.min.js', array( 'jquery', 'wc-enhanced-select', 'jquery-blockui' ), WC_VERSION );
wp_localize_script( 'wc-setup', 'wc_setup_params', array(
'locale_info' => json_encode( include( WC()->plugin_path() . '/i18n/locale-info.php' ) )
'locale_info' => json_encode( include( WC()->plugin_path() . '/i18n/locale-info.php' ) ),
) );
if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) {
@ -546,7 +546,7 @@ class WC_Admin_Setup_Wizard {
'tax_rate_compound' => 0,
'tax_rate_shipping' => $rate['shipping'] ? 1 : 0,
'tax_rate_order' => $loop ++,
'tax_rate_class' => ''
'tax_rate_class' => '',
);
WC_Tax::_insert_tax_rate( $tax_rate );
}
@ -615,7 +615,7 @@ class WC_Admin_Setup_Wizard {
'description' => __( 'A simple offline gateway that lets you accept cash on delivery.', 'woocommerce' ),
'image' => '',
'class' => '',
)
),
);
$country = WC()->countries->get_base_country();

View File

@ -88,7 +88,7 @@ class WC_Admin_Status {
$handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : '';
if ( ! empty( $_REQUEST[ 'handle' ] ) ) {
if ( ! empty( $_REQUEST['handle'] ) ) {
self::remove_log();
}
@ -151,7 +151,7 @@ class WC_Admin_Status {
foreach ( $files as $key => $value ) {
if ( ! in_array( $value, array( ".",".." ) ) ) {
if ( ! in_array( $value, array( ".", ".." ) ) ) {
if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {
$sub_files = self::scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );
@ -185,7 +185,6 @@ class WC_Admin_Status {
}
}
}
}
return $result;
@ -202,7 +201,7 @@ class WC_Admin_Status {
'fields' => array(
'sections' => false,
'tags' => false,
)
),
) );
$update_theme_version = 0;
@ -244,13 +243,13 @@ class WC_Admin_Status {
* Remove/delete the chosen file.
*/
public static function remove_log() {
if ( empty( $_REQUEST[ '_wpnonce' ] ) || ! wp_verify_nonce( $_REQUEST[ '_wpnonce' ], 'remove_log' ) ) {
if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'remove_log' ) ) {
wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
}
if ( ! empty( $_REQUEST[ 'handle' ] ) ) {
if ( ! empty( $_REQUEST['handle'] ) ) {
$logger = wc_get_logger();
$logger->remove( $_REQUEST[ 'handle' ] );
$logger->remove( $_REQUEST['handle'] );
}
wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-status&tab=logs' ) ) );

View File

@ -25,7 +25,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'webhook', 'woocommerce' ),
'plural' => __( 'webhooks', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -92,7 +92,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
// Get actions
$actions = array(
'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $the_webhook->id )
'id' => sprintf( __( 'ID: %d', 'woocommerce' ), $the_webhook->id ),
);
if ( current_user_can( $post_type_object->cap->edit_post, $the_webhook->id ) && 'trash' !== $post_status ) {
@ -244,12 +244,12 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
if ( isset( $_GET['status'] ) && 'trash' == $_GET['status'] ) {
return array(
'untrash' => __( 'Restore', 'woocommerce' ),
'delete' => __( 'Delete Permanently', 'woocommerce' )
'delete' => __( 'Delete Permanently', 'woocommerce' ),
);
}
return array(
'trash' => __( 'Move to Trash', 'woocommerce' )
'trash' => __( 'Move to Trash', 'woocommerce' ),
);
}
@ -283,7 +283,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
'post_type' => 'shop_webhook',
'posts_per_page' => $per_page,
'ignore_sticky_posts' => true,
'paged' => $current_page
'paged' => $current_page,
);
// Handle the status query
@ -303,7 +303,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $webhooks->found_posts,
'per_page' => $per_page,
'total_pages' => $webhooks->max_num_pages
'total_pages' => $webhooks->max_num_pages,
) );
}
}

View File

@ -196,7 +196,7 @@ class WC_Admin_Webhooks {
'post_author' => get_current_user_id(),
'post_password' => strlen( ( $password = uniqid( 'webhook_' ) ) ) > 20 ? substr( $password, 0, 20 ) : $password,
'post_title' => sprintf( __( 'Webhook created on %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Webhook created on date parsed by strftime', 'woocommerce' ) ) ),
'comment_status' => 'open'
'comment_status' => 'open',
) );
if ( is_wp_error( $webhook_id ) ) {
@ -303,7 +303,7 @@ class WC_Admin_Webhooks {
'ignore_sticky_posts' => true,
'nopaging' => true,
'post_status' => 'trash',
'fields' => 'ids'
'fields' => 'ids',
) );
foreach ( $webhooks as $webhook_id ) {
@ -428,7 +428,7 @@ class WC_Admin_Webhooks {
'post_id' => $webhook->id,
'status' => 'approve',
'type' => 'webhook_delivery',
'number' => 10
'number' => 10,
);
if ( 1 < $current ) {
@ -471,7 +471,7 @@ class WC_Admin_Webhooks {
return array(
'topic' => $topic,
'event' => $event,
'resource' => $resource
'resource' => $resource,
);
}

View File

@ -148,14 +148,13 @@ class WC_Tax_Rate_Importer extends WP_Importer {
'tax_rate_compound' => $compound ? 1 : 0,
'tax_rate_shipping' => $shipping ? 1 : 0,
'tax_rate_order' => $loop ++,
'tax_rate_class' => $class
'tax_rate_class' => $class,
);
$tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate );
WC_Tax::_update_tax_rate_postcodes( $tax_rate_id, wc_clean( $postcode ) );
WC_Tax::_update_tax_rate_cities( $tax_rate_id, wc_clean( $city ) );
}
} else {
$this->import_error( __( 'The CSV is invalid.', 'woocommerce' ) );
}

View File

@ -53,7 +53,7 @@ class WC_Meta_Box_Coupon_Data {
'label' => __( 'Usage Limits', 'woocommerce' ),
'target' => 'usage_limit_coupon_data',
'class' => '',
)
),
) );
foreach ( $coupon_data_tabs as $key => $tab ) {
@ -169,9 +169,19 @@ class WC_Meta_Box_Coupon_Data {
echo '</div><div class="options_group">';
// Customers
woocommerce_wp_text_input( array( 'id' => 'customer_email', 'label' => __( 'Email restrictions', 'woocommerce' ), 'placeholder' => __( 'No restrictions', 'woocommerce' ), 'description' => __( 'List of allowed emails to check against the customer\'s billing email when an order is placed. Separate email addresses with commas.', 'woocommerce' ), 'value' => implode(', ', (array) get_post_meta( $post->ID, 'customer_email', true ) ), 'desc_tip' => true, 'type' => 'email', 'class' => '', 'custom_attributes' => array(
'multiple' => 'multiple'
) ) );
woocommerce_wp_text_input( array(
'id' => 'customer_email',
'label' => __( 'Email restrictions', 'woocommerce' ),
'placeholder' => __( 'No restrictions', 'woocommerce' ),
'description' => __( 'List of allowed emails to check against the customer\'s billing email when an order is placed. Separate email addresses with commas.', 'woocommerce' ),
'value' => implode(', ', (array) get_post_meta( $post->ID, 'customer_email', true ) ),
'desc_tip' => true,
'type' => 'email',
'class' => '',
'custom_attributes' => array(
'multiple' => 'multiple',
),
) );
echo '</div>';
@ -183,58 +193,52 @@ class WC_Meta_Box_Coupon_Data {
echo '<div class="options_group">';
// Usage limit per coupons
woocommerce_wp_text_input(
array(
'id' => 'usage_limit',
'label' => __( 'Usage limit per coupon', 'woocommerce' ),
'placeholder' => _x( 'Unlimited usage', 'placeholder', 'woocommerce' ),
'description' => __( 'How many times this coupon can be used before it is void.', 'woocommerce' ),
'type' => 'number',
'desc_tip' => true,
'class' => 'short',
'custom_attributes' => array(
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_usage_limit() ? $coupon->get_usage_limit() : '',
)
);
woocommerce_wp_text_input( array(
'id' => 'usage_limit',
'label' => __( 'Usage limit per coupon', 'woocommerce' ),
'placeholder' => _x('Unlimited usage', 'placeholder', 'woocommerce'),
'description' => __( 'How many times this coupon can be used before it is void.', 'woocommerce' ),
'type' => 'number',
'desc_tip' => true,
'class' => 'short',
'custom_attributes' => array(
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_usage_limit() ? $coupon->get_usage_limit() : '',
) );
// Usage limit per product
woocommerce_wp_text_input(
array(
'id' => 'limit_usage_to_x_items',
'label' => __( 'Limit usage to X items', 'woocommerce' ),
'placeholder' => _x( 'Apply to all qualifying items in cart', 'placeholder', 'woocommerce' ),
'description' => __( 'The maximum number of individual items this coupon can apply to when using product discounts. Leave blank to apply to all qualifying items in cart.', 'woocommerce' ),
'desc_tip' => true,
'class' => 'short',
'type' => 'number',
'custom_attributes' => array(
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_limit_usage_to_x_items() ? $coupon->get_limit_usage_to_x_items() : '',
)
);
woocommerce_wp_text_input( array(
'id' => 'limit_usage_to_x_items',
'label' => __( 'Limit usage to X items', 'woocommerce' ),
'placeholder' => _x( 'Apply to all qualifying items in cart', 'placeholder', 'woocommerce' ),
'description' => __( 'The maximum number of individual items this coupon can apply to when using product discounts. Leave blank to apply to all qualifying items in cart.', 'woocommerce' ),
'desc_tip' => true,
'class' => 'short',
'type' => 'number',
'custom_attributes' => array(
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_limit_usage_to_x_items() ? $coupon->get_limit_usage_to_x_items() : '',
) );
// Usage limit per users
woocommerce_wp_text_input(
array(
'id' => 'usage_limit_per_user',
'label' => __( 'Usage limit per user', 'woocommerce' ),
'placeholder' => _x( 'Unlimited usage', 'placeholder', 'woocommerce' ),
'description' => __( 'How many times this coupon can be used by an invidual user. Uses billing email for guests, and user ID for logged in users.', 'woocommerce' ),
'desc_tip' => true,
'class' => 'short',
'type' => 'number',
'custom_attributes' => array(
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_usage_limit_per_user() ? $coupon->get_usage_limit_per_user() : '',
)
);
woocommerce_wp_text_input( array(
'id' => 'usage_limit_per_user',
'label' => __( 'Usage limit per user', 'woocommerce' ),
'placeholder' => _x( 'Unlimited usage', 'placeholder', 'woocommerce' ),
'description' => __( 'How many times this coupon can be used by an invidual user. Uses billing email for guests, and user ID for logged in users.', 'woocommerce' ),
'desc_tip' => true,
'class' => 'short',
'type' => 'number',
'custom_attributes' => array(
'step' => 1,
'min' => 0,
),
'value' => $coupon->get_usage_limit_per_user() ? $coupon->get_usage_limit_per_user() : '',
) );
echo '</div>';

View File

@ -59,7 +59,7 @@ class WC_Meta_Box_Order_Actions {
<option value="regenerate_download_permissions"><?php _e( 'Regenerate download permissions', 'woocommerce' ); ?></option>
<?php foreach( apply_filters( 'woocommerce_order_actions', array() ) as $action => $title ) { ?>
<?php foreach ( apply_filters( 'woocommerce_order_actions', array() ) as $action => $title ) { ?>
<option value="<?php echo $action; ?>"><?php echo $title; ?></option>
<?php } ?>
</select>
@ -139,7 +139,7 @@ class WC_Meta_Box_Order_Actions {
} elseif ( 'regenerate_download_permissions' === $action ) {
delete_post_meta( $post_id, '_download_permissions_granted' );
$wpdb->delete(
$wpdb->delete(
$wpdb->prefix . 'woocommerce_downloadable_product_permissions',
array( 'order_id' => $post_id ),
array( '%d' )
@ -169,5 +169,4 @@ class WC_Meta_Box_Order_Actions {
public static function set_email_sent_message( $location ) {
return add_query_arg( 'message', 11, $location );
}
}

View File

@ -41,43 +41,43 @@ class WC_Meta_Box_Order_Data {
self::$billing_fields = apply_filters( 'woocommerce_admin_billing_fields', array(
'first_name' => array(
'label' => __( 'First Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'last_name' => array(
'label' => __( 'Last Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'company' => array(
'label' => __( 'Company', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'show' => false
'show' => false,
),
'city' => array(
'label' => __( 'City', 'woocommerce' ),
'show' => false
'show' => false,
),
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'show' => false
'show' => false,
),
'country' => array(
'label' => __( 'Country', 'woocommerce' ),
'show' => false,
'class' => 'js_field-country select short',
'type' => 'select',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_allowed_countries(),
),
'state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'class' => 'js_field-state select short',
'show' => false
'show' => false,
),
'email' => array(
'label' => __( 'Email', 'woocommerce' ),
@ -90,43 +90,43 @@ class WC_Meta_Box_Order_Data {
self::$shipping_fields = apply_filters( 'woocommerce_admin_shipping_fields', array(
'first_name' => array(
'label' => __( 'First Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'last_name' => array(
'label' => __( 'Last Name', 'woocommerce' ),
'show' => false
'show' => false,
),
'company' => array(
'label' => __( 'Company', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_1' => array(
'label' => __( 'Address 1', 'woocommerce' ),
'show' => false
'show' => false,
),
'address_2' => array(
'label' => __( 'Address 2', 'woocommerce' ),
'show' => false
'show' => false,
),
'city' => array(
'label' => __( 'City', 'woocommerce' ),
'show' => false
'show' => false,
),
'postcode' => array(
'label' => __( 'Postcode', 'woocommerce' ),
'show' => false
'show' => false,
),
'country' => array(
'label' => __( 'Country', 'woocommerce' ),
'show' => false,
'type' => 'select',
'class' => 'js_field-country select short',
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_shipping_countries()
'options' => array( '' => __( 'Select a country&hellip;', 'woocommerce' ) ) + WC()->countries->get_shipping_countries(),
),
'state' => array(
'label' => __( 'State/County', 'woocommerce' ),
'class' => 'js_field-state select short',
'show' => false
'show' => false,
),
) );
}
@ -220,9 +220,10 @@ class WC_Meta_Box_Order_Data {
<p class="form-field form-field-wide wc-customer-user">
<label for="customer_user"><?php _e( 'Customer:', 'woocommerce' ) ?> <?php
if ( $order->get_user_id() ) {
$args = array( 'post_status' => 'all',
$args = array(
'post_status' => 'all',
'post_type' => 'shop_order',
'_customer_user' => absint( $order->get_user_id() )
'_customer_user' => absint( $order->get_user_id() ),
);
printf( '<a href="%s">%s &rarr;</a>',
esc_url( add_query_arg( $args, admin_url( 'edit.php' ) ) ),
@ -280,7 +281,7 @@ class WC_Meta_Box_Order_Data {
if ( ! isset( $field['type'] ) ) {
$field['type'] = 'text';
}
if ( ! isset( $field['id'] ) ){
if ( ! isset( $field['id'] ) ) {
$field['id'] = '_billing_' . $key;
}
switch ( $field['type'] ) {
@ -372,7 +373,7 @@ class WC_Meta_Box_Order_Data {
if ( ! isset( $field['type'] ) ) {
$field['type'] = 'text';
}
if ( ! isset( $field['id'] ) ){
if ( ! isset( $field['id'] ) ) {
$field['id'] = '_shipping_' . $key;
}
@ -433,7 +434,7 @@ class WC_Meta_Box_Order_Data {
if ( ! empty( self::$billing_fields ) ) {
foreach ( self::$billing_fields as $key => $field ) {
if ( ! isset( $field['id'] ) ){
if ( ! isset( $field['id'] ) ) {
$field['id'] = '_billing_' . $key;
}
if ( update_post_meta( $post_id, $field['id'], wc_clean( $_POST[ $field['id'] ] ) ) ) {
@ -444,7 +445,7 @@ class WC_Meta_Box_Order_Data {
if ( ! empty( self::$shipping_fields ) ) {
foreach ( self::$shipping_fields as $key => $field ) {
if ( ! isset( $field['id'] ) ){
if ( ! isset( $field['id'] ) ) {
$field['id'] = '_shipping_' . $key;
}
if ( update_post_meta( $post_id, $field['id'], wc_clean( $_POST[ $field['id'] ] ) ) ) {
@ -454,7 +455,7 @@ class WC_Meta_Box_Order_Data {
}
if ( isset( $_POST['_transaction_id'] ) ) {
update_post_meta( $post_id, '_transaction_id', wc_clean( $_POST[ '_transaction_id' ] ) );
update_post_meta( $post_id, '_transaction_id', wc_clean( $_POST['_transaction_id'] ) );
}
// Payment method handling

View File

@ -121,7 +121,7 @@ class WC_Meta_Box_Order_Downloads {
array(
'order_id' => $post_id,
'product_id' => absint( $product_ids[ $i ] ),
'download_id' => wc_clean( $download_ids[ $i ] )
'download_id' => wc_clean( $download_ids[ $i ] ),
),
$format, array( '%d', '%d', '%s' )
);

View File

@ -30,7 +30,7 @@ class WC_Meta_Box_Order_Notes {
'orderby' => 'comment_ID',
'order' => 'DESC',
'approve' => 'approve',
'type' => 'order_note'
'type' => 'order_note',
);
remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
@ -43,7 +43,7 @@ class WC_Meta_Box_Order_Notes {
if ( $notes ) {
foreach( $notes as $note ) {
foreach ( $notes as $note ) {
$note_classes = array( 'note' );
$note_classes[] = get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ? 'customer-note' : '';
@ -62,7 +62,6 @@ class WC_Meta_Box_Order_Notes {
</li>
<?php
}
} else {
echo '<li>' . __( 'There are no notes yet.', 'woocommerce' ) . '</li>';
}

View File

@ -51,15 +51,15 @@ class WC_Meta_Box_Product_Data {
'wrapper_class' => 'show_if_simple',
'label' => __( 'Virtual', 'woocommerce' ),
'description' => __( 'Virtual products are intangible and aren\'t shipped.', 'woocommerce' ),
'default' => 'no'
'default' => 'no',
),
'downloadable' => array(
'id' => '_downloadable',
'wrapper_class' => 'show_if_simple',
'label' => __( 'Downloadable', 'woocommerce' ),
'description' => __( 'Downloadable products give access to a file upon purchase.', 'woocommerce' ),
'default' => 'no'
)
'default' => 'no',
),
) );
foreach ( $product_type_options as $key => $option ) {
@ -114,7 +114,7 @@ class WC_Meta_Box_Product_Data {
'label' => __( 'Advanced', 'woocommerce' ),
'target' => 'advanced_product_data',
'class' => array(),
)
),
) );
foreach ( $product_data_tabs as $key => $tab ) {
@ -192,7 +192,7 @@ class WC_Meta_Box_Product_Data {
<a href="#" class="button insert" data-row="<?php
$file = array(
'file' => '',
'name' => ''
'name' => '',
);
ob_start();
include( 'views/html-product-download.php' );
@ -206,23 +206,42 @@ class WC_Meta_Box_Product_Data {
<?php
// Download Limit
woocommerce_wp_text_input( array( 'id' => '_download_limit', 'label' => __( 'Download limit', 'woocommerce' ), 'placeholder' => __( 'Unlimited', 'woocommerce' ), 'description' => __( 'Leave blank for unlimited re-downloads.', 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array(
'step' => '1',
'min' => '0'
) ) );
woocommerce_wp_text_input( array(
'id' => '_download_limit',
'label' => __( 'Download limit', 'woocommerce' ),
'placeholder' => __( 'Unlimited', 'woocommerce' ),
'description' => __( 'Leave blank for unlimited re-downloads.', 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => '1',
'min' => '0',
),
) );
// Expirey
woocommerce_wp_text_input( array( 'id' => '_download_expiry', 'label' => __( 'Download expiry', 'woocommerce' ), 'placeholder' => __( 'Never', 'woocommerce' ), 'description' => __( 'Enter the number of days before a download link expires, or leave blank.', 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array(
'step' => '1',
'min' => '0'
) ) );
woocommerce_wp_text_input( array(
'id' => '_download_expiry',
'label' => __( 'Download expiry', 'woocommerce' ),
'placeholder' => __( 'Never', 'woocommerce' ),
'description' => __( 'Enter the number of days before a download link expires, or leave blank.', 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => '1',
'min' => '0',
),
) );
// Download Type
woocommerce_wp_select( array( 'id' => '_download_type', 'label' => __( 'Download type', 'woocommerce' ), 'description' => sprintf( __( 'Choose a download type - this controls the <a href="%s">schema</a>.', 'woocommerce' ), 'http://schema.org/' ), 'options' => array(
'' => __( 'Standard Product', 'woocommerce' ),
'application' => __( 'Application/Software', 'woocommerce' ),
'music' => __( 'Music', 'woocommerce' ),
) ) );
woocommerce_wp_select( array(
'id' => '_download_type',
'label' => __( 'Download type', 'woocommerce' ),
'description' => sprintf( __( 'Choose a download type - this controls the <a href="%s">schema</a>.', 'woocommerce' ), 'http://schema.org/' ),
'options' => array(
'' => __( 'Standard Product', 'woocommerce' ),
'application' => __( 'Application/Software', 'woocommerce' ),
'music' => __( 'Music', 'woocommerce' ),
),
) );
do_action( 'woocommerce_product_options_downloads' );
@ -239,10 +258,10 @@ class WC_Meta_Box_Product_Data {
'options' => array(
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' )
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
),
'desc_tip' => 'true',
'description' => __( 'Define whether or not the entire product is taxable, or just the cost of shipping it.', 'woocommerce' )
'description' => __( 'Define whether or not the entire product is taxable, or just the cost of shipping it.', 'woocommerce' ),
) );
$tax_classes = WC_Tax::get_tax_classes();
@ -260,7 +279,7 @@ class WC_Meta_Box_Product_Data {
'label' => __( 'Tax class', 'woocommerce' ),
'options' => $classes_options,
'desc_tip' => 'true',
'description' => __( 'Choose a tax class for this product. Tax classes are used to apply different tax rates specific to certain types of product.', 'woocommerce' )
'description' => __( 'Choose a tax class for this product. Tax classes are used to apply different tax rates specific to certain types of product.', 'woocommerce' ),
) );
do_action( 'woocommerce_product_options_tax' );
@ -305,17 +324,23 @@ class WC_Meta_Box_Product_Data {
'description' => __( 'Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce' ),
'type' => 'number',
'custom_attributes' => array(
'step' => 'any'
'step' => 'any',
),
'data_type' => 'stock'
'data_type' => 'stock',
) );
// Backorders?
woocommerce_wp_select( array( 'id' => '_backorders', 'label' => __( 'Allow backorders?', 'woocommerce' ), 'options' => array(
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
), 'desc_tip' => true, 'description' => __( 'If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce' ) ) );
woocommerce_wp_select( array(
'id' => '_backorders',
'label' => __( 'Allow backorders?', 'woocommerce' ),
'options' => array(
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' ),
),
'desc_tip' => true,
'description' => __( 'If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce' ),
) );
do_action( 'woocommerce_product_options_stock_fields' );
@ -324,10 +349,17 @@ class WC_Meta_Box_Product_Data {
}
// Stock status
woocommerce_wp_select( array( 'id' => '_stock_status', 'wrapper_class' => 'hide_if_variable hide_if_external', 'label' => __( 'Stock status', 'woocommerce' ), 'options' => array(
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
), 'desc_tip' => true, 'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce' ) ) );
woocommerce_wp_select( array(
'id' => '_stock_status',
'wrapper_class' => 'hide_if_variable hide_if_external',
'label' => __( 'Stock status', 'woocommerce' ),
'options' => array(
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' ),
),
'desc_tip' => true,
'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce' ),
) );
do_action( 'woocommerce_product_options_stock_status' );
@ -392,7 +424,7 @@ class WC_Meta_Box_Product_Data {
'name' => 'product_shipping_class',
'id' => 'product_shipping_class',
'selected' => $current_shipping_class,
'class' => 'select short'
'class' => 'select short',
);
?><p class="form-field dimensions_field"><label for="product_shipping_class"><?php _e( 'Shipping class', 'woocommerce' ); ?></label> <?php wp_dropdown_categories( $args ); ?> <?php echo wc_help_tip( __( 'Shipping classes are used by certain shipping methods to group similar products.', 'woocommerce' ) ); ?></p><?php
@ -550,9 +582,17 @@ class WC_Meta_Box_Product_Data {
<div class="options_group">
<?php
// menu_order
woocommerce_wp_text_input( array( 'id' => 'menu_order', 'label' => __( 'Menu order', 'woocommerce' ), 'desc_tip' => 'true', 'description' => __( 'Custom ordering position.', 'woocommerce' ), 'value' => intval( $post->menu_order ), 'type' => 'number', 'custom_attributes' => array(
'step' => '1'
) ) );
woocommerce_wp_text_input( array(
'id' => 'menu_order',
'label' => __( 'Menu order', 'woocommerce' ),
'desc_tip' => 'true',
'description' => __( 'Custom ordering position.', 'woocommerce' ),
'value' => intval( $post->menu_order ),
'type' => 'number',
'custom_attributes' => array(
'step' => '1',
),
) );
?>
</div>
@ -645,7 +685,6 @@ class WC_Meta_Box_Product_Data {
foreach ( $post_terms as $term ) {
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) ) . '</option>';
}
} else {
$options = wc_get_text_attributes( $attribute['value'] );
@ -653,7 +692,6 @@ class WC_Meta_Box_Product_Data {
$selected = sanitize_title( $variation_selected_value ) === $variation_selected_value ? selected( $variation_selected_value, sanitize_title( $option ), false ) : selected( $variation_selected_value, $option, false );
echo '<option ' . $selected . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
}
}
echo '</select>';
@ -819,7 +857,6 @@ class WC_Meta_Box_Product_Data {
if ( isset( $_POST['_height'] ) ) {
update_post_meta( $post_id, '_height', ( '' === $_POST['_height'] ) ? '' : wc_format_decimal( $_POST['_height'] ) );
}
} else {
update_post_meta( $post_id, '_weight', '' );
update_post_meta( $post_id, '_length', '' );
@ -906,7 +943,7 @@ class WC_Meta_Box_Product_Data {
// Update post terms
if ( taxonomy_exists( $attribute_names[ $i ] ) ) {
foreach( $values as $key => $value ) {
foreach ( $values as $key => $value ) {
$term = get_term_by( $values_are_slugs ? 'slug' : 'name', trim( $value ), $attribute_names[ $i ] );
if ( $term ) {
@ -930,10 +967,9 @@ class WC_Meta_Box_Product_Data {
'position' => $attribute_position[ $i ],
'is_visible' => $is_visible,
'is_variation' => $is_variation,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
} elseif ( isset( $attribute_values[ $i ] ) ) {
// Text based, possibly separated by pipes (WC_DELIMITER). Preserve line breaks in non-variation attributes.
@ -947,7 +983,7 @@ class WC_Meta_Box_Product_Data {
'position' => $attribute_position[ $i ],
'is_visible' => $is_visible,
'is_variation' => $is_variation,
'is_taxonomy' => $is_taxonomy
'is_taxonomy' => $is_taxonomy,
);
}
}
@ -1044,7 +1080,7 @@ class WC_Meta_Box_Product_Data {
'meta_key' => '_price',
'posts_per_page' => 1,
'post_type' => 'product',
'fields' => 'ids'
'fields' => 'ids',
) );
if ( $children_by_price ) {
@ -1086,7 +1122,6 @@ class WC_Meta_Box_Product_Data {
$manage_stock = 'yes';
$backorders = wc_clean( $_POST['_backorders'] );
}
} elseif ( 'grouped' !== $product_type && ! empty( $_POST['_manage_stock'] ) ) {
$manage_stock = 'yes';
$backorders = wc_clean( $_POST['_backorders'] );
@ -1104,7 +1139,6 @@ class WC_Meta_Box_Product_Data {
} else {
update_post_meta( $post_id, '_stock', '' );
}
} elseif ( 'variable' !== $product_type ) {
wc_update_product_stock_status( $post_id, wc_clean( $_POST['_stock_status'] ) );
}
@ -1182,7 +1216,7 @@ class WC_Meta_Box_Product_Data {
$files[ $file_hash ] = array(
'name' => $file_name,
'file' => $file_url
'file' => $file_url,
);
}
}
@ -1298,7 +1332,7 @@ class WC_Meta_Box_Product_Data {
'post_author' => get_current_user_id(),
'post_parent' => $post_id,
'post_type' => 'product_variation',
'menu_order' => $variable_menu_order[ $i ]
'menu_order' => $variable_menu_order[ $i ],
);
$variation_id = wp_insert_post( $variation );
@ -1314,7 +1348,7 @@ class WC_Meta_Box_Product_Data {
'post_title' => $variation_post_title,
'menu_order' => $variable_menu_order[ $i ],
'post_modified' => $modified_date,
'post_modified_gmt' => get_gmt_from_date( $modified_date )
'post_modified_gmt' => get_gmt_from_date( $modified_date ),
), array( 'ID' => $variation_id ) );
clean_post_cache( $variation_id );
@ -1472,7 +1506,7 @@ class WC_Meta_Box_Product_Data {
$files[ $file_hash ] = array(
'name' => $file_name,
'file' => $file_url
'file' => $file_url,
);
}
}

View File

@ -33,10 +33,9 @@ class WC_Meta_Box_Product_Short_Description {
'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator',
'theme_advanced_buttons2' => '',
),
'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>'
'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>',
);
wp_editor( htmlspecialchars_decode( $post->post_excerpt ), 'excerpt', apply_filters( 'woocommerce_product_short_description_editor_settings', $settings ) );
}
}

View File

@ -29,11 +29,11 @@ if ( ! defined( 'ABSPATH' ) ) {
<td>
<label><?php _e( 'Customer download link', 'woocommerce' ); ?></label>
<?php
$download_link = add_query_arg( array(
$download_link = add_query_arg( array(
'download_file' => $download->product_id,
'order' => $download->order_key,
'email' => urlencode( $download->user_email ),
'key' => $download->download_id
'key' => $download->download_id,
), trailingslashit( home_url() ) );
echo '<a href="' . esc_url( $download_link ) . '">' . esc_html( $file_count ) . '</a>';

View File

@ -13,7 +13,7 @@
'_line_total',
'_line_tax',
'method_id',
'cost'
'cost',
) ) ) ) {
continue;
}
@ -42,7 +42,7 @@
'_line_total',
'_line_tax',
'method_id',
'cost'
'cost',
) ) ) ) {
continue;
}

View File

@ -31,7 +31,7 @@
<?php
$args = array(
'orderby' => 'name',
'hide_empty' => 0
'hide_empty' => 0,
);
$all_terms = get_terms( $taxonomy, apply_filters( 'woocommerce_product_attribute_terms', $args ) );
if ( $all_terms ) {

View File

@ -4,4 +4,4 @@
<td class="file_url"><input type="text" class="input_text" placeholder="<?php esc_attr_e( "http://", 'woocommerce' ); ?>" name="_wc_file_urls[]" value="<?php echo esc_attr( $file['file'] ); ?>" /></td>
<td class="file_url_choose" width="1%"><a href="#" class="button upload_file_button" data-choose="<?php esc_attr_e( 'Choose file', 'woocommerce' ); ?>" data-update="<?php esc_attr_e( 'Insert file URL', 'woocommerce' ); ?>"><?php echo str_replace( ' ', '&nbsp;', __( 'Choose file', 'woocommerce' ) ); ?></a></td>
<td width="1%"><a href="#" class="delete"><?php _e( 'Delete', 'woocommerce' ); ?></a></td>
</tr>
</tr>

View File

@ -3,4 +3,4 @@
<td class="file_url"><input type="text" class="input_text" placeholder="<?php esc_attr_e( "http://", 'woocommerce' ); ?>" name="_wc_variation_file_urls[<?php echo $variation_id; ?>][]" value="<?php echo esc_attr( $file['file'] ); ?>" /></td>
<td class="file_url_choose" width="1%"><a href="#" class="button upload_file_button" data-choose="<?php esc_attr_e( 'Choose file', 'woocommerce' ); ?>" data-update="<?php esc_attr_e( 'Insert file URL', 'woocommerce' ); ?>"><?php echo str_replace( ' ', '&nbsp;', __( 'Choose file', 'woocommerce' ) ); ?></a></td>
<td width="1%"><a href="#" class="delete"><?php _e( 'Delete', 'woocommerce' ); ?></a></td>
</tr>
</tr>

View File

@ -40,7 +40,6 @@ extract( $variation_data );
foreach ( $post_terms as $term ) {
echo '<option ' . selected( $variation_selected_value, $term->slug, false ) . ' value="' . esc_attr( $term->slug ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) ) . '</option>';
}
} else {
$options = wc_get_text_attributes( $attribute['value'] );
@ -49,7 +48,6 @@ extract( $variation_data );
$selected = sanitize_title( $variation_selected_value ) === $variation_selected_value ? selected( $variation_selected_value, sanitize_title( $option ), false ) : selected( $variation_selected_value, $option, false );
echo '<option ' . $selected . ' value="' . esc_attr( $option ) . '">' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . '</option>';
}
}
echo '</select>';
@ -212,7 +210,7 @@ extract( $variation_data );
'name' => 'variable_shipping_class[' . $loop . ']',
'id' => '',
'selected' => isset( $shipping_class ) ? esc_attr( $shipping_class ) : '',
'echo' => 0
'echo' => 0,
);
echo wp_dropdown_categories( $args );
@ -267,7 +265,7 @@ extract( $variation_data );
if ( ! is_array( $file ) ) {
$file = array(
'file' => $file,
'name' => ''
'name' => '',
);
}
include( 'html-product-variation-download.php' );
@ -281,7 +279,7 @@ extract( $variation_data );
<a href="#" class="button insert" data-row="<?php
$file = array(
'file' => '',
'name' => ''
'name' => '',
);
ob_start();
include( 'html-product-variation-download.php' );

View File

@ -152,10 +152,10 @@ class WC_Admin_Report {
switch ( $type ) {
case 'meta' :
$joins["meta_{$key}"] = "{$join_type} JOIN {$wpdb->postmeta} AS meta_{$key} ON ( posts.ID = meta_{$key}.post_id AND meta_{$key}.meta_key = '{$key}' )";
$joins[ "meta_{$key}" ] = "{$join_type} JOIN {$wpdb->postmeta} AS meta_{$key} ON ( posts.ID = meta_{$key}.post_id AND meta_{$key}.meta_key = '{$key}' )";
break;
case 'parent_meta' :
$joins["parent_meta_{$key}"] = "{$join_type} JOIN {$wpdb->postmeta} AS parent_meta_{$key} ON (posts.post_parent = parent_meta_{$key}.post_id) AND (parent_meta_{$key}.meta_key = '{$key}')";
$joins[ "parent_meta_{$key}" ] = "{$join_type} JOIN {$wpdb->postmeta} AS parent_meta_{$key} ON (posts.post_parent = parent_meta_{$key}.post_id) AND (parent_meta_{$key}.meta_key = '{$key}')";
break;
case 'order_item_meta' :
$joins["order_items"] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON (posts.ID = order_items.order_id)";
@ -164,7 +164,7 @@ class WC_Admin_Report {
$joins["order_items"] .= " AND (order_items.order_item_type = '{$value['order_item_type']}')";
}
$joins["order_item_meta_{$key}"] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_{$key} ON " .
$joins[ "order_item_meta_{$key}" ] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_{$key} ON " .
"(order_items.order_item_id = order_item_meta_{$key}.order_item_id) " .
" AND (order_item_meta_{$key}.meta_key = '{$key}')";
break;
@ -186,11 +186,11 @@ class WC_Admin_Report {
if ( 'order_item_meta' === $type ) {
$joins["order_items"] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_items AS order_items ON posts.ID = order_items.order_id";
$joins["order_item_meta_{$key}"] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_{$key} ON order_items.order_item_id = order_item_meta_{$key}.order_item_id";
$joins[ "order_item_meta_{$key}" ] = "{$join_type} JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS order_item_meta_{$key} ON order_items.order_item_id = order_item_meta_{$key}.order_item_id";
} else {
// If we have a where clause for meta, join the postmeta table
$joins["meta_{$key}"] = "{$join_type} JOIN {$wpdb->postmeta} AS meta_{$key} ON posts.ID = meta_{$key}.post_id";
$joins[ "meta_{$key}" ] = "{$join_type} JOIN {$wpdb->postmeta} AS meta_{$key} ON posts.ID = meta_{$key}.post_id";
}
}
}
@ -227,7 +227,6 @@ class WC_Admin_Report {
";
}
if ( ! empty( $where_meta ) ) {
$relation = isset( $where_meta['relation'] ) ? $where_meta['relation'] : 'AND';
@ -417,35 +416,35 @@ class WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
$meta_key => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'sparkline_value'
'name' => 'sparkline_value',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'post_date',
'value' => date( 'Y-m-d', strtotime( 'midnight -' . ( $days - 1 ) . ' days', current_time( 'timestamp' ) ) ),
'operator' => '>'
'operator' => '>',
),
array(
'key' => 'order_item_meta__product_id.meta_value',
'value' => $id,
'operator' => '='
)
'operator' => '=',
),
),
'group_by' => 'YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date)',
'query_type' => 'get_results',
'filter_range' => false
'filter_range' => false,
) );
} else {
@ -454,24 +453,24 @@ class WC_Admin_Report {
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'sparkline_value'
'name' => 'sparkline_value',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'post_date',
'value' => date( 'Y-m-d', strtotime( 'midnight -' . ( $days - 1 ) . ' days', current_time( 'timestamp' ) ) ),
'operator' => '>'
)
'operator' => '>',
),
),
'group_by' => 'YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date)',
'query_type' => 'get_results',
'filter_range' => false
'filter_range' => false,
) );
}
@ -488,7 +487,7 @@ class WC_Admin_Report {
$sparkline_data = array_values( $this->prepare_chart_data( $data, 'post_date', 'sparkline_value', $days - 1, strtotime( 'midnight -' . ( $days - 1 ) . ' days', current_time( 'timestamp' ) ), 'day' ) );
return '<span class="wc_sparkline ' . ( $type == 'sales' ? 'lines' : 'bars' ) . ' tips" data-color="#777" data-tip="' . esc_attr( $tooltip ) . '" data-barwidth="' . 60*60*16*1000 . '" data-sparkline="' . esc_attr( json_encode( $sparkline_data ) ) . '"></span>';
return '<span class="wc_sparkline ' . ( $type == 'sales' ? 'lines' : 'bars' ) . ' tips" data-color="#777" data-tip="' . esc_attr( $tooltip ) . '" data-barwidth="' . 60 * 60 * 16 * 1000 . '" data-sparkline="' . esc_attr( json_encode( $sparkline_data ) ) . '"></span>';
}
/**
@ -578,7 +577,7 @@ class WC_Admin_Report {
* @return string
*/
public function get_currency_tooltip() {
switch( get_option( 'woocommerce_currency_pos' ) ) {
switch ( get_option( 'woocommerce_currency_pos' ) ) {
case 'right':
$currency_tooltip = 'append_tooltip: "' . get_woocommerce_currency_symbol() . '"'; break;
case 'right_space':

View File

@ -53,15 +53,15 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
)
'name' => 'discount_amount',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'query_type' => 'get_var',
'filter_range' => true,
@ -74,15 +74,15 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => 'COUNT',
'name' => 'order_coupon_count'
)
'name' => 'order_coupon_count',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'query_type' => 'get_var',
'filter_range' => true,
@ -94,7 +94,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'key' => 'order_item_name',
'value' => $this->coupon_codes,
'operator' => 'IN'
'operator' => 'IN',
);
$total_discount_query['where'][] = $coupon_code_query;
@ -107,13 +107,13 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
$legend[] = array(
'title' => sprintf( __( '%s discounts in total', 'woocommerce' ), '<strong>' . wc_price( $total_discount ) . '</strong>' ),
'color' => $this->chart_colours['discount_amount'],
'highlight_series' => 1
'highlight_series' => 1,
);
$legend[] = array(
'title' => sprintf( __( '%s coupons used in total', 'woocommerce' ), '<strong>' . $total_coupons . '</strong>' ),
'color' => $this->chart_colours['coupon_count' ],
'highlight_series' => 0
'color' => $this->chart_colours['coupon_count'],
'highlight_series' => 0,
);
return $legend;
@ -128,7 +128,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
@ -157,7 +157,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
$widgets[] = array(
'title' => '',
'callback' => array( $this, 'coupons_widget' )
'callback' => array( $this, 'coupons_widget' ),
);
return $widgets;
@ -180,18 +180,18 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'order_item_type' => 'coupon',
'function' => '',
'distinct' => true,
'name' => 'order_item_name'
)
'name' => 'order_item_name',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'query_type' => 'get_col',
'filter_range' => false
'filter_range' => false,
) );
if ( ! empty( $used_coupons ) && is_array( $used_coupons ) ) :
@ -227,13 +227,13 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => '',
'name' => 'coupon_code'
'name' => 'coupon_code',
),
'order_item_id' => array(
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => 'COUNT',
'name' => 'coupon_count'
'name' => 'coupon_count',
),
),
'where' => array(
@ -241,14 +241,14 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'order_by' => 'coupon_count DESC',
'group_by' => 'order_item_name',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( ! empty( $most_popular ) && is_array( $most_popular ) ) {
@ -274,28 +274,28 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => '',
'name' => 'coupon_code'
'name' => 'coupon_code',
),
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
)
'name' => 'discount_amount',
),
),
'where' => array(
array(
'type' => 'order_item',
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'order_by' => 'discount_amount DESC',
'group_by' => 'order_item_name',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( ! empty( $most_discount ) && is_array( $most_discount ) ) {
@ -369,26 +369,26 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'order_item_type' => 'coupon',
'function' => 'COUNT',
'name' => 'order_coupon_count'
'name' => 'order_coupon_count',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' )
'order_types' => wc_get_order_types( 'order-count' ),
);
$order_discount_amounts_query = array(
@ -397,26 +397,26 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
'name' => 'discount_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'group_by' => $this->group_by_query . ', order_item_name',
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' )
'order_types' => wc_get_order_types( 'order-count' ),
);
if ( ! empty( $this->coupon_codes ) ) {
@ -424,7 +424,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
'type' => 'order_item',
'key' => 'order_item_name',
'value' => $this->coupon_codes,
'operator' => 'IN'
'operator' => 'IN',
);
$order_coupon_counts_query['where'][] = $coupon_code_query;
@ -441,7 +441,7 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
// Encode in json format
$chart_data = json_encode( array(
'order_coupon_counts' => array_values( $order_coupon_counts ),
'order_discount_amounts' => array_values( $order_discount_amounts )
'order_discount_amounts' => array_values( $order_discount_amounts ),
) );
?>
<div class="chart-container">
@ -458,8 +458,8 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
{
label: "<?php echo esc_js( __( 'Number of coupons used', 'woocommerce' ) ) ?>",
data: order_data.order_coupon_counts,
color: '<?php echo $this->chart_colours['coupon_count' ]; ?>',
bars: { fillColor: '<?php echo $this->chart_colours['coupon_count' ]; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },
color: '<?php echo $this->chart_colours['coupon_count']; ?>',
bars: { fillColor: '<?php echo $this->chart_colours['coupon_count']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },
shadowSize: 0,
hoverable: false
},

View File

@ -26,7 +26,7 @@ class WC_Report_Customer_List extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'Customer', 'woocommerce' ),
'plural' => __( 'Customers', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -128,7 +128,7 @@ class WC_Report_Customer_List extends WP_List_Table {
$orders = wc_get_orders( array(
'limit' => 1,
'status' => array( 'wc-completed', 'wc-processing' ),
'customer' => $user->ID
'customer' => $user->ID,
) );
if ( ! empty( $orders ) ) {
@ -151,19 +151,19 @@ class WC_Report_Customer_List extends WP_List_Table {
$actions['refresh'] = array(
'url' => wp_nonce_url( add_query_arg( 'refresh', $user->ID ), 'refresh' ),
'name' => __( 'Refresh stats', 'woocommerce' ),
'action' => "refresh"
'action' => "refresh",
);
$actions['edit'] = array(
'url' => admin_url( 'user-edit.php?user_id=' . $user->ID ),
'name' => __( 'Edit', 'woocommerce' ),
'action' => "edit"
'action' => "edit",
);
$actions['view'] = array(
'url' => admin_url( 'edit.php?post_type=shop_order&_customer_user=' . $user->ID ),
'name' => __( 'View orders', 'woocommerce' ),
'action' => "view"
'action' => "view",
);
$orders = wc_get_orders( array(
@ -176,7 +176,7 @@ class WC_Report_Customer_List extends WP_List_Table {
$actions['link'] = array(
'url' => wp_nonce_url( add_query_arg( 'link_orders', $user->ID ), 'link_orders' ),
'name' => __( 'Link previous orders', 'woocommerce' ),
'action' => "link"
'action' => "link",
);
}
@ -212,7 +212,7 @@ class WC_Report_Customer_List extends WP_List_Table {
'orders' => __( 'Orders', 'woocommerce' ),
'spent' => __( 'Money Spent', 'woocommerce' ),
'last_order' => __( 'Last order', 'woocommerce' ),
'user_actions' => __( 'Actions', 'woocommerce' )
'user_actions' => __( 'Actions', 'woocommerce' ),
);
return $columns;
@ -263,21 +263,21 @@ class WC_Report_Customer_List extends WP_List_Table {
$admin_users = new WP_User_Query(
array(
'role' => 'administrator1',
'fields' => 'ID'
'fields' => 'ID',
)
);
$manager_users = new WP_User_Query(
array(
'role' => 'shop_manager',
'fields' => 'ID'
'fields' => 'ID',
)
);
$query = new WP_User_Query( array(
'exclude' => array_merge( $admin_users->get_results(), $manager_users->get_results() ),
'number' => $per_page,
'offset' => ( $current_page - 1 ) * $per_page
'offset' => ( $current_page - 1 ) * $per_page,
) );
$this->items = $query->get_results();
@ -290,7 +290,7 @@ class WC_Report_Customer_List extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $query->total_users,
'per_page' => $per_page,
'total_pages' => ceil( $query->total_users / $per_page )
'total_pages' => ceil( $query->total_users / $per_page ),
) );
}
}

View File

@ -39,7 +39,7 @@ class WC_Report_Customers extends WC_Admin_Report {
$legend[] = array(
'title' => sprintf( __( '%s signups in this period', 'woocommerce' ), '<strong>' . sizeof( $this->customers ) . '</strong>' ),
'color' => $this->chart_colours['signups'],
'highlight_series' => 2
'highlight_series' => 2,
);
return $legend;
@ -55,7 +55,7 @@ class WC_Report_Customers extends WC_Admin_Report {
$widgets[] = array(
'title' => '',
'callback' => array( $this, 'customers_vs_guests' )
'callback' => array( $this, 'customers_vs_guests' ),
);
return $widgets;
@ -71,17 +71,17 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
)
'name' => 'total_orders',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '>'
)
'operator' => '>',
),
),
'filter_range' => true
'filter_range' => true,
) );
$guest_order_totals = $this->get_order_report_data( array(
@ -89,17 +89,17 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
)
'name' => 'total_orders',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '='
)
'operator' => '=',
),
),
'filter_range' => true
'filter_range' => true,
) );
?>
<div class="chart-container">
@ -162,13 +162,13 @@ class WC_Report_Customers extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
'signups' => '#3498db',
'customers' => '#1abc9c',
'guests' => '#8fdece'
'guests' => '#8fdece',
);
$current_range = ! empty( $_GET['range'] ) ? sanitize_text_field( $_GET['range'] ) : '7day';
@ -182,21 +182,21 @@ class WC_Report_Customers extends WC_Admin_Report {
$admin_users = new WP_User_Query(
array(
'role' => 'administrator',
'fields' => 'ID'
'fields' => 'ID',
)
);
$manager_users = new WP_User_Query(
array(
'role' => 'shop_manager',
'fields' => 'ID'
'fields' => 'ID',
)
);
$users_query = new WP_User_Query(
array(
'fields' => array( 'user_registered' ),
'exclude' => array_merge( $admin_users->get_results(), $manager_users->get_results() )
'exclude' => array_merge( $admin_users->get_results(), $manager_users->get_results() ),
)
);
@ -242,25 +242,25 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
'name' => 'total_orders',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '>'
)
'operator' => '>',
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$guest_orders = $this->get_order_report_data( array(
@ -268,25 +268,25 @@ class WC_Report_Customers extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders'
'name' => 'total_orders',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where_meta' => array(
array(
'meta_key' => '_customer_user',
'meta_value' => '0',
'operator' => '='
)
'operator' => '=',
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$signups = $this->prepare_chart_data( $this->customers, 'user_registered', '', $this->chart_interval, $this->start_date, $this->chart_groupby );
@ -297,7 +297,7 @@ class WC_Report_Customers extends WC_Admin_Report {
$chart_data = json_encode( array(
'signups' => array_values( $signups ),
'customer_orders' => array_values( $customer_orders ),
'guest_orders' => array_values( $guest_orders )
'guest_orders' => array_values( $guest_orders ),
) );
?>
<div class="chart-container">

View File

@ -94,8 +94,8 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
$legend[] = array(
'title' => sprintf( __( '%s sales in %s', 'woocommerce' ), '<strong>' . wc_price( $total ) . '</strong>', $category->name ),
'color' => isset( $this->chart_colours[ $index ] ) ? $this->chart_colours[ $index ] : $this->chart_colours[ 0 ],
'highlight_series' => $index
'color' => isset( $this->chart_colours[ $index ] ) ? $this->chart_colours[ $index ] : $this->chart_colours[0],
'highlight_series' => $index,
);
$index++;
@ -113,7 +113,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array( '#3498db', '#34495e', '#1abc9c', '#2ecc71', '#f1c40f', '#e67e22', '#e74c3c', '#2980b9', '#8e44ad', '#2c3e50', '#16a085', '#27ae60', '#f39c12', '#d35400', '#c0392b' );
@ -134,23 +134,23 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_line_total' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_amount'
'name' => 'order_item_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'group_by' => 'ID, product_id, post_date',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$this->item_sales = array();
@ -190,8 +190,8 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report {
return array(
array(
'title' => __( 'Categories', 'woocommerce' ),
'callback' => array( $this, 'category_widget' )
)
'callback' => array( $this, 'category_widget' ),
),
);
}

View File

@ -56,15 +56,15 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
)
'name' => 'post_date',
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
$this->report_data->coupons = (array) $this->get_order_report_data( array(
@ -72,33 +72,33 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'order_item_name'
'name' => 'order_item_name',
),
'discount_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'coupon',
'function' => 'SUM',
'name' => 'discount_amount'
'name' => 'discount_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'coupon',
'operator' => '='
)
'operator' => '=',
),
),
'group_by' => $this->group_by_query . ', order_item_name',
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
// All items from orders - even those refunded
@ -108,20 +108,20 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
'name' => 'order_item_count',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'line_item',
'operator' => '='
)
'operator' => '=',
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
@ -140,20 +140,20 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
)
'name' => 'order_item_count',
),
),
'where' => array(
array(
'key' => 'order_items.order_item_type',
'value' => 'line_item',
'operator' => '='
)
'operator' => '=',
),
),
'query_type' => 'get_var',
'filter_range' => true,
'order_types' => wc_get_order_types( 'order-count' ),
'order_status' => array( 'refunded' )
'order_status' => array( 'refunded' ),
) ) );
/**
@ -164,27 +164,27 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
'name' => 'total_sales',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
'name' => 'total_shipping',
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_tax'
'name' => 'total_tax',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
'name' => 'total_shipping_tax',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
),
'group_by' => $this->group_by_query,
@ -192,7 +192,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' )
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
) );
/**
@ -204,34 +204,34 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'_order_total' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_refund'
'name' => 'total_refund',
),
'_order_shipping' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_shipping'
'name' => 'total_shipping',
),
'_order_tax' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_tax'
'name' => 'total_tax',
),
'_order_shipping_tax' => array(
'type' => 'parent_meta',
'function' => '',
'name' => 'total_shipping_tax'
'name' => 'total_shipping_tax',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
)
'name' => 'post_date',
),
),
'group_by' => 'posts.post_parent',
'query_type' => 'get_results',
'filter_range' => true,
'order_status' => false,
'parent_order_status' => array( 'refunded' )
'parent_order_status' => array( 'refunded' ),
) );
/**
@ -242,53 +242,53 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'ID' => array(
'type' => 'post_data',
'function' => '',
'name' => 'refund_id'
'name' => 'refund_id',
),
'_refund_amount' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_refund'
'name' => 'total_refund',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
'order_item_type' => array(
'type' => 'order_item',
'function' => '',
'name' => 'item_type',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_order_total' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_sales'
'name' => 'total_sales',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_shipping',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_order_tax' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_tax',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => '',
'name' => 'total_shipping_tax',
'join_type' => 'LEFT'
'join_type' => 'LEFT',
),
'_qty' => array(
'type' => 'order_item_meta',
'function' => 'SUM',
'name' => 'order_item_count',
'join_type' => 'LEFT'
)
'join_type' => 'LEFT',
),
),
'group_by' => 'refund_id',
'order_by' => 'post_date ASC',
@ -312,12 +312,12 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
$this->report_data->total_tax_refunded += ( $value->total_tax * -1 );
$this->report_data->total_refunds += $value->total_refund;
}
elseif( 'shipping' === $value->item_type ) {
elseif ( 'shipping' === $value->item_type ) {
$this->report_data->total_shipping_tax_refunded += ( $value->total_shipping_tax * -1 );
$this->report_data->total_shipping_refunded += wc_format_decimal( $value->total_refund, 2 );
$this->report_data->total_refunds += $value->total_refund;
}
elseif( 'line_item' === $value->item_type ) {
elseif ( 'line_item' === $value->item_type ) {
$this->report_data->total_tax_refunded += ( $value->total_tax * -1 );
$this->report_data->refunded_order_items += absint( $value->order_item_count );
$this->report_data->total_refunds += $value->total_refund;
@ -344,7 +344,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
// Item counts
$this->report_data->total_items = absint( array_sum( wp_list_pluck( $this->report_data->order_items, 'order_item_count' ) ) ) - $this->report_data->refunded_order_items;
// 3rd party filtering of report data
$this->report_data = apply_filters( 'woocommerce_admin_report_data', $this->report_data );
}
@ -373,13 +373,13 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'title' => sprintf( __( '%s gross sales in this period', 'woocommerce' ), '<strong>' . wc_price( $data->total_sales ) . '</strong>' ),
'placeholder' => __( 'This is the sum of the order totals after any refunds and including shipping and taxes.', 'woocommerce' ),
'color' => $this->chart_colours['sales_amount'],
'highlight_series' => 6
'highlight_series' => 6,
);
if ( $data->average_total_sales > 0 ) {
$legend[] = array(
'title' => $average_total_sales_title,
'color' => $this->chart_colours['average'],
'highlight_series' => 2
'highlight_series' => 2,
);
}
@ -387,41 +387,41 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'title' => sprintf( __( '%s net sales in this period', 'woocommerce' ), '<strong>' . wc_price( $data->net_sales ) . '</strong>' ),
'placeholder' => __( 'This is the sum of the order totals after any refunds and excluding shipping and taxes.', 'woocommerce' ),
'color' => $this->chart_colours['net_sales_amount'],
'highlight_series' => 7
'highlight_series' => 7,
);
if ( $data->average_sales > 0 ) {
$legend[] = array(
'title' => $average_sales_title,
'color' => $this->chart_colours['net_average'],
'highlight_series' => 3
'highlight_series' => 3,
);
}
$legend[] = array(
'title' => sprintf( __( '%s orders placed', 'woocommerce' ), '<strong>' . $data->total_orders . '</strong>' ),
'color' => $this->chart_colours['order_count'],
'highlight_series' => 1
'highlight_series' => 1,
);
$legend[] = array(
'title' => sprintf( __( '%s items purchased', 'woocommerce' ), '<strong>' . $data->total_items . '</strong>' ),
'color' => $this->chart_colours['item_count'],
'highlight_series' => 0
'highlight_series' => 0,
);
$legend[] = array(
'title' => sprintf( _nx( '%s refunded %d order', '%s refunded %d orders', $this->report_data->total_refunded_orders, '%s = amount of the refunds, %d = number of refunded orders.', 'woocommerce' ), '<strong>' . wc_price( $data->total_refunds ) . '</strong>', $this->report_data->total_refunded_orders ) . ' (' . sprintf( _n( '%d item', '%d items', $this->report_data->refunded_order_items, 'woocommerce' ), $this->report_data->refunded_order_items ) . ')',
'color' => $this->chart_colours['refund_amount'],
'highlight_series' => 8
'highlight_series' => 8,
);
$legend[] = array(
'title' => sprintf( __( '%s charged for shipping', 'woocommerce' ), '<strong>' . wc_price( $data->total_shipping ) . '</strong>' ),
'color' => $this->chart_colours['shipping_amount'],
'highlight_series' => 5
'highlight_series' => 5,
);
$legend[] = array(
'title' => sprintf( __( '%s worth of coupons used', 'woocommerce' ), '<strong>' . wc_price( $data->total_coupons ) . '</strong>' ),
'color' => $this->chart_colours['coupon_amount'],
'highlight_series' => 4
'highlight_series' => 4,
);
return $legend;
@ -435,7 +435,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
@ -447,7 +447,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'item_count' => '#ecf0f1',
'shipping_amount' => '#5cc488',
'coupon_amount' => '#f1c40f',
'refund_amount' => '#e74c3c'
'refund_amount' => '#e74c3c',
);
$current_range = ! empty( $_GET['range'] ) ? sanitize_text_field( $_GET['range'] ) : '7day';
@ -513,7 +513,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'shipping_tax_amounts' => $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_shipping_tax', $this->chart_interval, $this->start_date, $this->chart_groupby ),
'tax_amounts' => $this->prepare_chart_data( $this->report_data->orders, 'post_date', 'total_tax', $this->chart_interval, $this->start_date, $this->chart_groupby ),
'net_order_amounts' => array(),
'gross_order_amounts' => array()
'gross_order_amounts' => array(),
);
foreach ( $data['order_amounts'] as $order_amount_key => $order_amount_value ) {
@ -522,16 +522,16 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
$data['net_order_amounts'][ $order_amount_key ] = $order_amount_value;
// subtract the sum of the values from net order amounts
$data['net_order_amounts'][ $order_amount_key ][1] -=
$data['net_order_amounts'][ $order_amount_key ][1] -=
$data['refund_amounts'][ $order_amount_key ][1] +
$data['shipping_amounts'][ $order_amount_key ][1] +
$data['shipping_tax_amounts'][ $order_amount_key ][1] +
$data['shipping_amounts'][ $order_amount_key ][1] +
$data['shipping_tax_amounts'][ $order_amount_key ][1] +
$data['tax_amounts'][ $order_amount_key ][1];
}
// 3rd party filtering of report data
$data = apply_filters( 'woocommerce_admin_report_chart_data', $data );
// Encode in json format
$chart_data = json_encode( array(
'order_counts' => array_values( $data['order_counts'] ),
@ -541,7 +541,7 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report {
'net_order_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['net_order_amounts'] ) ),
'shipping_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['shipping_amounts'] ) ),
'coupon_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['coupon_amounts'] ) ),
'refund_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['refund_amounts'] ) )
'refund_amounts' => array_map( array( $this, 'round_chart_totals' ), array_values( $data['refund_amounts'] ) ),
) );
?>
<div class="chart-container">

View File

@ -64,8 +64,8 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_amount'
)
'name' => 'order_item_amount',
),
),
'where_meta' => array(
'relation' => 'OR',
@ -73,11 +73,11 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
)
),
'query_type' => 'get_var',
'filter_range' => true
'filter_range' => true,
) );
$total_items = absint( $this->get_order_report_data( array(
@ -86,8 +86,8 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
)
'name' => 'order_item_count',
),
),
'where_meta' => array(
'relation' => 'OR',
@ -95,23 +95,23 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
)
),
'query_type' => 'get_var',
'filter_range' => true
'filter_range' => true,
) ) );
$legend[] = array(
'title' => sprintf( __( '%s sales for the selected items', 'woocommerce' ), '<strong>' . wc_price( $total_sales ) . '</strong>' ),
'color' => $this->chart_colours['sales_amount'],
'highlight_series' => 1
'highlight_series' => 1,
);
$legend[] = array(
'title' => sprintf( __( '%s purchases for the selected items', 'woocommerce' ), '<strong>' . ( $total_items ) . '</strong>' ),
'color' => $this->chart_colours['item_count'],
'highlight_series' => 0
'highlight_series' => 0,
);
return $legend;
@ -126,7 +126,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'year' => __( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
'7day' => __( 'Last 7 Days', 'woocommerce' )
'7day' => __( 'Last 7 Days', 'woocommerce' ),
);
$this->chart_colours = array(
@ -156,13 +156,13 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
if ( ! empty( $this->product_ids ) ) {
$widgets[] = array(
'title' => __( 'Showing reports for:', 'woocommerce' ),
'callback' => array( $this, 'current_filters' )
'callback' => array( $this, 'current_filters' ),
);
}
$widgets[] = array(
'title' => '',
'callback' => array( $this, 'products_widget' )
'callback' => array( $this, 'products_widget' ),
);
return $widgets;
@ -220,20 +220,20 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( $top_sellers ) {
@ -260,28 +260,28 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_qty' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty'
)
'name' => 'order_item_qty',
),
),
'where_meta' => array(
array(
'type' => 'order_item_meta',
'meta_key' => '_line_subtotal',
'meta_value' => '0',
'operator' => '='
)
'operator' => '=',
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( $top_freebies ) {
@ -308,20 +308,20 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
'_line_total' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_total'
)
'name' => 'order_item_total',
),
),
'order_by' => 'order_item_total DESC',
'group_by' => 'product_id',
'limit' => 12,
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
if ( $top_earners ) {
@ -402,19 +402,19 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_count'
'name' => 'order_item_count',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
'_product_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
)
'name' => 'product_id',
),
),
'where_meta' => array(
'relation' => 'OR',
@ -422,13 +422,13 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
),
),
'group_by' => 'product_id,' . $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
$order_item_amounts = $this->get_order_report_data( array(
@ -437,18 +437,18 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_amount'
'name' => 'order_item_amount',
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
'_product_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'line_item',
'function' => '',
'name' => 'product_id'
'name' => 'product_id',
),
),
'where_meta' => array(
@ -457,13 +457,13 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
'type' => 'order_item_meta',
'meta_key' => array( '_product_id', '_variation_id' ),
'meta_value' => $this->product_ids,
'operator' => 'IN'
'operator' => 'IN',
),
),
'group_by' => 'product_id, ' . $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
'filter_range' => true,
) );
// Prepare data for report
@ -473,7 +473,7 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
// Encode in json format
$chart_data = json_encode( array(
'order_item_counts' => array_values( $order_item_counts ),
'order_item_amounts' => array_values( $order_item_amounts )
'order_item_amounts' => array_values( $order_item_amounts ),
) );
?>
<div class="chart-container">

View File

@ -33,7 +33,7 @@ class WC_Report_Stock extends WP_List_Table {
parent::__construct( array(
'singular' => __( 'Stock', 'woocommerce' ),
'plural' => __( 'Stock', 'woocommerce' ),
'ajax' => false
'ajax' => false,
) );
}
@ -80,7 +80,7 @@ class WC_Report_Stock extends WP_List_Table {
$product = wc_get_product( $item->id );
}
switch( $column_name ) {
switch ( $column_name ) {
case 'product' :
if ( $sku = $product->get_sku() ) {
@ -132,14 +132,14 @@ class WC_Report_Stock extends WP_List_Table {
$actions['edit'] = array(
'url' => admin_url( 'post.php?post=' . $action_id . '&action=edit' ),
'name' => __( 'Edit', 'woocommerce' ),
'action' => "edit"
'action' => "edit",
);
if ( $product->is_visible() ) {
$actions['view'] = array(
'url' => get_permalink( $action_id ),
'name' => __( 'View', 'woocommerce' ),
'action' => "view"
'action' => "view",
);
}
@ -189,7 +189,7 @@ class WC_Report_Stock extends WP_List_Table {
$this->set_pagination_args( array(
'total_items' => $this->max_items,
'per_page' => $per_page,
'total_pages' => ceil( $this->max_items / $per_page )
'total_pages' => ceil( $this->max_items / $per_page ),
) );
}
}

View File

@ -76,30 +76,30 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
'order_item_name' => array(
'type' => 'order_item',
'function' => '',
'name' => 'tax_rate'
'name' => 'tax_rate',
),
'tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'tax_amount'
'name' => 'tax_amount',
),
'shipping_tax_amount' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'shipping_tax_amount'
'name' => 'shipping_tax_amount',
),
'rate_id' => array(
'type' => 'order_item_meta',
'order_item_type' => 'tax',
'function' => '',
'name' => 'rate_id'
'name' => 'rate_id',
),
'ID' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_id'
'name' => 'post_id',
),
);
@ -107,13 +107,13 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
array(
'key' => 'order_item_type',
'value' => 'tax',
'operator' => '='
'operator' => '=',
),
array(
'key' => 'order_item_name',
'value' => '',
'operator' => '!='
)
'operator' => '!=',
),
);
$tax_rows_orders = $this->get_order_report_data( array(
@ -124,7 +124,7 @@ class WC_Report_Taxes_By_Code extends WC_Admin_Report {
'filter_range' => true,
'order_types' => array_merge( wc_get_order_types( 'sales-reports' ), array( 'shop_order_refund' ) ),
'order_status' => array( 'completed', 'processing', 'on-hold' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ) // Partial refunds inside refunded orders should be ignored
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ), // Partial refunds inside refunded orders should be ignored
) );
// Merge

View File

@ -74,22 +74,22 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'tax_amount'
'name' => 'tax_amount',
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping_tax_amount'
'name' => 'shipping_tax_amount',
),
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
'name' => 'total_sales',
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
'name' => 'total_shipping',
),
'ID' => array(
'type' => 'post_data',
@ -100,7 +100,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
'name' => 'post_date',
),
);
@ -111,7 +111,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold' )
'order_status' => array( 'completed', 'processing', 'on-hold' ),
) );
$tax_rows_partial_refunds = $this->get_order_report_data( array(
@ -121,7 +121,7 @@ class WC_Report_Taxes_By_Date extends WC_Admin_Report {
'query_type' => 'get_results',
'filter_range' => true,
'order_types' => array( 'shop_order_refund' ),
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ) // Partial refunds inside refunded orders should be ignored
'parent_order_status' => array( 'completed', 'processing', 'on-hold' ),// Partial refunds inside refunded orders should be ignored
) );
// Merge

View File

@ -55,7 +55,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
array( 'type' => 'sectionend', 'id' => 'account_page_options' ),
array( 'title' => '', 'type' => 'title', 'id' => 'account_registration_options' ),
array( 'title' => '', 'type' => 'title', 'id' => 'account_registration_options' ),
array(
'title' => __( 'Enable Registration', 'woocommerce' ),
@ -64,7 +64,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -73,7 +73,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
@ -83,7 +83,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -93,7 +93,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -102,7 +102,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'account_registration_options' ),

View File

@ -44,7 +44,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
$sections = array(
'' => __( 'Settings', 'woocommerce' ),
'keys' => __( 'Keys/Apps', 'woocommerce' ),
'webhooks' => __( 'Webhooks', 'woocommerce' )
'webhooks' => __( 'Webhooks', 'woocommerce' ),
);
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
@ -61,7 +61,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
'title' => __( 'General Options', 'woocommerce' ),
'type' => 'title',
'desc' => '',
'id' => 'general_options'
'id' => 'general_options',
),
array(
@ -74,7 +74,7 @@ class WC_Settings_Rest_API extends WC_Settings_Page {
array(
'type' => 'sectionend',
'id' => 'general_options'
'id' => 'general_options',
),
) );

View File

@ -41,7 +41,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
*/
public function get_sections() {
$sections = array(
'' => __( 'Checkout Options', 'woocommerce' )
'' => __( 'Checkout Options', 'woocommerce' ),
);
if ( ! defined( 'WC_INSTALLING' ) ) {
@ -78,7 +78,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'woocommerce' ),
'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'woocommerce' ),
),
array(
@ -86,7 +86,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
'id' => 'woocommerce_calc_discounts_sequentially',
'default' => 'no',
'type' => 'checkbox',
'desc_tip' => __( 'When applying multiple coupons, apply the first coupon to the full price and the second coupon to the discounted price and so on.', 'woocommerce' ),
'desc_tip' => __( 'When applying multiple coupons, apply the first coupon to the full price and the second coupon to the discounted price and so on.', 'woocommerce' ),
'checkboxgroup' => 'end',
'autoload' => false,
),
@ -94,7 +94,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
array(
'title' => _x( 'Checkout Process', 'Settings group label', 'woocommerce' ),
'desc' => __( 'Enable guest checkout', 'woocommerce' ),
'desc_tip' => __( 'Allows customers to checkout without creating an account.', 'woocommerce' ),
'desc_tip' => __( 'Allows customers to checkout without creating an account.', 'woocommerce' ),
'id' => 'woocommerce_enable_guest_checkout',
'default' => 'yes',
'type' => 'checkbox',
@ -219,7 +219,6 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
'desc_tip' => true,
),
array(
'type' => 'sectionend',
'id' => 'checkout_endpoint_options',
@ -289,7 +288,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
'sort' => '',
'name' => __( 'Gateway', 'woocommerce' ),
'id' => __( 'Gateway ID', 'woocommerce' ),
'status' => __( 'Enabled', 'woocommerce' )
'status' => __( 'Enabled', 'woocommerce' ),
) );
foreach ( $columns as $key => $column ) {

View File

@ -40,7 +40,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
*/
public function get_sections() {
$sections = array(
'' => __( 'Email Options', 'woocommerce' )
'' => __( 'Email Options', 'woocommerce' ),
);
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
}
@ -71,7 +71,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'min-width:300px;',
'default' => esc_attr( get_bloginfo( 'name', 'display' ) ),
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -80,12 +80,12 @@ class WC_Settings_Emails extends WC_Settings_Page {
'id' => 'woocommerce_email_from_address',
'type' => 'email',
'custom_attributes' => array(
'multiple' => 'multiple'
'multiple' => 'multiple',
),
'css' => 'min-width:300px;',
'default' => get_option( 'admin_email' ),
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array( 'type' => 'sectionend', 'id' => 'email_options' ),
@ -101,7 +101,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'placeholder' => __( 'N/A', 'woocommerce' ),
'default' => '',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -113,7 +113,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'type' => 'textarea',
'default' => get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by WooCommerce', 'woocommerce' ),
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -124,7 +124,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#96588a',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -135,7 +135,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#f7f7f7',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -146,7 +146,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#ffffff',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -157,7 +157,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:6em;',
'default' => '#3c3c3c',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array( 'type' => 'sectionend', 'id' => 'email_notification_settings' ),
@ -233,7 +233,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'name' => __( 'Email', 'woocommerce' ),
'email_type' => __( 'Content Type', 'woocommerce' ),
'recipient' => __( 'Recipient(s)', 'woocommerce' ),
'actions' => ''
'actions' => '',
) );
foreach ( $columns as $key => $column ) {
echo '<th class="wc-email-settings-table-' . esc_attr( $key ) . '">' . esc_html( $column ) . '</th>';

View File

@ -56,7 +56,7 @@ class WC_Settings_General extends WC_Settings_Page {
'css' => 'min-width:350px;',
'default' => 'GB',
'type' => 'single_select_country',
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -67,12 +67,12 @@ class WC_Settings_General extends WC_Settings_Page {
'type' => 'select',
'class' => 'wc-enhanced-select',
'css' => 'min-width: 350px;',
'desc_tip' => true,
'desc_tip' => true,
'options' => array(
'all' => __( 'Sell to All Countries', 'woocommerce' ),
'all_except' => __( 'Sell to All Countries, Except For&hellip;', 'woocommerce' ),
'specific' => __( 'Sell to Specific Countries', 'woocommerce' )
)
'specific' => __( 'Sell to Specific Countries', 'woocommerce' ),
),
),
array(
@ -81,7 +81,7 @@ class WC_Settings_General extends WC_Settings_Page {
'id' => 'woocommerce_all_except_countries',
'css' => 'min-width: 350px;',
'default' => '',
'type' => 'multi_select_countries'
'type' => 'multi_select_countries',
),
array(
@ -90,7 +90,7 @@ class WC_Settings_General extends WC_Settings_Page {
'id' => 'woocommerce_specific_allowed_countries',
'css' => 'min-width: 350px;',
'default' => '',
'type' => 'multi_select_countries'
'type' => 'multi_select_countries',
),
array(
@ -106,7 +106,7 @@ class WC_Settings_General extends WC_Settings_Page {
'all' => __( 'Ship to all countries', 'woocommerce' ),
'specific' => __( 'Ship to specific countries only', 'woocommerce' ),
'disabled' => __( 'Disable shipping &amp; shipping calculations', 'woocommerce' ),
)
),
),
array(
@ -115,13 +115,13 @@ class WC_Settings_General extends WC_Settings_Page {
'id' => 'woocommerce_specific_ship_to_countries',
'css' => '',
'default' => '',
'type' => 'multi_select_countries'
'type' => 'multi_select_countries',
),
array(
'title' => __( 'Default Customer Location', 'woocommerce' ),
'id' => 'woocommerce_default_customer_address',
'desc_tip' => __( 'This option determines a customers default location. The MaxMind GeoLite Database will be periodically downloaded to your wp-content directory if using geolocation.', 'woocommerce' ),
'desc_tip' => __( 'This option determines a customers default location. The MaxMind GeoLite Database will be periodically downloaded to your wp-content directory if using geolocation.', 'woocommerce' ),
'default' => 'geolocation',
'type' => 'select',
'class' => 'wc-enhanced-select',
@ -138,7 +138,7 @@ class WC_Settings_General extends WC_Settings_Page {
'desc' => __( 'Enable taxes and tax calculations', 'woocommerce' ),
'id' => 'woocommerce_calc_taxes',
'default' => 'no',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -146,7 +146,7 @@ class WC_Settings_General extends WC_Settings_Page {
'desc' => __( 'Enable site-wide store notice text', 'woocommerce' ),
'id' => 'woocommerce_demo_store',
'default' => 'no',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -156,10 +156,10 @@ class WC_Settings_General extends WC_Settings_Page {
'default' => __( 'This is a demo store for testing purposes &mdash; no orders shall be fulfilled.', 'woocommerce' ),
'type' => 'textarea',
'css' => 'width:350px; height: 65px;',
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'general_options'),
array( 'type' => 'sectionend', 'id' => 'general_options' ),
array( 'title' => __( 'Currency Options', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'The following options affect how prices are displayed on the frontend.', 'woocommerce' ), 'id' => 'pricing_options' ),
@ -171,8 +171,8 @@ class WC_Settings_General extends WC_Settings_Page {
'default' => 'GBP',
'type' => 'select',
'class' => 'wc-enhanced-select',
'desc_tip' => true,
'options' => $currency_code_options
'desc_tip' => true,
'options' => $currency_code_options,
),
array(
@ -187,9 +187,9 @@ class WC_Settings_General extends WC_Settings_Page {
'left' => __( 'Left', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . '99.99)',
'right' => __( 'Right', 'woocommerce' ) . ' (99.99' . get_woocommerce_currency_symbol() . ')',
'left_space' => __( 'Left with space', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ' 99.99)',
'right_space' => __( 'Right with space', 'woocommerce' ) . ' (99.99 ' . get_woocommerce_currency_symbol() . ')'
'right_space' => __( 'Right with space', 'woocommerce' ) . ' (99.99 ' . get_woocommerce_currency_symbol() . ')',
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -199,7 +199,7 @@ class WC_Settings_General extends WC_Settings_Page {
'css' => 'width:50px;',
'default' => ',',
'type' => 'text',
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -209,7 +209,7 @@ class WC_Settings_General extends WC_Settings_Page {
'css' => 'width:50px;',
'default' => '.',
'type' => 'text',
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -218,15 +218,15 @@ class WC_Settings_General extends WC_Settings_Page {
'id' => 'woocommerce_price_num_decimals',
'css' => 'width:50px;',
'default' => '2',
'desc_tip' => true,
'desc_tip' => true,
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
)
'step' => 1,
),
),
array( 'type' => 'sectionend', 'id' => 'pricing_options' )
array( 'type' => 'sectionend', 'id' => 'pricing_options' ),
) );
@ -255,7 +255,6 @@ class WC_Settings_General extends WC_Settings_Page {
WC_Admin_Settings::save_fields( $settings );
}
}
endif;

View File

@ -85,7 +85,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'title' => __( 'Shop & Product Pages', 'woocommerce' ),
'type' => 'title',
'desc' => '',
'id' => 'catalog_options'
'id' => 'catalog_options',
),
array(
@ -112,7 +112,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'subcategories' => __( 'Show categories', 'woocommerce' ),
'both' => __( 'Show categories &amp; products', 'woocommerce' ),
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -128,7 +128,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'subcategories' => __( 'Show subcategories', 'woocommerce' ),
'both' => __( 'Show subcategories &amp; products', 'woocommerce' ),
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -147,7 +147,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'price' => __( 'Sort by price (asc)', 'woocommerce' ),
'price-desc' => __( 'Sort by price (desc)', 'woocommerce' ),
) ),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -156,7 +156,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'id' => 'woocommerce_cart_redirect_after_add',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start'
'checkboxgroup' => 'start',
),
array(
@ -164,19 +164,19 @@ class WC_Settings_Products extends WC_Settings_Page {
'id' => 'woocommerce_enable_ajax_add_to_cart',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end'
'checkboxgroup' => 'end',
),
array(
'type' => 'sectionend',
'id' => 'catalog_options'
'id' => 'catalog_options',
),
array(
'title' => __( 'Product Images', 'woocommerce' ),
'type' => 'title',
'desc' => sprintf( __( 'These settings affect the display and dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to <a target="_blank" href="%s">regenerate your thumbnails</a>.', 'woocommerce' ), 'https://wordpress.org/extend/plugins/regenerate-thumbnails/' ),
'id' => 'image_options'
'id' => 'image_options',
),
array(
@ -188,9 +188,9 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => array(
'width' => '300',
'height' => '300',
'crop' => 1
'crop' => 1,
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -202,9 +202,9 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => array(
'width' => '600',
'height' => '600',
'crop' => 1
'crop' => 1,
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -216,9 +216,9 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => array(
'width' => '180',
'height' => '180',
'crop' => 1
'crop' => 1,
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -227,13 +227,13 @@ class WC_Settings_Products extends WC_Settings_Page {
'id' => 'woocommerce_enable_lightbox',
'default' => 'yes',
'desc_tip' => __( 'Include WooCommerce\'s lightbox. Product gallery images will open in a lightbox.', 'woocommerce' ),
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
'type' => 'sectionend',
'id' => 'image_options'
)
'id' => 'image_options',
),
));
} elseif ( 'inventory' == $current_section ) {
@ -244,7 +244,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'title' => __( 'Inventory', 'woocommerce' ),
'type' => 'title',
'desc' => '',
'id' => 'product_inventory_options'
'id' => 'product_inventory_options',
),
array(
@ -252,7 +252,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'desc' => __( 'Enable stock management', 'woocommerce' ),
'id' => 'woocommerce_manage_stock',
'default' => 'yes',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -262,11 +262,11 @@ class WC_Settings_Products extends WC_Settings_Page {
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
'step' => 1,
),
'css' => 'width: 80px;',
'default' => '60',
'autoload' => false
'autoload' => false,
),
array(
@ -276,7 +276,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -285,7 +285,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
@ -296,7 +296,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => get_option( 'admin_email' ),
'css' => 'width: 250px;',
'autoload' => false,
'desc_tip' => true
'desc_tip' => true,
),
array(
@ -307,7 +307,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
'step' => 1,
),
'default' => '2',
'autoload' => false,
@ -322,7 +322,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'type' => 'number',
'custom_attributes' => array(
'min' => 0,
'step' => 1
'step' => 1,
),
'default' => '0',
'desc_tip' => true,
@ -333,7 +333,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'desc' => __( 'Hide out of stock items from the catalog', 'woocommerce' ),
'id' => 'woocommerce_hide_out_of_stock_items',
'default' => 'no',
'type' => 'checkbox'
'type' => 'checkbox',
),
array(
@ -349,12 +349,12 @@ class WC_Settings_Products extends WC_Settings_Page {
'low_amount' => __( 'Only show stock when low e.g. "Only 2 left in stock" vs. "In Stock"', 'woocommerce' ),
'no_amount' => __( 'Never show stock amount', 'woocommerce' ),
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
'type' => 'sectionend',
'id' => 'product_inventory_options'
'id' => 'product_inventory_options',
),
));
@ -364,7 +364,7 @@ class WC_Settings_Products extends WC_Settings_Page {
array(
'title' => __( 'Downloadable Products', 'woocommerce' ),
'type' => 'title',
'id' => 'digital_download_options'
'id' => 'digital_download_options',
),
array(
@ -375,13 +375,13 @@ class WC_Settings_Products extends WC_Settings_Page {
'class' => 'wc-enhanced-select',
'css' => 'min-width:300px;',
'default' => 'force',
'desc_tip' => true,
'desc_tip' => true,
'options' => array(
'force' => __( 'Force Downloads', 'woocommerce' ),
'xsendfile' => __( 'X-Accel-Redirect/X-Sendfile', 'woocommerce' ),
'redirect' => __( 'Redirect only', 'woocommerce' ),
),
'autoload' => false
'autoload' => false,
),
array(
@ -392,7 +392,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'no',
'desc_tip' => __( 'This setting does not apply to guest purchases.', 'woocommerce' ),
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -402,12 +402,12 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'yes',
'desc_tip' => __( 'Enable this option to grant access to downloads when orders are "processing", rather than "completed".', 'woocommerce' ),
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
'type' => 'sectionend',
'id' => 'digital_download_options'
'id' => 'digital_download_options',
),
));
@ -417,7 +417,7 @@ class WC_Settings_Products extends WC_Settings_Page {
array(
'title' => __( 'Measurements', 'woocommerce' ),
'type' => 'title',
'id' => 'product_measurement_options'
'id' => 'product_measurement_options',
),
array(
@ -434,7 +434,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'lbs' => __( 'lbs', 'woocommerce' ),
'oz' => __( 'oz', 'woocommerce' ),
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -452,7 +452,7 @@ class WC_Settings_Products extends WC_Settings_Page {
'in' => __( 'in', 'woocommerce' ),
'yd' => __( 'yd', 'woocommerce' ),
),
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -509,7 +509,7 @@ class WC_Settings_Products extends WC_Settings_Page {
array(
'type' => 'sectionend',
'id' => 'product_rating_options'
'id' => 'product_rating_options',
),
));

View File

@ -47,7 +47,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
$sections = array(
'' => __( 'Shipping Zones', 'woocommerce' ),
'options' => __( 'Shipping Options', 'woocommerce' ),
'classes' => __( 'Shipping Classes', 'woocommerce' )
'classes' => __( 'Shipping Classes', 'woocommerce' ),
);
if ( ! defined( 'WC_INSTALLING' ) ) {
@ -83,7 +83,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false
'autoload' => false,
),
array(
@ -92,7 +92,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end',
'autoload' => false
'autoload' => false,
),
array(
@ -107,7 +107,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'billing_only' => __( 'Force shipping to the customer billing address', 'woocommerce' ),
),
'autoload' => false,
'desc_tip' => true,
'desc_tip' => true,
'show_if_checked' => 'option',
),
@ -118,7 +118,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'id' => 'woocommerce_shipping_debug_mode',
'default' => 'no',
'type' => 'checkbox',
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'shipping_options' ),
@ -305,7 +305,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
'wc_shipping_classes_nonce' => wp_create_nonce( 'wc_shipping_classes_nonce' ),
'strings' => array(
'unload_confirmation_msg' => __( 'Your changed data will be lost if you leave this page without saving.', 'woocommerce' ),
'save_failed' => __( 'Your changes were not saved. Please retry.', 'woocommerce' )
'save_failed' => __( 'Your changes were not saved. Please retry.', 'woocommerce' ),
),
) );
wp_enqueue_script( 'wc-shipping-classes' );

View File

@ -53,7 +53,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
public function get_sections() {
$sections = array(
'' => __( 'Tax Options', 'woocommerce' ),
'standard' => __( 'Standard Rates', 'woocommerce' )
'standard' => __( 'Standard Rates', 'woocommerce' ),
);
// Get tax classes and display as links
@ -202,7 +202,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
$tax_classes = WC_Tax::get_tax_classes();
$current_class = '';
foreach( $tax_classes as $class ) {
foreach ( $tax_classes as $class ) {
if ( sanitize_title( $class ) == $current_section ) {
$current_class = $class;
}
@ -225,7 +225,7 @@ class WC_Settings_Tax extends WC_Settings_Page {
'tax_rate_state',
'tax_rate',
'tax_rate_name',
'tax_rate_priority'
'tax_rate_priority',
);
foreach ( $tax_rate_keys as $tax_rate_key ) {

View File

@ -61,7 +61,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'product.updated' => __( 'Product Updated', 'woocommerce' ),
'product.deleted' => __( 'Product Deleted', 'woocommerce' ),
'action' => __( 'Action', 'woocommerce' ),
'custom' => __( 'Custom', 'woocommerce' )
'custom' => __( 'Custom', 'woocommerce' ),
) );
foreach ( $topics as $topic_slug => $topic_name ) : ?>

View File

@ -13,24 +13,24 @@ return apply_filters( 'woocommerce_tax_settings', array(
'id' => 'woocommerce_prices_include_tax',
'default' => 'no',
'type' => 'radio',
'desc_tip' => __( 'This option is important as it will affect how you input prices. Changing it will not update existing products.', 'woocommerce' ),
'desc_tip' => __( 'This option is important as it will affect how you input prices. Changing it will not update existing products.', 'woocommerce' ),
'options' => array(
'yes' => __( 'Yes, I will enter prices inclusive of tax', 'woocommerce' ),
'no' => __( 'No, I will enter prices exclusive of tax', 'woocommerce' )
'no' => __( 'No, I will enter prices exclusive of tax', 'woocommerce' ),
),
),
array(
'title' => __( 'Calculate Tax Based On', 'woocommerce' ),
'id' => 'woocommerce_tax_based_on',
'desc_tip' => __( 'This option determines which address is used to calculate tax.', 'woocommerce' ),
'desc_tip' => __( 'This option determines which address is used to calculate tax.', 'woocommerce' ),
'default' => 'shipping',
'type' => 'select',
'class' => 'wc-enhanced-select',
'options' => array(
'shipping' => __( 'Customer shipping address', 'woocommerce' ),
'billing' => __( 'Customer billing address', 'woocommerce' ),
'base' => __( 'Shop base address', 'woocommerce' )
'base' => __( 'Shop base address', 'woocommerce' ),
),
),
@ -43,7 +43,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'type' => 'select',
'class' => 'wc-enhanced-select',
'options' => array( '' => __( 'Shipping tax class based on cart items', 'woocommerce' ), 'standard' => __( 'Standard', 'woocommerce' ) ) + $classes_options,
'desc_tip' => true,
'desc_tip' => true,
),
array(
@ -60,7 +60,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'id' => 'woocommerce_tax_classes',
'css' => 'width:100%; height: 65px;',
'type' => 'textarea',
'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'woocommerce' ), PHP_EOL )
'default' => sprintf( __( 'Reduced Rate%sZero Rate', 'woocommerce' ), PHP_EOL ),
),
array(
@ -72,7 +72,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'options' => array(
'incl' => __( 'Including tax', 'woocommerce' ),
'excl' => __( 'Excluding tax', 'woocommerce' ),
)
),
),
array(
@ -85,7 +85,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'incl' => __( 'Including tax', 'woocommerce' ),
'excl' => __( 'Excluding tax', 'woocommerce' ),
),
'autoload' => false
'autoload' => false,
),
array(
@ -107,7 +107,7 @@ return apply_filters( 'woocommerce_tax_settings', array(
'single' => __( 'As a single total', 'woocommerce' ),
'itemized' => __( 'Itemized', 'woocommerce' ),
),
'autoload' => false
'autoload' => false,
),
array( 'type' => 'sectionend', 'id' => 'tax_options' ),

View File

@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
if ( $current_tab == $key ) {
echo 'nav-tab-active';
}
echo '">' . esc_html( $report_group[ 'title' ] ) . '</a>';
echo '">' . esc_html( $report_group['title'] ) . '</a>';
}
do_action( 'wc_reports_tabs' );
@ -51,9 +51,9 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
}
if ( isset( $reports[ $current_tab ][ 'reports' ][ $current_report ] ) ) {
if ( isset( $reports[ $current_tab ]['reports'][ $current_report ] ) ) {
$report = $reports[ $current_tab ][ 'reports' ][ $current_report ];
$report = $reports[ $current_tab ]['reports'][ $current_report ];
if ( ! isset( $report['hide_title'] ) || $report['hide_title'] != true ) {
echo '<h1>' . esc_html( $report['title'] ) . '</h1>';

View File

@ -506,7 +506,7 @@ $pages = $system_status->get_pages();
?></td>
</tr>
<?php
if( $theme['is_child_theme'] ) :
if ( $theme['is_child_theme'] ) :
?>
<tr>
<td data-export-label="Parent Theme Name"><?php _e( 'Parent Theme Name', 'woocommerce' ); ?>:</td>

View File

@ -26,9 +26,9 @@ if ( ! defined( 'ABSPATH' ) ) {
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' ),
'2' => __( 'Increase by (fixed amount or %):', 'woocommerce' ),
'3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' )
'3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' ),
);
foreach ($options as $key => $value) {
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
@ -51,7 +51,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'1' => __( 'Change to:', 'woocommerce' ),
'2' => __( 'Increase by (fixed amount or %):', 'woocommerce' ),
'3' => __( 'Decrease by (fixed amount or %):', 'woocommerce' ),
'4' => __( 'Decrease regular price by (fixed amount or %):', 'woocommerce' )
'4' => __( 'Decrease regular price by (fixed amount or %):', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
@ -75,9 +75,9 @@ if ( ! defined( 'ABSPATH' ) ) {
'' => __( '— No Change —', 'woocommerce' ),
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' )
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
);
foreach ($options as $key => $value) {
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
}
?>
@ -92,7 +92,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'standard' => __( 'Standard', 'woocommerce' )
'standard' => __( 'Standard', 'woocommerce' ),
);
$tax_classes = WC_Tax::get_tax_classes();
@ -120,7 +120,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' )
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -144,7 +144,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' )
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -186,7 +186,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' )
'hidden' => __( 'Hidden', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -203,9 +203,9 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' )
'no' => __( 'No', 'woocommerce' ),
);
foreach ($options as $key => $value) {
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
}
?>
@ -221,7 +221,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
'outofstock' => __( 'Out of stock', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -240,7 +240,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' )
'no' => __( 'No', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -258,7 +258,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'1' => __( 'Change to:', 'woocommerce' )
'1' => __( 'Change to:', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -281,7 +281,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'' => __( '— No Change —', 'woocommerce' ),
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
'yes' => __( 'Allow', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -301,7 +301,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'' => __( '— No Change —', 'woocommerce' ),
'yes' => __( 'Yes', 'woocommerce' ),
'no' => __( 'No', 'woocommerce' )
'no' => __( 'No', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . esc_html( $value ) . '</option>';

View File

@ -54,7 +54,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'taxable' => __( 'Taxable', 'woocommerce' ),
'shipping' => __( 'Shipping only', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' )
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">' . $value . '</option>';
@ -70,7 +70,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<select class="tax_class" name="_tax_class">
<?php
$options = array(
'' => __( 'Standard', 'woocommerce' )
'' => __( 'Standard', 'woocommerce' ),
);
$tax_classes = WC_Tax::get_tax_classes();
@ -143,7 +143,7 @@ if ( ! defined( 'ABSPATH' ) ) {
'visible' => __( 'Catalog &amp; search', 'woocommerce' ),
'catalog' => __( 'Catalog', 'woocommerce' ),
'search' => __( 'Search', 'woocommerce' ),
'hidden' => __( 'Hidden', 'woocommerce' )
'hidden' => __( 'Hidden', 'woocommerce' ),
) );
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';
@ -164,7 +164,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
$options = array(
'instock' => __( 'In stock', 'woocommerce' ),
'outofstock' => __( 'Out of stock', 'woocommerce' )
'outofstock' => __( 'Out of stock', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) .'">'. $value .'</option>';
@ -176,7 +176,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<div class="stock_fields">
<?php if (get_option('woocommerce_manage_stock')=='yes') : ?>
<?php if ( get_option( 'woocommerce_manage_stock' ) == 'yes' ) : ?>
<label class="alignleft manage_stock">
<input type="checkbox" name="_manage_stock" value="1">
<span class="checkbox-title"><?php _e( 'Manage stock?', 'woocommerce' ); ?></span>
@ -200,7 +200,7 @@ if ( ! defined( 'ABSPATH' ) ) {
$options = array(
'no' => __( 'Do not allow', 'woocommerce' ),
'notify' => __( 'Allow, but notify customer', 'woocommerce' ),
'yes' => __( 'Allow', 'woocommerce' )
'yes' => __( 'Allow', 'woocommerce' ),
);
foreach ( $options as $key => $value ) {
echo '<option value="' . esc_attr( $key ) . '">'. $value .'</option>';

View File

@ -36,7 +36,7 @@ function wc_get_screen_ids() {
'edit-product_cat',
'edit-product_tag',
'profile',
'user-edit'
'user-edit',
);
foreach ( wc_get_order_types() as $type ) {
@ -111,7 +111,7 @@ function wc_create_page( $slug, $option = '', $page_title = '', $page_content =
'post_title' => $page_title,
'post_content' => $page_content,
'post_parent' => $post_parent,
'comment_status' => 'closed'
'comment_status' => 'closed',
);
$page_id = wp_insert_post( $page_data );
}

View File

@ -56,7 +56,7 @@ function woocommerce_wp_text_input( $field ) {
if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) {
foreach ( $field['custom_attributes'] as $attribute => $value ){
foreach ( $field['custom_attributes'] as $attribute => $value ) {
$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
}
}
@ -109,7 +109,7 @@ function woocommerce_wp_textarea_input( $field ) {
if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) {
foreach ( $field['custom_attributes'] as $attribute => $value ){
foreach ( $field['custom_attributes'] as $attribute => $value ) {
$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
}
}
@ -148,7 +148,7 @@ function woocommerce_wp_checkbox( $field ) {
if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) {
foreach ( $field['custom_attributes'] as $attribute => $value ){
foreach ( $field['custom_attributes'] as $attribute => $value ) {
$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
}
}
@ -187,7 +187,7 @@ function woocommerce_wp_select( $field ) {
if ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) ) {
foreach ( $field['custom_attributes'] as $attribute => $value ){
foreach ( $field['custom_attributes'] as $attribute => $value ) {
$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $value ) . '"';
}
}

View File

@ -154,7 +154,7 @@ class WC_REST_Authentication {
// From OAuth PHP library, used under MIT license.
$params = array();
if ( preg_match_all( '/(oauth_[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches ) ) {
foreach ( $matches[ 1 ] as $i => $h ) {
foreach ( $matches[1] as $i => $h ) {
$params[ $h ] = urldecode( empty( $matches[3][ $i ] ) ? $matches[4][ $i ] : $matches[3][ $i ] );
}
if ( isset( $params['realm'] ) ) {
@ -224,7 +224,7 @@ class WC_REST_Authentication {
'oauth_timestamp',
'oauth_nonce',
'oauth_signature',
'oauth_signature_method'
'oauth_signature_method',
);
$errors = array();

View File

@ -317,7 +317,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
if ( ! empty( $order_ids ) ) {
unset( $args['s'] );
$args['post__in'] = array_merge( $order_ids, array( 0 ) );
$args['post__in'] = array_merge( $order_ids, array( 0 ) );
}
}
@ -458,7 +458,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
}
// If items have changed, recalculate order totals.
if ( isset( $request[ 'billing' ], $request[ 'shipping' ], $request[ 'line_items' ], $request[ 'shipping' ], $request[ 'fee' ], $request[ 'coupon' ] ) ) {
if ( isset( $request['billing'], $request['shipping'], $request['line_items'], $request['shipping'], $request['fee'], $request['coupon'] ) ) {
$order->calculate_totals();
}

View File

@ -193,7 +193,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
$args['meta_query'][] = array(
'key' => '_sku',
'value' => $request['sku'],
'compare' => '='
'compare' => '=',
);
}
@ -1018,7 +1018,6 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'is_taxonomy' => 1,
);
}
} elseif ( isset( $attribute['options'] ) ) {
// Array based.
if ( is_array( $attribute['options'] ) ) {
@ -1118,7 +1117,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'meta_key' => '_price',
'posts_per_page' => 1,
'post_type' => 'product',
'fields' => 'ids'
'fields' => 'ids',
) );
if ( $children_by_price ) {
@ -1202,7 +1201,6 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
wc_update_product_stock_status( $product->id, $stock_status );
}
} elseif ( 'variable' !== $product_type ) {
wc_update_product_stock_status( $product->id, $stock_status );
}
@ -2407,7 +2405,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'visible' => array(
'description' => __( 'If the variation is visible.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' )
'context' => array( 'view', 'edit' ),
),
'virtual' => array(
'description' => __( 'If the variation is virtual.', 'woocommerce' ),

View File

@ -264,7 +264,6 @@ class WC_REST_Report_Sales_Controller extends WC_REST_Controller {
// Default custom range to today.
$_GET['start_date'] = $_GET['end_date'] = date( 'Y-m-d', current_time( 'timestamp' ) );
}
} else {
$filter['period'] = empty( $filter['period'] ) ? 'week' : $filter['period'];

View File

@ -64,7 +64,7 @@ class WC_REST_Report_Top_Sellers_Controller extends WC_REST_Report_Sales_Control
'order_item_type' => 'line_item',
'function' => 'SUM',
'name' => 'order_item_qty',
)
),
),
'order_by' => 'order_item_qty DESC',
'group_by' => 'product_id',

View File

@ -333,8 +333,15 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
*/
public function allowed_setting_keys( $key ) {
return in_array( $key, array(
'id', 'label', 'description', 'default', 'tip',
'placeholder', 'type', 'options', 'value',
'id',
'label',
'description',
'default',
'tip',
'placeholder',
'type',
'options',
'value',
) );
}
@ -347,9 +354,18 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
*/
public function is_setting_type_valid( $type ) {
return in_array( $type, array(
'text', 'email', 'number', 'color', 'password',
'textarea', 'select', 'multiselect', 'radio', 'checkbox',
'multi_select_countries', 'image_width',
'text',
'email',
'number',
'color',
'password',
'textarea',
'select',
'multiselect',
'radio',
'checkbox',
'multi_select_countries',
'image_width',
) );
}

View File

@ -217,5 +217,4 @@ class WC_REST_Shipping_Methods_Controller extends WC_REST_Controller {
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
);
}
}

View File

@ -281,7 +281,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'type' => 'array',
'context' => array( 'view', 'edit' ),
),
)
),
),
'active_plugins' => array(
'description' => __( 'Active Plugins', 'woocommerce' ),
@ -355,7 +355,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'format' => 'uri',
'context' => array( 'view', 'edit' ),
),
)
),
),
'settings' => array(
'description' => __( 'Settings', 'woocommerce' ),
@ -412,14 +412,14 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'type' => 'array',
'context' => array( 'view', 'edit' ),
),
)
),
),
'pages' => array(
'description' => __( 'WooCommerce Pages', 'woocommerce' ),
'type' => 'array',
'context' => array( 'view', 'edit' ),
),
)
),
);
return $this->add_additional_fields_schema( $schema );
@ -469,8 +469,8 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'user-agent' => 'WooCommerce/' . WC()->version,
'httpversion' => '1.1',
'body' => array(
'cmd' => '_notify-validate'
)
'cmd' => '_notify-validate',
),
) );
$post_response_successful = false;
if ( ! is_wp_error( $post_response ) && $post_response['response']['code'] >= 200 && $post_response['response']['code'] < 300 ) {
@ -610,7 +610,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'fields' => array(
'sections' => false,
'tags' => false,
)
),
) );
if ( is_object( $api ) && ! is_wp_error( $api ) ) {
@ -685,7 +685,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
$outdated_templates = true;
}
}
$override_files[] = array(
$override_files[] = array(
'file' => str_replace( WP_CONTENT_DIR . '/themes/', '', $theme_file ),
'version' => $theme_version,
'core_version' => $core_version,
@ -817,5 +817,4 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller {
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
);
}
}

View File

@ -150,7 +150,7 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
'name' => __( 'Reset Usage Tracking Settings', 'woocommerce' ),
'button' => __( 'Reset usage tracking settings', 'woocommerce' ),
'desc' => __( 'This will reset your usage tracking settings, causing it to show the opt-in banner again and not sending any data.', 'woocommerce' ),
)
),
);
return apply_filters( 'woocommerce_debug_tools', $tools );
@ -430,5 +430,4 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
return array( 'success' => $ran, 'message' => $message );
}
}

View File

@ -139,7 +139,7 @@ class WC_API_Authentication {
$params = WC()->api->server->params['GET'];
$param_names = array( 'oauth_consumer_key', 'oauth_timestamp', 'oauth_nonce', 'oauth_signature', 'oauth_signature_method' );
$param_names = array( 'oauth_consumer_key', 'oauth_timestamp', 'oauth_nonce', 'oauth_signature', 'oauth_signature_method' );
// Check for required OAuth parameters
foreach ( $param_names as $param_name ) {
@ -239,7 +239,7 @@ class WC_API_Authentication {
$filters = $params['filter'];
unset( $params['filter'] );
foreach ( $filters as $filter => $filter_value ) {
$params['filter[' . $filter . ']'] = $filter_value;
$params[ 'filter[' . $filter . ']' ] = $filter_value;
}
}

View File

@ -39,7 +39,7 @@ class WC_API_Coupons extends WC_API_Resource {
);
# GET /coupons/count
$routes[ $this->base . '/count'] = array(
$routes[ $this->base . '/count' ] = array(
array( array( $this, 'get_coupons_count' ), WC_API_Server::READABLE ),
);
@ -73,7 +73,7 @@ class WC_API_Coupons extends WC_API_Resource {
$coupons = array();
foreach( $query->posts as $coupon_id ) {
foreach ( $query->posts as $coupon_id ) {
if ( ! $this->is_readable( $coupon_id ) )
continue;
@ -241,5 +241,4 @@ class WC_API_Coupons extends WC_API_Resource {
return new WP_Query( $query_args );
}
}

Some files were not shown because too many files have changed in this diff Show More