mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Add woocommerce-one-page-checkout detection in product page
This commit is contained in:
parent
b4cc4dcfe9
commit
4c33f0bee3
1 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,12 @@ trait ContextTrait {
|
|||
*/
|
||||
protected function context(): string {
|
||||
if ( is_product() || wc_post_content_has_shortcode( 'product_page' ) ) {
|
||||
|
||||
// Detection if "woocommerce-one-page-checkout" is enabled for this product.
|
||||
if ( is_callable( 'is_wcopc_checkout' ) && is_wcopc_checkout( get_the_ID() ) ) {
|
||||
return 'checkout';
|
||||
}
|
||||
|
||||
return 'product';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue