Automattic\WooCommerce\Gateways\PayPal
Buttons::get_page_type
Get the page type for the PayPal buttons.
Method of the class: Buttons{}
No Hooks.
Returns
String.
Usage
$Buttons = new Buttons(); $Buttons->get_page_type(): string;
Changelog
| Since 10.5.0 | Introduced. |
Buttons::get_page_type() Buttons::get page type code WC 10.8.1
public function get_page_type(): string {
$page_type = 'checkout';
if ( is_cart() || has_block( 'woocommerce/cart' ) ) {
$page_type = 'cart';
} elseif ( is_product() ) {
$page_type = 'product-details';
}
return $page_type;
}