Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions includes/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace SkyVerge\WooCommerce\Facebook;

use SkyVerge\WooCommerce\PluginFramework\v5_10_0\SV_WC_Helper;
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
use Automattic\WooCommerce\Utilities\OrderUtil;

defined( 'ABSPATH' ) or exit;

Expand Down Expand Up @@ -47,9 +47,7 @@ class Admin {
*/
public function __construct() {

$order_screen_id = wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled()
? wc_get_page_screen_id( 'shop-order' )
: 'shop_order';
$order_screen_id = class_exists( OrderUtil::class ) ? OrderUtil::get_order_admin_screen() : 'shop_order';

$this->screen_ids = [
'product',
Expand Down
6 changes: 3 additions & 3 deletions tests/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use SkyVerge\WooCommerce\Facebook;
use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
use Automattic\WooCommerce\Utilities\OrderUtil;

/**
* Inherited Methods
Expand Down Expand Up @@ -198,7 +198,7 @@ public function amOnProductPage( $product_id ) {
*/
public function amOnOrdersPage() {

if ( wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() ) {
if ( class_exists( OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled() ) {
Comment thread
ibndawood marked this conversation as resolved.
$orders_page = 'admin.php?page=wc-orders';
} else {
$orders_page = 'edit.php?post_type=shop_order';
Expand All @@ -215,7 +215,7 @@ public function amOnOrdersPage() {
*/
public function amOnOrderPage( $order_id ) {

if ( wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() ) {
if ( class_exists( OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled() ) {
Comment thread
ibndawood marked this conversation as resolved.
$order_page = "admin.php?page=wc-orders&id={$order_id}&action=edit";
} else {
$order_page = "post.php?post={$order_id}&action=edit";
Expand Down