Render Checkout/Cart containing pages without template overriding (https://github.com/woocommerce/woocommerce-blocks/pull/10359)

* Render Checkout/Cart containing pages without template overriding

* Fix checkout typo

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>
This commit is contained in:
Paulo Arromba 2023-07-26 13:25:49 +03:00 committed by GitHub
parent 025a280b33
commit 73633ee3d1
2 changed files with 4 additions and 2 deletions

View File

@ -32,7 +32,8 @@ class CartTemplate extends AbstractPageTemplate {
* @return boolean
*/
protected function is_active_template() {
return is_cart();
global $post;
return get_option( 'woocommerce_cart_page_endpoint' ) === $post->post_name;
}
/**

View File

@ -41,6 +41,7 @@ class CheckoutTemplate extends AbstractPageTemplate {
* @return boolean
*/
public function is_active_template() {
return is_checkout();
global $post;
return get_option( 'woocommerce_checkout_page_endpoint' ) === $post->post_name;
}
}