Skip to content

Commit 34cca4f

Browse files
committed
Merge branch 'trunk' into fix/onboarding-email-optin
2 parents b4b171c + 29ddd17 commit 34cca4f

File tree

16 files changed

+329
-47
lines changed

16 files changed

+329
-47
lines changed

plugins/woocommerce-admin/client/shipping/woocommerce-services-item.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ import { getAdminLink } from '@woocommerce/settings';
1313
*/
1414
import './woocommerce-services-item.scss';
1515
import WooIcon from './woo-icon.svg';
16-
import { getAdminSetting } from '../utils/admin-settings';
1716

1817
const WooCommerceServicesItem: React.FC< {
1918
pluginsBeingSetup: Array< string >;
2019
onSetupClick: ( slugs: string[] ) => PromiseLike< void >;
2120
} > = ( { onSetupClick, pluginsBeingSetup } ) => {
22-
const wcAdminAssetUrl = getAdminSetting( 'wcAdminAssetUrl', '' );
2321
const { createSuccessNotice } = useDispatch( 'core/notices' );
2422

2523
const isSiteConnectedToJetpack = useSelect( ( select ) =>

plugins/woocommerce-admin/client/wp-admin-scripts/print-shipping-label-banner/shipping-banner/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { get, isArray } from 'lodash';
1111
import { PLUGINS_STORE_NAME } from '@woocommerce/data';
1212
import { withDispatch, withSelect } from '@wordpress/data';
1313
import { recordEvent } from '@woocommerce/tracks';
14+
import { getSetting } from '@woocommerce/settings';
1415

1516
/**
1617
* Internal dependencies
@@ -19,9 +20,8 @@ import '../style.scss';
1920
import DismissModal from '../dismiss-modal';
2021
import SetupNotice, { setupErrorTypes } from '../setup-notice';
2122
import { getWcsAssets, acceptWcsTos } from '../wcs-api';
22-
import { getAdminSetting } from '~/utils/admin-settings';
2323

24-
const wcAdminAssetUrl = getAdminSetting( 'wcAdminAssetUrl', '' );
24+
const wcAssetUrl = getSetting( 'wcAssetUrl', '' );
2525
const wcsPluginSlug = 'woocommerce-services';
2626

2727
export class ShippingBanner extends Component {
@@ -399,7 +399,7 @@ export class ShippingBanner extends Component {
399399
<div className="wc-admin-shipping-banner-container">
400400
<img
401401
className="wc-admin-shipping-banner-illustration"
402-
src={ wcAdminAssetUrl + '/shippingillustration.svg' }
402+
src={ wcAssetUrl + 'images/shippingillustration.svg' }
403403
alt={ __( 'Shipping ', 'woocommerce' ) }
404404
/>
405405
<div className="wc-admin-shipping-banner-blob">
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: enhancement
3+
4+
Add total payments volume rule processor for inbox notifications #33192
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fix
3+
4+
Fix: Content width issue and Classic Template blocks alignment issue for Twenty Twenty-Two.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: dev
3+
4+
Deprecate wcAdminAssetUrl and WC_ADMIN_IMAGES_FOLDER_URL

plugins/woocommerce/includes/class-woocommerce.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class WooCommerce {
3030
*
3131
* @var string
3232
*/
33-
public $version = '6.6.0';
33+
public $version = '6.7.0';
3434

3535
/**
3636
* WooCommerce Schema version.

plugins/woocommerce/includes/theme-support/class-wc-twenty-twenty-two.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ class WC_Twenty_Twenty_Two {
2020
*/
2121
public static function init() {
2222

23-
// Change WooCommerce wrappers.
24-
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
25-
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
26-
2723
// This theme doesn't have a traditional sidebar.
2824
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
2925

@@ -38,7 +34,8 @@ public static function init() {
3834
add_theme_support( 'wc-product-gallery-zoom' );
3935
add_theme_support( 'wc-product-gallery-lightbox' );
4036
add_theme_support( 'wc-product-gallery-slider' );
41-
add_theme_support( 'woocommerce',
37+
add_theme_support(
38+
'woocommerce',
4239
array(
4340
'thumbnail_image_width' => 450,
4441
'single_image_width' => 600,

plugins/woocommerce/legacy/css/twenty-twenty-two.scss

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ $tt2-gray: #f7f7f7;
4343
h2 {
4444
font-size: var(--wp--preset--font-size--large);
4545
}
46-
}
47-
48-
.woocommerce-page {
4946

5047
main {
51-
5248
.woocommerce {
5349
@include clearfix();
5450
max-width: 1000px;
@@ -58,21 +54,6 @@ $tt2-gray: #f7f7f7;
5854

5955
.woocommerce {
6056

61-
.woocommerce-products-header,
62-
.woocommerce-notices-wrapper,
63-
.woocommerce-result-count,
64-
.woocommerce-ordering,
65-
.woocommerce-breadcrumb,
66-
.products {
67-
max-width: 1000px;
68-
}
69-
70-
.wp-site-blocks > .wp-block-group {
71-
max-width: 1000px;
72-
margin-left: auto;
73-
margin-right: auto;
74-
}
75-
7657
// Common
7758
.woocommerce-products-header {
7859
h1.page-title {
@@ -272,7 +253,6 @@ $tt2-gray: #f7f7f7;
272253

273254
div.product {
274255
position: relative;
275-
max-width: 1000px;
276256

277257
> span.onsale {
278258
position: absolute;
@@ -1153,14 +1133,6 @@ $tt2-gray: #f7f7f7;
11531133
*/
11541134
.woocommerce-account {
11551135

1156-
main {
1157-
1158-
.woocommerce {
1159-
@include clearfix();
1160-
max-width: 1000px;
1161-
}
1162-
}
1163-
11641136
.woocommerce-MyAccount-navigation {
11651137

11661138
ul {

plugins/woocommerce/src/Admin/API/Reports/Orders/DataStore.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ protected function include_extended_info( &$orders_data, $query_args ) {
353353

354354
if ( $is_variation ) {
355355
$variation = wc_get_product( $product_data['id'] );
356+
/**
357+
* Used to determine the separator for products and their variations titles.
358+
*
359+
* @since 4.0.0
360+
*/
356361
$separator = apply_filters( 'woocommerce_product_variation_title_attributes_separator', ' - ', $variation );
357362

358363
if ( false === strpos( $product_data['name'], $separator ) ) {

plugins/woocommerce/src/Admin/API/Reports/TimeInterval.php

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,4 +631,80 @@ public static function rest_validate_between_date_arg( $value, $request, $param
631631

632632
return true;
633633
}
634+
635+
/**
636+
* Get dates from a timeframe string.
637+
*
638+
* @param int $timeframe Timeframe to use. One of: last_week|last_month|last_quarter|last_6_months|last_year.
639+
* @param DateTime|null $current_date DateTime of current date to compare.
640+
* @return array
641+
*/
642+
public static function get_timeframe_dates( $timeframe, $current_date = null ) {
643+
if ( ! $current_date ) {
644+
$current_date = new \DateTime();
645+
}
646+
$current_year = $current_date->format( 'Y' );
647+
$current_month = $current_date->format( 'm' );
648+
649+
if ( 'last_week' === $timeframe ) {
650+
return array(
651+
'start' => $current_date->modify( 'last week monday' )->format( 'Y-m-d 00:00:00' ),
652+
'end' => $current_date->modify( 'this sunday' )->format( 'Y-m-d 23:59:59' ),
653+
);
654+
}
655+
656+
if ( 'last_month' === $timeframe ) {
657+
return array(
658+
'start' => $current_date->modify( 'first day of previous month' )->format( 'Y-m-d 00:00:00' ),
659+
'end' => $current_date->modify( 'last day of this month' )->format( 'Y-m-d 23:59:59' ),
660+
);
661+
}
662+
663+
if ( 'last_quarter' === $timeframe ) {
664+
switch ( $current_month ) {
665+
case $current_month >= 1 && $current_month <= 3:
666+
return array(
667+
'start' => ( $current_year - 1 ) . '-10-01 00:00:00',
668+
'end' => ( $current_year - 1 ) . '-12-31 23:59:59',
669+
);
670+
case $current_month >= 4 && $current_month <= 6:
671+
return array(
672+
'start' => $current_year . '-01-01 00:00:00',
673+
'end' => $current_year . '-03-31 23:59:59',
674+
);
675+
case $current_month >= 7 && $current_month <= 9:
676+
return array(
677+
'start' => $current_year . '-04-01 00:00:00',
678+
'end' => $current_year . '-06-30 23:59:59',
679+
);
680+
case $current_month >= 10 && $current_month <= 12:
681+
return array(
682+
'start' => $current_year . '-07-01 00:00:00',
683+
'end' => $current_year . '-09-31 23:59:59',
684+
);
685+
}
686+
}
687+
688+
if ( 'last_6_months' === $timeframe ) {
689+
if ( $current_month >= 1 && $current_month <= 6 ) {
690+
return array(
691+
'start' => ( $current_year - 1 ) . '-07-01 00:00:00',
692+
'end' => ( $current_year - 1 ) . '-12-31 23:59:59',
693+
);
694+
}
695+
return array(
696+
'start' => $current_year . '-01-01 00:00:00',
697+
'end' => $current_year . '-06-30 23:59:59',
698+
);
699+
}
700+
701+
if ( 'last_year' === $timeframe ) {
702+
return array(
703+
'start' => ( $current_year - 1 ) . '-01-01 00:00:00',
704+
'end' => ( $current_year - 1 ) . '-12-31 23:59:59',
705+
);
706+
}
707+
708+
return false;
709+
}
634710
}

0 commit comments

Comments
 (0)