Skip to content

Commit

Permalink
Add similar check to class-universal
Browse files Browse the repository at this point in the history
  • Loading branch information
bor0 committed Dec 19, 2024
1 parent 2d476f5 commit 1457785
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use WC_Order;
use WC_Product;
use WP_Post;

/**
* Filters and Actions added to Store pages to perform analytics
Expand Down Expand Up @@ -209,6 +210,12 @@ public function get_shipping_option_for_item( $cart_item_key ) {
* On the Checkout page, trigger an event for each product in the cart
*/
public function checkout_process() {
global $post;

if ( ! $post instanceof WP_Post ) {
return;
}

$checkout_page_id = wc_get_page_id( 'checkout' );
$cart = WC()->cart->get_cart();
$is_in_checkout_page = $checkout_page_id && is_page( $checkout_page_id ) ? 'Yes' : 'No';
Expand Down

0 comments on commit 1457785

Please sign in to comment.