mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Add checkout detection in product page
This commit is contained in:
parent
4c33f0bee3
commit
f517ac4719
1 changed files with 3 additions and 2 deletions
|
@ -19,8 +19,9 @@ 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() ) ) {
|
||||
// Do this check here instead of reordering outside conditions.
|
||||
// In order to have more control over the context.
|
||||
if ( ( is_checkout() ) && ! $this->is_paypal_continuation() ) {
|
||||
return 'checkout';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue