Skip to content

Commit 1c3a14d

Browse files
committed
Adjusting logic so the entire checkout process in WC can hide the banner, if desired.
1 parent ae1adfa commit 1c3a14d

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

modules/ecommerce/wc/class-swsales-module-wc.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,23 @@ public static function is_checkout_page( $is_checkout_page, $sitewide_sale ) {
264264
if ( 'wc' !== $sitewide_sale->get_sale_type() ) {
265265
return $is_checkout_page;
266266
}
267-
return ( ! empty( wc_get_page_id( 'cart' ) ) && is_page( wc_get_page_id( 'cart' ) ) ) ? true : $is_checkout_page;
267+
268+
// Check for cart page.
269+
if ( ! empty( wc_get_page_id( 'cart' ) ) && is_page( wc_get_page_id( 'cart' ) ) ) {
270+
return true;
271+
}
272+
273+
// Check for checkout page.
274+
if ( is_checkout() ) {
275+
return true;
276+
}
277+
278+
// Check for order confirmation/thank you page.
279+
if ( is_wc_endpoint_url( 'order-received' ) ) {
280+
return true;
281+
}
282+
283+
return $is_checkout_page;
268284
}
269285

270286
/**

0 commit comments

Comments
 (0)